summaryrefslogtreecommitdiff
path: root/src/app
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@theqtcompany.com>2015-04-20 12:36:12 +0200
committerEike Ziller <eike.ziller@theqtcompany.com>2015-04-20 12:19:16 +0000
commitb3fa02d0ed16f8a63654e17ed089fab091e1abc9 (patch)
treef3b5249a5d7b091c9c088ffb861cff7509094f73 /src/app
parent0ff8b9e283b82d51789353e1f26d23d9068909fb (diff)
downloadqt-creator-b3fa02d0ed16f8a63654e17ed089fab091e1abc9.tar.gz
Automatically choose device pixel ratio
Change-Id: Ic595ee0f45b7d3ec22b4c4086c0c6785b41c21f4 Task-number: QTCREATORBUG-11179 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Diffstat (limited to 'src/app')
-rw-r--r--src/app/main.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/app/main.cpp b/src/app/main.cpp
index 7092c89720..5a49d3da4e 100644
--- a/src/app/main.cpp
+++ b/src/app/main.cpp
@@ -45,6 +45,7 @@
#include <QLibraryInfo>
#include <QLoggingCategory>
#include <QSettings>
+#include <QStyle>
#include <QTextStream>
#include <QThreadPool>
#include <QTimer>
@@ -291,6 +292,8 @@ static inline QSettings *userSettings()
int main(int argc, char **argv)
{
+ if (!qEnvironmentVariableIsSet("QT_DEVICE_PIXEL_RATIO"))
+ qputenv("QT_DEVICE_PIXEL_RATIO", "auto");
QLoggingCategory::setFilterRules(QLatin1String("qtc.*.debug=false"));
#ifdef Q_OS_MAC
// increase the number of file that can be opened in Qt Creator.
@@ -303,6 +306,11 @@ int main(int argc, char **argv)
SharedTools::QtSingleApplication app((QLatin1String(appNameC)), argc, argv);
+ if (!qFuzzyCompare(qApp->devicePixelRatio(), 1.0)
+ && QApplication::style()->objectName().startsWith(
+ QLatin1String("windows"), Qt::CaseInsensitive)) {
+ QApplication::setStyle(QLatin1String("fusion"));
+ }
const int threadCount = QThreadPool::globalInstance()->maxThreadCount();
QThreadPool::globalInstance()->setMaxThreadCount(qMax(4, 2 * threadCount));