Enforce sans-serif by default in assistant
authorPierre Rossi <pierre.rossi@nokia.com>
Wed, 1 Aug 2012 20:30:23 +0000 (22:30 +0200)
committerQt by Nokia <qt-info@nokia.com>
Thu, 2 Aug 2012 11:02:35 +0000 (13:02 +0200)
Make the default font sans serif for HelpViewer's QWebView-based implementation
since it is what QTextBrowser uses by default, we probably want to blend in.

Change-Id: I07257d61cac9bffa28f90f31e352101b2e04cb0e
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
src/assistant/assistant/main.cpp

index c00430b..5e80979 100644 (file)
 
 #include <QtSql/QSqlDatabase>
 
+#if !defined(QT_NO_WEBKIT)
+#include <QtGui/QFont>
+#include <QtWebKit/QWebSettings>
+#endif
+
 #include "../shared/collectionconfiguration.h"
 #include "helpenginewrapper.h"
 #include "mainwindow.h"
@@ -319,6 +324,12 @@ int main(int argc, char *argv[])
     a.addLibraryPath(a.applicationDirPath() + QLatin1String("/plugins"));
     setupTranslations();
 
+#if !defined(QT_NO_WEBKIT)
+    QFont f;
+    f.setStyleHint(QFont::SansSerif);
+    QWebSettings::globalSettings()->setFontFamily(QWebSettings::StandardFont, f.defaultFamily());
+#endif
+
     // Parse arguments.
     CmdLineParser cmd(a.arguments());
     CmdLineParser::Result res = cmd.parse();