diff options
Diffstat (limited to 'examples/widgets')
-rw-r--r-- | examples/widgets/animation/CMakeLists.txt | 2 | ||||
-rw-r--r-- | examples/widgets/desktop/CMakeLists.txt | 2 | ||||
-rw-r--r-- | examples/widgets/doc/src/simpletreemodel.qdoc | 8 | ||||
-rw-r--r-- | examples/widgets/gallery/main.cpp | 1 | ||||
-rw-r--r-- | examples/widgets/gallery/widgetgallery.cpp | 24 | ||||
-rw-r--r-- | examples/widgets/itemviews/editabletreemodel/default.txt | 10 | ||||
-rw-r--r-- | examples/widgets/itemviews/simpletreemodel/default.txt | 10 | ||||
-rw-r--r-- | examples/widgets/widgets/shortcuteditor/CMakeLists.txt | 2 |
8 files changed, 43 insertions, 16 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/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 cfac821209..2677b3708c 100644 --- a/examples/widgets/gallery/main.cpp +++ b/examples/widgets/gallery/main.cpp @@ -2,6 +2,7 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause #include <QApplication> +#include <QStyleHints> #include "widgetgallery.h" diff --git a/examples/widgets/gallery/widgetgallery.cpp b/examples/widgets/gallery/widgetgallery.cpp index 2de46419d9..d38dcbd5e8 100644 --- a/examples/widgets/gallery/widgetgallery.cpp +++ b/examples/widgets/gallery/widgetgallery.cpp @@ -26,6 +26,7 @@ #include <QSpinBox> #include <QStandardItemModel> #include <QStyle> +#include <QStyleHints> #include <QStyleFactory> #include <QTextBrowser> #include <QTreeView> @@ -135,6 +136,21 @@ WidgetGallery::WidgetGallery(QWidget *parent) auto styleLabel = createWidget1<QLabel>(tr("&Style:"), "styleLabel"); styleLabel->setBuddy(styleComboBox); + auto colorSchemeComboBox = createWidget<QComboBox>("colorSchemeComboBox"); + 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); + + auto colorSchemeLabel = createWidget1<QLabel>(tr("&Color Scheme:"), "colorSchemeLabel"); + colorSchemeLabel->setBuddy(colorSchemeComboBox); + + connect(colorSchemeComboBox, &QComboBox::currentIndexChanged, this, [](int index){ + QGuiApplication::styleHints()->setColorScheme(static_cast<Qt::ColorScheme>(index)); + }); + auto helpLabel = createWidget1<QLabel>(tr("Press F1 over a widget to see Documentation"), "helpLabel"); auto disableWidgetsCheckBox = createWidget1<QCheckBox>(tr("&Disable widgets"), "disableWidgetsCheckBox"); @@ -156,8 +172,12 @@ WidgetGallery::WidgetGallery(QWidget *parent) simpleInputWidgetsGroupBox, &QWidget::setDisabled); auto topLayout = new QHBoxLayout; - topLayout->addWidget(styleLabel); - topLayout->addWidget(styleComboBox); + auto appearanceLayout = new QGridLayout; + appearanceLayout->addWidget(styleLabel, 0, 0); + appearanceLayout->addWidget(styleComboBox, 0, 1); + appearanceLayout->addWidget(colorSchemeLabel, 1, 0); + appearanceLayout->addWidget(colorSchemeComboBox, 1, 1); + topLayout->addLayout(appearanceLayout); topLayout->addStretch(1); topLayout->addWidget(helpLabel); topLayout->addStretch(1); 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) |