]> git.lyx.org Git - features.git/blobdiff - src/frontends/qt4/GuiApplication.cpp
Fix potential bug affecting export and preview with threads.
[features.git] / src / frontends / qt4 / GuiApplication.cpp
index c53331fb29e645ed5b2d1eb852d491f00d60abed..c56524fd24cf187f0e3e42aacf472a6f87ef886f 100644 (file)
 #include <QTextCodec>
 #include <QTimer>
 #include <QTranslator>
+#include <QThreadPool>
 #include <QWidget>
 
 #ifdef Q_WS_X11
@@ -820,6 +821,11 @@ GuiApplication::GuiApplication(int & argc, char ** argv)
        connect(&d->general_timer_, SIGNAL(timeout()),
                this, SLOT(handleRegularEvents()));
        d->general_timer_.start();
+
+       // maxThreadCount() defaults in general to 2 on single or dual-processor.
+       // This is clearly not enough in a time where we use threads for
+       // document preview and/or export. 20 should be OK.
+       QThreadPool::globalInstance()->setMaxThreadCount(20);
 }