From d427417c744b9035a2d28622a369908c6d347d84 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 24 Sep 2015 09:36:15 -0700 Subject: [PATCH] Print one warning for the new high DPI variables, not four For people with non-empty QT_MESSAGE_PATTERNS, the multiple lines would be unreadable. This is what it showed for me when starting Qt Creator: [1442136.587] qtcreator(82762 82762)(?libQt5Gui.so.5?|QGuiApplicationPrivate::createPlatformIntegration|QGuiApplicationPrivate::createEventDispatcher|QCoreApplication::init|QCoreApplication::QCoreApplication|QGuiApplication::QGuiApplication|QApplication::QApplication|?qtcreator?|?qtcreator?|__libc_start_main): Warning: QT_DEVICE_PIXEL_RATIO is deprecated. Instead use: [1442136.592] qtcreator(82762 82762)(?libQt5Gui.so.5?|QGuiApplicationPrivate::createPlatformIntegration|QGuiApplicationPrivate::createEventDispatcher|QCoreApplication::init|QCoreApplication::QCoreApplication|QGuiApplication::QGuiApplication|QApplication::QApplication|?qtcreator?|?qtcreator?|__libc_start_main): QT_AUTO_SCREEN_SCALE_FACTOR to enable platform plugin controlled per-screen factors. [1442136.592] qtcreator(82762 82762)(?libQt5Gui.so.5?|QGuiApplicationPrivate::createPlatformIntegration|QGuiApplicationPrivate::createEventDispatcher|QCoreApplication::init|QCoreApplication::QCoreApplication|QGuiApplication::QGuiApplication|QApplication::QApplication|?qtcreator?|?qtcreator?|__libc_start_main): QT_SCREEN_SCALE_FACTORS to set per-screen factors. [1442136.593] qtcreator(82762 82762)(?libQt5Gui.so.5?|QGuiApplicationPrivate::createPlatformIntegration|QGuiApplicationPrivate::createEventDispatcher|QCoreApplication::init|QCoreApplication::QCoreApplication|QGuiApplication::QGuiApplication|QApplication::QApplication|?qtcreator?|?qtcreator?|__libc_start_main): QT_SCALE_FACTOR to set the application global scale factor. (and imagine it line-broken in a terminal 140 columns wide) Change-Id: I42e7ef1a481840699a8dffff1406f73dc4d44a41 Reviewed-by: Friedemann Kleint --- src/gui/kernel/qhighdpiscaling.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/kernel/qhighdpiscaling.cpp b/src/gui/kernel/qhighdpiscaling.cpp index de586ac46c..daba9f94a1 100644 --- a/src/gui/kernel/qhighdpiscaling.cpp +++ b/src/gui/kernel/qhighdpiscaling.cpp @@ -62,10 +62,10 @@ static inline qreal initialScaleFactor() } } else { if (qEnvironmentVariableIsSet(legacyDevicePixelEnvVar)) { - qWarning() << "Warning:" << legacyDevicePixelEnvVar << "is deprecated. Instead use:"; - qWarning() << " " << autoScreenEnvVar << "to enable platform plugin controlled per-screen factors."; - qWarning() << " " << screenFactorsEnvVar << "to set per-screen factors."; - qWarning() << " " << scaleFactorEnvVar << "to set the application global scale factor."; + qWarning() << "Warning:" << legacyDevicePixelEnvVar << "is deprecated. Instead use:" << endl + << " " << autoScreenEnvVar << "to enable platform plugin controlled per-screen factors." << endl + << " " << screenFactorsEnvVar << "to set per-screen factors." << endl + << " " << scaleFactorEnvVar << "to set the application global scale factor."; int dpr = qEnvironmentVariableIntValue(legacyDevicePixelEnvVar); if (dpr > 0)