summaryrefslogtreecommitdiffstats
path: root/examples/widgets/desktop
diff options
context:
space:
mode:
Diffstat (limited to 'examples/widgets/desktop')
-rw-r--r--examples/widgets/desktop/CMakeLists.txt4
-rw-r--r--examples/widgets/desktop/screenshot/CMakeLists.txt32
-rw-r--r--examples/widgets/desktop/screenshot/screenshot.cpp2
-rw-r--r--examples/widgets/desktop/systray/CMakeLists.txt47
4 files changed, 84 insertions, 1 deletions
diff --git a/examples/widgets/desktop/CMakeLists.txt b/examples/widgets/desktop/CMakeLists.txt
new file mode 100644
index 0000000000..a50d3c2f0a
--- /dev/null
+++ b/examples/widgets/desktop/CMakeLists.txt
@@ -0,0 +1,4 @@
+# Generated from desktop.pro.
+
+add_subdirectory(screenshot)
+add_subdirectory(systray)
diff --git a/examples/widgets/desktop/screenshot/CMakeLists.txt b/examples/widgets/desktop/screenshot/CMakeLists.txt
new file mode 100644
index 0000000000..3145dd41e5
--- /dev/null
+++ b/examples/widgets/desktop/screenshot/CMakeLists.txt
@@ -0,0 +1,32 @@
+# Generated from screenshot.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(screenshot LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/desktop/screenshot")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(screenshot
+ main.cpp
+ screenshot.cpp screenshot.h
+)
+target_link_libraries(screenshot PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+install(TARGETS screenshot
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/widgets/desktop/screenshot/screenshot.cpp b/examples/widgets/desktop/screenshot/screenshot.cpp
index d0a849e0b8..af344db1d2 100644
--- a/examples/widgets/desktop/screenshot/screenshot.cpp
+++ b/examples/widgets/desktop/screenshot/screenshot.cpp
@@ -70,7 +70,7 @@ Screenshot::Screenshot()
delaySpinBox->setSuffix(tr(" s"));
delaySpinBox->setMaximum(60);
- connect(delaySpinBox, QOverload<int>::of(&QSpinBox::valueChanged),
+ connect(delaySpinBox, &QSpinBox::valueChanged,
this, &Screenshot::updateCheckBox);
hideThisWindowCheckBox = new QCheckBox(tr("Hide This Window"), optionsGroupBox);
diff --git a/examples/widgets/desktop/systray/CMakeLists.txt b/examples/widgets/desktop/systray/CMakeLists.txt
new file mode 100644
index 0000000000..16af7808d7
--- /dev/null
+++ b/examples/widgets/desktop/systray/CMakeLists.txt
@@ -0,0 +1,47 @@
+# Generated from systray.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(systray LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+set(INSTALL_EXAMPLEDIR "examples/widgets/desktop/systray")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Widgets)
+
+add_qt_gui_executable(systray
+ main.cpp
+ window.cpp window.h
+)
+target_link_libraries(systray PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+)
+
+
+# Resources:
+set(systray_resource_files
+ "images/bad.png"
+ "images/heart.png"
+ "images/trash.png"
+)
+
+qt6_add_resources(systray "systray"
+ PREFIX
+ "/"
+ FILES
+ ${systray_resource_files}
+)
+
+install(TARGETS systray
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)