From 6d2ae682b17709161d45b8710acf1107a3fb9a49 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Tue, 15 Sep 2020 17:01:23 +0200 Subject: Fix compile warning from deprecated application attributes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit AA_DisableHighDpiScaling and AA_UseHighDpiPixmaps have been deprecated. As of 90358f6042d1fe2db849e17e1b0c875fb0560b20 and 2dc46c09026362cc267b1183faf09fb29479ef93 in qtbase, respectively, these settings are deprecated and have no effect. Remove their setting, and also the respective command line options in Qt Designer and the pixeltool. Change-Id: Iaa057f6a8a8396b822d9190f17e5f9c73e9cc2bb Reviewed-by: Tor Arne Vestbø --- src/assistant/assistant/main.cpp | 2 -- src/designer/src/designer/main.cpp | 17 ----------------- src/designer/src/designer/qdesigner.cpp | 3 --- src/linguist/linguist/main.cpp | 3 --- src/pixeltool/main.cpp | 15 --------------- 5 files changed, 40 deletions(-) diff --git a/src/assistant/assistant/main.cpp b/src/assistant/assistant/main.cpp index f4abce9a7..f6a3bcf46 100644 --- a/src/assistant/assistant/main.cpp +++ b/src/assistant/assistant/main.cpp @@ -362,8 +362,6 @@ static ExitStatus preliminarySetup(CmdLineParser *cmd) int main(int argc, char *argv[]) { - QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); - QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); TRACE_OBJ QScopedPointer a(createApplication(argc, argv)); #if QT_CONFIG(library) diff --git a/src/designer/src/designer/main.cpp b/src/designer/src/designer/main.cpp index cd428bd4f..50c586ccc 100644 --- a/src/designer/src/designer/main.cpp +++ b/src/designer/src/designer/main.cpp @@ -34,27 +34,10 @@ QT_USE_NAMESPACE -static bool isOptionSet(int argc, char *argv[], const char *option) -{ - for (int i = 1; i < argc; ++i) { - if (qstrcmp(argv[i], option) == 0) - return true; - } - return false; -} - int main(int argc, char *argv[]) { Q_INIT_RESOURCE(designer); - // Attributes to be set before QApplication is constructed. - if (isOptionSet(argc, argv, "--no-scaling")) { - QCoreApplication::setAttribute(Qt::AA_DisableHighDpiScaling); - } else { - QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); - QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); - } - // required for QWebEngineView QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts); diff --git a/src/designer/src/designer/qdesigner.cpp b/src/designer/src/designer/qdesigner.cpp index 2aef55a70..ea3780af1 100644 --- a/src/designer/src/designer/qdesigner.cpp +++ b/src/designer/src/designer/qdesigner.cpp @@ -189,9 +189,6 @@ static inline QDesigner::ParseArgumentsResult const QCommandLineOption internalDynamicPropertyOption(QStringLiteral("enableinternaldynamicproperties"), QStringLiteral("Enable internal dynamic properties")); parser.addOption(internalDynamicPropertyOption); - const QCommandLineOption noScalingOption(QStringLiteral("no-scaling"), - QStringLiteral("Disable High DPI scaling")); - parser.addOption(noScalingOption); parser.addPositionalArgument(QStringLiteral("files"), QStringLiteral("The UI files to open.")); diff --git a/src/linguist/linguist/main.cpp b/src/linguist/linguist/main.cpp index ab14fb78e..df920880e 100644 --- a/src/linguist/linguist/main.cpp +++ b/src/linguist/linguist/main.cpp @@ -89,9 +89,6 @@ int main(int argc, char **argv) { Q_INIT_RESOURCE(linguist); - QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); - QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); - QApplication app(argc, argv); QApplication::setOverrideCursor(Qt::WaitCursor); diff --git a/src/pixeltool/main.cpp b/src/pixeltool/main.cpp index 3e17d61b5..c4250d367 100644 --- a/src/pixeltool/main.cpp +++ b/src/pixeltool/main.cpp @@ -35,20 +35,8 @@ QT_USE_NAMESPACE -static bool isOptionSet(int argc, char *argv[], const char *option) -{ - for (int i = 1; i < argc; ++i) { - if (!qstrcmp(argv[i], option)) - return true; - } - return false; -} - int main(int argc, char **argv) { - if (isOptionSet(argc, argv, "--no-scaling")) - QCoreApplication::setAttribute(Qt::AA_DisableHighDpiScaling); - QApplication app(argc, argv); QCoreApplication::setApplicationName(QLatin1String("PixelTool")); QCoreApplication::setApplicationVersion(QLatin1String(QT_VERSION_STR)); @@ -57,9 +45,6 @@ int main(int argc, char **argv) QCommandLineParser parser; parser.addHelpOption(); parser.addVersionOption(); - QCommandLineOption noScalingDummy(QStringLiteral("no-scaling"), - QStringLiteral("Set Qt::AA_DisableHighDpiScaling.")); - parser.addOption(noScalingDummy); parser.addPositionalArgument(QLatin1String("preview"), QLatin1String("The preview image to show.")); -- cgit v1.2.3