summaryrefslogtreecommitdiffstats
path: root/examples/widgets/desktop
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@qt.io>2019-04-16 16:32:08 +0200
committerTobias Hunger <tobias.hunger@qt.io>2019-04-16 16:32:08 +0200
commit6630937e63ae5797487b86743a7733c8ae5cc42c (patch)
tree3d53dacf6430f9099e1fb20835881205de674961 /examples/widgets/desktop
parent37ed6dae00640f9cc980ffda05347c12a7eb5d7e (diff)
parentc7af193d2e49e9f10b86262e63d8d13abf72b5cf (diff)
Merge commit 'dev' into 'wip/cmake-merge'
Diffstat (limited to 'examples/widgets/desktop')
-rw-r--r--examples/widgets/desktop/screenshot/screenshot.cpp3
-rw-r--r--examples/widgets/desktop/systray/main.cpp4
-rw-r--r--examples/widgets/desktop/systray/window.cpp2
3 files changed, 6 insertions, 3 deletions
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<QByteArray> baMimeTypes = QImageWriter::supportedMimeTypes();
+ for (const QByteArray &bf : baMimeTypes)
mimeTypes.append(QLatin1String(bf));
fileDialog.setMimeTypeFilters(mimeTypes);
fileDialog.selectMimeTypeFilter("image/" + format);
diff --git a/examples/widgets/desktop/systray/main.cpp b/examples/widgets/desktop/systray/main.cpp
index 49b0e10412..2d91e4ac36 100644
--- a/examples/widgets/desktop/systray/main.cpp
+++ b/examples/widgets/desktop/systray/main.cpp
@@ -59,10 +59,12 @@ int main(int argc, char *argv[])
{
Q_INIT_RESOURCE(systray);
+ QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
+
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?"));
}