From aa32510430d6a5e58cb456faeb072d9f189872fe Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Sun, 2 Dec 2018 14:11:13 +0100 Subject: Cleanup Widgets examples - nullptr Cleanup the widgets examples - replace 0 with nullptr Change-Id: Id4bf119b9a41f6d10117f3a613a6e604128fa196 Reviewed-by: Konstantin Shegunov Reviewed-by: Edward Welbourne Reviewed-by: Paul Wicking --- examples/widgets/desktop/systray/main.cpp | 2 +- examples/widgets/desktop/systray/window.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/widgets/desktop') diff --git a/examples/widgets/desktop/systray/main.cpp b/examples/widgets/desktop/systray/main.cpp index 49b0e10412..4e3e628767 100644 --- a/examples/widgets/desktop/systray/main.cpp +++ b/examples/widgets/desktop/systray/main.cpp @@ -62,7 +62,7 @@ int main(int argc, char *argv[]) QApplication app(argc, argv); if (!QSystemTrayIcon::isSystemTrayAvailable()) { - QMessageBox::critical(0, QObject::tr("Systray"), + QMessageBox::critical(nullptr, QObject::tr("Systray"), QObject::tr("I couldn't detect any system tray " "on this system.")); return 1; diff --git a/examples/widgets/desktop/systray/window.cpp b/examples/widgets/desktop/systray/window.cpp index 05944c92a7..31fcd84821 100644 --- a/examples/widgets/desktop/systray/window.cpp +++ b/examples/widgets/desktop/systray/window.cpp @@ -176,7 +176,7 @@ void Window::showMessage() //! [6] void Window::messageClicked() { - QMessageBox::information(0, tr("Systray"), + QMessageBox::information(nullptr, tr("Systray"), tr("Sorry, I already gave what help I could.\n" "Maybe you should try asking a human?")); } -- cgit v1.2.3 From 34e4a8ef6d20e829a322bfef1d09136a37fecfd2 Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Fri, 7 Dec 2018 12:01:42 +0100 Subject: Cleanup Widgets examples - foreach Cleanup the Widgets examples - replace foreach with range-based for loop in the remaining directories Change-Id: I321e6c0f414401a1ae4fb65762b97d894b725afa Reviewed-by: Paul Wicking Reviewed-by: Luca Beldi --- examples/widgets/desktop/screenshot/screenshot.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'examples/widgets/desktop') diff --git a/examples/widgets/desktop/screenshot/screenshot.cpp b/examples/widgets/desktop/screenshot/screenshot.cpp index 80f26ae282..715e6c780e 100644 --- a/examples/widgets/desktop/screenshot/screenshot.cpp +++ b/examples/widgets/desktop/screenshot/screenshot.cpp @@ -139,7 +139,8 @@ void Screenshot::saveScreenshot() fileDialog.setFileMode(QFileDialog::AnyFile); fileDialog.setDirectory(initialPath); QStringList mimeTypes; - foreach (const QByteArray &bf, QImageWriter::supportedMimeTypes()) + const QList baMimeTypes = QImageWriter::supportedMimeTypes(); + for (const QByteArray &bf : baMimeTypes) mimeTypes.append(QLatin1String(bf)); fileDialog.setMimeTypeFilters(mimeTypes); fileDialog.selectMimeTypeFilter("image/" + format); -- cgit v1.2.3 From 50f3f8f6bb8f5482c713480fad80421760184216 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 13 Mar 2019 08:34:01 +0100 Subject: Use High DPI pixmaps in prominent examples and tests Set AA_UseHighDpiPixmaps. Task-number: QTBUG-52622 Change-Id: Ic4373a9c94952f50bc1ad36bcc0dec850efc124a Reviewed-by: Robert Loehning Reviewed-by: Richard Moe Gustavsen --- examples/widgets/desktop/systray/main.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'examples/widgets/desktop') diff --git a/examples/widgets/desktop/systray/main.cpp b/examples/widgets/desktop/systray/main.cpp index 49b0e10412..d981415b44 100644 --- a/examples/widgets/desktop/systray/main.cpp +++ b/examples/widgets/desktop/systray/main.cpp @@ -59,6 +59,8 @@ int main(int argc, char *argv[]) { Q_INIT_RESOURCE(systray); + QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); + QApplication app(argc, argv); if (!QSystemTrayIcon::isSystemTrayAvailable()) { -- cgit v1.2.3