summaryrefslogtreecommitdiffstats
path: root/examples/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'examples/widgets')
-rw-r--r--examples/widgets/animation/CMakeLists.txt2
-rw-r--r--examples/widgets/desktop/CMakeLists.txt2
-rw-r--r--examples/widgets/desktop/systray/main.cpp10
-rw-r--r--examples/widgets/doc/src/simpletreemodel.qdoc8
-rw-r--r--examples/widgets/gallery/main.cpp1
-rw-r--r--examples/widgets/gallery/widgetgallery.cpp4
-rw-r--r--examples/widgets/itemviews/editabletreemodel/default.txt10
-rw-r--r--examples/widgets/itemviews/simpletreemodel/default.txt10
-rw-r--r--examples/widgets/widgets/shortcuteditor/CMakeLists.txt2
9 files changed, 28 insertions, 21 deletions
diff --git a/examples/widgets/animation/CMakeLists.txt b/examples/widgets/animation/CMakeLists.txt
index d9a18bb866..ed8ee0558c 100644
--- a/examples/widgets/animation/CMakeLists.txt
+++ b/examples/widgets/animation/CMakeLists.txt
@@ -1 +1,3 @@
+# Copyright (C) 2024 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
qt_internal_add_example(easing)
diff --git a/examples/widgets/desktop/CMakeLists.txt b/examples/widgets/desktop/CMakeLists.txt
index 169fa9ffac..0f4eda12aa 100644
--- a/examples/widgets/desktop/CMakeLists.txt
+++ b/examples/widgets/desktop/CMakeLists.txt
@@ -1,2 +1,4 @@
+# Copyright (C) 2024 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
qt_internal_add_example(screenshot)
qt_internal_add_example(systray)
diff --git a/examples/widgets/desktop/systray/main.cpp b/examples/widgets/desktop/systray/main.cpp
index d13bde11ce..37f6809a33 100644
--- a/examples/widgets/desktop/systray/main.cpp
+++ b/examples/widgets/desktop/systray/main.cpp
@@ -13,10 +13,12 @@ int main(int argc, char *argv[])
QApplication app(argc, argv);
if (!QSystemTrayIcon::isSystemTrayAvailable()) {
- QMessageBox::critical(nullptr, QObject::tr("Systray"),
- QObject::tr("I couldn't detect any system tray "
- "on this system."));
- return 1;
+ auto choice = QMessageBox::critical(nullptr, QObject::tr("Systray"),
+ QObject::tr("I couldn't detect any system tray on this system."),
+ QMessageBox::Close | QMessageBox::Ignore);
+ if (choice == QMessageBox::Close)
+ return 1;
+ // Otherwise "lurk": if a system tray is started later, the icon will appear.
}
QApplication::setQuitOnLastWindowClosed(false);
diff --git a/examples/widgets/doc/src/simpletreemodel.qdoc b/examples/widgets/doc/src/simpletreemodel.qdoc
index aa12a9585f..d8e5a6faa8 100644
--- a/examples/widgets/doc/src/simpletreemodel.qdoc
+++ b/examples/widgets/doc/src/simpletreemodel.qdoc
@@ -295,14 +295,14 @@
We begin with a text file in the following format:
\code
- Getting Started How to familiarize yourself with Qt Designer
- Launching Designer Running the Qt Designer application
- The User Interface How to interact with Qt Designer
+ Getting Started How to familiarize yourself with Qt Widgets Designer
+ Launching Designer Running the Qt Widgets Designer application
+ The User Interface How to interact with Qt Widgets Designer
\endcode
\dots
\code
Connection Editing Mode Connecting widgets together with signals and slots
- Connecting Objects Making connections in Qt Designer
+ Connecting Objects Making connections in Qt Widgets Designer
Editing Connections Changing existing connections
\endcode
diff --git a/examples/widgets/gallery/main.cpp b/examples/widgets/gallery/main.cpp
index 2677b3708c..95fffbdd3c 100644
--- a/examples/widgets/gallery/main.cpp
+++ b/examples/widgets/gallery/main.cpp
@@ -9,6 +9,7 @@
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
+ app.styleHints()->setColorScheme(Qt::ColorScheme::Dark);
WidgetGallery gallery;
gallery.show();
return QCoreApplication::exec();
diff --git a/examples/widgets/gallery/widgetgallery.cpp b/examples/widgets/gallery/widgetgallery.cpp
index d38dcbd5e8..92c878fcb6 100644
--- a/examples/widgets/gallery/widgetgallery.cpp
+++ b/examples/widgets/gallery/widgetgallery.cpp
@@ -140,9 +140,7 @@ WidgetGallery::WidgetGallery(QWidget *parent)
colorSchemeComboBox->addItem(tr("Auto"));
colorSchemeComboBox->addItem(tr("Light"));
colorSchemeComboBox->addItem(tr("Dark"));
- // override the color scheme to dark
- qApp->styleHints()->setColorScheme(Qt::ColorScheme::Dark);
- colorSchemeComboBox->setCurrentIndex(2);
+ colorSchemeComboBox->setCurrentIndex(static_cast<int>(qApp->styleHints()->colorScheme()));
auto colorSchemeLabel = createWidget1<QLabel>(tr("&Color Scheme:"), "colorSchemeLabel");
colorSchemeLabel->setBuddy(colorSchemeComboBox);
diff --git a/examples/widgets/itemviews/editabletreemodel/default.txt b/examples/widgets/itemviews/editabletreemodel/default.txt
index 2b2fb579ae..c3ea35257c 100644
--- a/examples/widgets/itemviews/editabletreemodel/default.txt
+++ b/examples/widgets/itemviews/editabletreemodel/default.txt
@@ -1,6 +1,6 @@
-Getting Started How to familiarize yourself with Qt Designer
- Launching Designer Running the Qt Designer application
- The User Interface How to interact with Qt Designer
+Getting Started How to familiarize yourself with Qt Widgets Designer
+ Launching Designer Running the Qt Widgets Designer application
+ The User Interface How to interact with Qt Widgets Designer
Designing a Component Creating a GUI for your application
Creating a Dialog How to create a dialog
@@ -16,7 +16,7 @@ Using a Component in Your Application Generating code from forms
A Dialog Without Auto-Connect How to connect widgets without a naming scheme
A Dialog With Auto-Connect Using automatic connections
-Form Editing Mode How to edit a form in Qt Designer
+Form Editing Mode How to edit a form in Qt Widgets Designer
Managing Forms Loading and saving forms
Editing a Form Basic editing techniques
The Property Editor Changing widget properties
@@ -36,5 +36,5 @@ Using Containers How to group widgets together
Toolbox Widgets QToolBox
Connection Editing Mode Connecting widgets together with signals and slots
- Connecting Objects Making connections in Qt Designer
+ Connecting Objects Making connections in Qt Widgets Designer
Editing Connections Changing existing connections
diff --git a/examples/widgets/itemviews/simpletreemodel/default.txt b/examples/widgets/itemviews/simpletreemodel/default.txt
index 2b2fb579ae..c3ea35257c 100644
--- a/examples/widgets/itemviews/simpletreemodel/default.txt
+++ b/examples/widgets/itemviews/simpletreemodel/default.txt
@@ -1,6 +1,6 @@
-Getting Started How to familiarize yourself with Qt Designer
- Launching Designer Running the Qt Designer application
- The User Interface How to interact with Qt Designer
+Getting Started How to familiarize yourself with Qt Widgets Designer
+ Launching Designer Running the Qt Widgets Designer application
+ The User Interface How to interact with Qt Widgets Designer
Designing a Component Creating a GUI for your application
Creating a Dialog How to create a dialog
@@ -16,7 +16,7 @@ Using a Component in Your Application Generating code from forms
A Dialog Without Auto-Connect How to connect widgets without a naming scheme
A Dialog With Auto-Connect Using automatic connections
-Form Editing Mode How to edit a form in Qt Designer
+Form Editing Mode How to edit a form in Qt Widgets Designer
Managing Forms Loading and saving forms
Editing a Form Basic editing techniques
The Property Editor Changing widget properties
@@ -36,5 +36,5 @@ Using Containers How to group widgets together
Toolbox Widgets QToolBox
Connection Editing Mode Connecting widgets together with signals and slots
- Connecting Objects Making connections in Qt Designer
+ Connecting Objects Making connections in Qt Widgets Designer
Editing Connections Changing existing connections
diff --git a/examples/widgets/widgets/shortcuteditor/CMakeLists.txt b/examples/widgets/widgets/shortcuteditor/CMakeLists.txt
index 5d1c4a8dc1..d10248fbd7 100644
--- a/examples/widgets/widgets/shortcuteditor/CMakeLists.txt
+++ b/examples/widgets/widgets/shortcuteditor/CMakeLists.txt
@@ -1,3 +1,5 @@
+# Copyright (C) 2024 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
cmake_minimum_required(VERSION 3.16)
project(shortcuteditor LANGUAGES CXX)