diff options
Diffstat (limited to 'examples/widgets/desktop/systray')
-rw-r--r-- | examples/widgets/desktop/systray/CMakeLists.txt | 47 | ||||
-rw-r--r-- | examples/widgets/desktop/systray/window.cpp | 2 |
2 files changed, 48 insertions, 1 deletions
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}" +) diff --git a/examples/widgets/desktop/systray/window.cpp b/examples/widgets/desktop/systray/window.cpp index e30166beac..3238e3bf31 100644 --- a/examples/widgets/desktop/systray/window.cpp +++ b/examples/widgets/desktop/systray/window.cpp @@ -80,7 +80,7 @@ Window::Window() connect(showMessageButton, &QAbstractButton::clicked, this, &Window::showMessage); connect(showIconCheckBox, &QAbstractButton::toggled, trayIcon, &QSystemTrayIcon::setVisible); - connect(iconComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), + connect(iconComboBox, &QComboBox::currentIndexChanged, this, &Window::setIcon); connect(trayIcon, &QSystemTrayIcon::messageClicked, this, &Window::messageClicked); connect(trayIcon, &QSystemTrayIcon::activated, this, &Window::iconActivated); |