diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-07-12 01:00:11 +0200 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2019-07-12 15:29:54 +0200 |
commit | 38c2b80e65b66f8f85ad177307277107d63d9b50 (patch) | |
tree | f46fd98df047244fc5eb90b3643e967399784f25 /examples | |
parent | f5840944a6c29df162c5bdcaf488647f17877fab (diff) | |
parent | 77d126ccb58aba85ab6f363c4314f8481aa0cf1d (diff) |
Merge "Merge remote-tracking branch 'origin/5.12' into 5.13"
Diffstat (limited to 'examples')
-rw-r--r-- | examples/widgets/desktop/systray/window.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/examples/widgets/desktop/systray/window.cpp b/examples/widgets/desktop/systray/window.cpp index 31fcd84821..e30166beac 100644 --- a/examples/widgets/desktop/systray/window.cpp +++ b/examples/widgets/desktop/systray/window.cpp @@ -160,9 +160,10 @@ void Window::iconActivated(QSystemTrayIcon::ActivationReason reason) void Window::showMessage() { showIconCheckBox->setChecked(true); - QSystemTrayIcon::MessageIcon msgIcon = QSystemTrayIcon::MessageIcon( - typeComboBox->itemData(typeComboBox->currentIndex()).toInt()); - if (msgIcon == QSystemTrayIcon::NoIcon) { + int selectedIcon = typeComboBox->itemData(typeComboBox->currentIndex()).toInt(); + QSystemTrayIcon::MessageIcon msgIcon = QSystemTrayIcon::MessageIcon(selectedIcon); + + if (selectedIcon == -1) { // custom icon QIcon icon(iconComboBox->itemIcon(iconComboBox->currentIndex())); trayIcon->showMessage(titleEdit->text(), bodyEdit->toPlainText(), icon, durationSpinBox->value() * 1000); @@ -222,7 +223,7 @@ void Window::createMessageGroupBox() QStyle::SP_MessageBoxCritical), tr("Critical"), QSystemTrayIcon::Critical); typeComboBox->addItem(QIcon(), tr("Custom icon"), - QSystemTrayIcon::NoIcon); + -1); typeComboBox->setCurrentIndex(1); durationLabel = new QLabel(tr("Duration:")); |