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 <Friedemann.Kleint@theqtcompany.com>
bb10
Thiago Macieira 2015-09-24 09:36:15 -07:00
parent c61aaa28df
commit d427417c74
1 changed files with 4 additions and 4 deletions

View File

@ -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)