Commit b3fa02d0 authored by Eike Ziller's avatar Eike Ziller

Automatically choose device pixel ratio

Change-Id: Ic595ee0f45b7d3ec22b4c4086c0c6785b41c21f4
Task-number: QTCREATORBUG-11179
Reviewed-by: default avatarFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: default avatarEike Ziller <eike.ziller@theqtcompany.com>
parent 0ff8b9e2
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,7 @@
#include <QLibraryInfo> #include <QLibraryInfo>
#include <QLoggingCategory> #include <QLoggingCategory>
#include <QSettings> #include <QSettings>
#include <QStyle>
#include <QTextStream> #include <QTextStream>
#include <QThreadPool> #include <QThreadPool>
#include <QTimer> #include <QTimer>
...@@ -291,6 +292,8 @@ static inline QSettings *userSettings() ...@@ -291,6 +292,8 @@ static inline QSettings *userSettings()
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
if (!qEnvironmentVariableIsSet("QT_DEVICE_PIXEL_RATIO"))
qputenv("QT_DEVICE_PIXEL_RATIO", "auto");
QLoggingCategory::setFilterRules(QLatin1String("qtc.*.debug=false")); QLoggingCategory::setFilterRules(QLatin1String("qtc.*.debug=false"));
#ifdef Q_OS_MAC #ifdef Q_OS_MAC
// increase the number of file that can be opened in Qt Creator. // increase the number of file that can be opened in Qt Creator.
...@@ -303,6 +306,11 @@ int main(int argc, char **argv) ...@@ -303,6 +306,11 @@ int main(int argc, char **argv)
SharedTools::QtSingleApplication app((QLatin1String(appNameC)), argc, 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(); const int threadCount = QThreadPool::globalInstance()->maxThreadCount();
QThreadPool::globalInstance()->setMaxThreadCount(qMax(4, 2 * threadCount)); QThreadPool::globalInstance()->setMaxThreadCount(qMax(4, 2 * threadCount));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment