summaryrefslogtreecommitdiffstats
path: root/examples/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'examples/widgets')
-rw-r--r--examples/widgets/.prev_CMakeLists.txt32
-rw-r--r--examples/widgets/CMakeLists.txt4
-rw-r--r--examples/widgets/animation/CMakeLists.txt2
-rw-r--r--examples/widgets/animation/easing/CMakeLists.txt16
-rw-r--r--examples/widgets/desktop/CMakeLists.txt2
-rw-r--r--examples/widgets/desktop/screenshot/CMakeLists.txt14
-rw-r--r--examples/widgets/desktop/systray/CMakeLists.txt17
-rw-r--r--examples/widgets/desktop/systray/doc/src/systray.qdoc8
-rw-r--r--examples/widgets/desktop/systray/window.cpp5
-rw-r--r--examples/widgets/dialogs/.prev_CMakeLists.txt13
-rw-r--r--examples/widgets/dialogs/CMakeLists.txt2
-rw-r--r--examples/widgets/dialogs/classwizard/CMakeLists.txt17
-rw-r--r--examples/widgets/dialogs/extension/CMakeLists.txt14
-rw-r--r--examples/widgets/dialogs/findfiles/CMakeLists.txt14
-rw-r--r--examples/widgets/dialogs/licensewizard/CMakeLists.txt18
-rw-r--r--examples/widgets/dialogs/standarddialogs/CMakeLists.txt14
-rw-r--r--examples/widgets/dialogs/tabdialog/CMakeLists.txt14
-rw-r--r--examples/widgets/dialogs/trivialwizard/CMakeLists.txt14
-rw-r--r--examples/widgets/draganddrop/CMakeLists.txt2
-rw-r--r--examples/widgets/draganddrop/draggableicons/CMakeLists.txt17
-rw-r--r--examples/widgets/draganddrop/draggabletext/CMakeLists.txt17
-rw-r--r--examples/widgets/draganddrop/dropsite/CMakeLists.txt14
-rw-r--r--examples/widgets/draganddrop/fridgemagnets/CMakeLists.txt17
-rw-r--r--examples/widgets/draganddrop/puzzle/.prev_CMakeLists.txt55
-rw-r--r--examples/widgets/draganddrop/puzzle/CMakeLists.txt27
-rw-r--r--examples/widgets/draganddrop/puzzle/puzzlewidget.cpp4
-rw-r--r--examples/widgets/effects/CMakeLists.txt2
-rw-r--r--examples/widgets/effects/blurpicker/CMakeLists.txt17
-rw-r--r--examples/widgets/effects/fademessage/CMakeLists.txt17
-rw-r--r--examples/widgets/gallery/CMakeLists.txt14
-rw-r--r--examples/widgets/gestures/CMakeLists.txt2
-rw-r--r--examples/widgets/gestures/imagegestures/CMakeLists.txt14
-rw-r--r--examples/widgets/graphicsview/CMakeLists.txt2
-rw-r--r--examples/widgets/graphicsview/anchorlayout/CMakeLists.txt14
-rw-r--r--examples/widgets/graphicsview/basicgraphicslayouts/CMakeLists.txt17
-rw-r--r--examples/widgets/graphicsview/chip/.prev_CMakeLists.txt66
-rw-r--r--examples/widgets/graphicsview/chip/CMakeLists.txt22
-rw-r--r--examples/widgets/graphicsview/collidingmice/CMakeLists.txt17
-rw-r--r--examples/widgets/graphicsview/diagramscene/CMakeLists.txt17
-rw-r--r--examples/widgets/graphicsview/dragdroprobot/CMakeLists.txt17
-rw-r--r--examples/widgets/graphicsview/elasticnodes/CMakeLists.txt14
-rw-r--r--examples/widgets/graphicsview/embeddeddialogs/CMakeLists.txt16
-rw-r--r--examples/widgets/graphicsview/flowlayout/.prev_CMakeLists.txt41
-rw-r--r--examples/widgets/graphicsview/flowlayout/CMakeLists.txt24
-rw-r--r--examples/widgets/graphicsview/simpleanchorlayout/CMakeLists.txt14
-rw-r--r--examples/widgets/graphicsview/weatheranchorlayout/CMakeLists.txt17
-rw-r--r--examples/widgets/itemviews/.prev_CMakeLists.txt27
-rw-r--r--examples/widgets/itemviews/CMakeLists.txt2
-rw-r--r--examples/widgets/itemviews/addressbook/CMakeLists.txt14
-rw-r--r--examples/widgets/itemviews/basicsortfiltermodel/CMakeLists.txt14
-rw-r--r--examples/widgets/itemviews/chart/CMakeLists.txt17
-rw-r--r--examples/widgets/itemviews/coloreditorfactory/CMakeLists.txt14
-rw-r--r--examples/widgets/itemviews/combowidgetmapper/CMakeLists.txt14
-rw-r--r--examples/widgets/itemviews/customsortfiltermodel/CMakeLists.txt17
-rw-r--r--examples/widgets/itemviews/dirview/CMakeLists.txt14
-rw-r--r--examples/widgets/itemviews/editabletreemodel/CMakeLists.txt16
-rw-r--r--examples/widgets/itemviews/fetchmore/CMakeLists.txt14
-rw-r--r--examples/widgets/itemviews/flattreeview/CMakeLists.txt14
-rw-r--r--examples/widgets/itemviews/frozencolumn/CMakeLists.txt17
-rw-r--r--examples/widgets/itemviews/interview/CMakeLists.txt17
-rw-r--r--examples/widgets/itemviews/pixelator/.prev_CMakeLists.txt61
-rw-r--r--examples/widgets/itemviews/pixelator/CMakeLists.txt21
-rw-r--r--examples/widgets/itemviews/puzzle/.prev_CMakeLists.txt55
-rw-r--r--examples/widgets/itemviews/puzzle/CMakeLists.txt25
-rw-r--r--examples/widgets/itemviews/puzzle/puzzlewidget.cpp4
-rw-r--r--examples/widgets/itemviews/simpledommodel/CMakeLists.txt15
-rw-r--r--examples/widgets/itemviews/simpletreemodel/CMakeLists.txt17
-rw-r--r--examples/widgets/itemviews/simplewidgetmapper/CMakeLists.txt14
-rw-r--r--examples/widgets/itemviews/spinboxdelegate/CMakeLists.txt14
-rw-r--r--examples/widgets/itemviews/spreadsheet/.prev_CMakeLists.txt62
-rw-r--r--examples/widgets/itemviews/spreadsheet/CMakeLists.txt24
-rw-r--r--examples/widgets/itemviews/stardelegate/CMakeLists.txt14
-rw-r--r--examples/widgets/itemviews/storageview/CMakeLists.txt14
-rw-r--r--examples/widgets/layouts/CMakeLists.txt2
-rw-r--r--examples/widgets/layouts/basiclayouts/CMakeLists.txt14
-rw-r--r--examples/widgets/layouts/borderlayout/CMakeLists.txt14
-rw-r--r--examples/widgets/layouts/dynamiclayouts/CMakeLists.txt14
-rw-r--r--examples/widgets/layouts/flowlayout/CMakeLists.txt14
-rw-r--r--examples/widgets/mainwindows/CMakeLists.txt2
-rw-r--r--examples/widgets/mainwindows/application/CMakeLists.txt17
-rw-r--r--examples/widgets/mainwindows/dockwidgets/.prev_CMakeLists.txt62
-rw-r--r--examples/widgets/mainwindows/dockwidgets/CMakeLists.txt24
-rw-r--r--examples/widgets/mainwindows/mainwindow/CMakeLists.txt17
-rw-r--r--examples/widgets/mainwindows/mdi/CMakeLists.txt17
-rw-r--r--examples/widgets/mainwindows/menus/CMakeLists.txt14
-rw-r--r--examples/widgets/mainwindows/sdi/CMakeLists.txt17
-rw-r--r--examples/widgets/painting/.prev_CMakeLists.txt13
-rw-r--r--examples/widgets/painting/CMakeLists.txt5
-rw-r--r--examples/widgets/painting/affine/.prev_CMakeLists.txt118
-rw-r--r--examples/widgets/painting/affine/CMakeLists.txt28
-rw-r--r--examples/widgets/painting/basicdrawing/CMakeLists.txt17
-rw-r--r--examples/widgets/painting/composition/.prev_CMakeLists.txt119
-rw-r--r--examples/widgets/painting/composition/CMakeLists.txt28
-rw-r--r--examples/widgets/painting/concentriccircles/CMakeLists.txt14
-rw-r--r--examples/widgets/painting/deform/.prev_CMakeLists.txt117
-rw-r--r--examples/widgets/painting/deform/CMakeLists.txt28
-rw-r--r--examples/widgets/painting/fontsampler/CMakeLists.txt17
-rw-r--r--examples/widgets/painting/gradients/.prev_CMakeLists.txt117
-rw-r--r--examples/widgets/painting/gradients/CMakeLists.txt28
-rw-r--r--examples/widgets/painting/imagecomposition/CMakeLists.txt17
-rw-r--r--examples/widgets/painting/painterpaths/CMakeLists.txt14
-rw-r--r--examples/widgets/painting/pathstroke/.prev_CMakeLists.txt117
-rw-r--r--examples/widgets/painting/pathstroke/CMakeLists.txt28
-rw-r--r--examples/widgets/painting/shared/CMakeLists.txt4
-rw-r--r--examples/widgets/painting/transformations/CMakeLists.txt14
-rw-r--r--examples/widgets/qnx/foreignwindows/collector.cpp2
-rw-r--r--examples/widgets/qnx/foreignwindows/collector.h2
-rw-r--r--examples/widgets/richtext/CMakeLists.txt2
-rw-r--r--examples/widgets/richtext/calendar/CMakeLists.txt14
-rw-r--r--examples/widgets/richtext/orderform/CMakeLists.txt14
-rw-r--r--examples/widgets/richtext/syntaxhighlighter/CMakeLists.txt14
-rw-r--r--examples/widgets/richtext/textedit/.prev_CMakeLists.txt108
-rw-r--r--examples/widgets/richtext/textedit/CMakeLists.txt24
-rw-r--r--examples/widgets/scroller/CMakeLists.txt2
-rw-r--r--examples/widgets/scroller/graphicsview/CMakeLists.txt14
-rw-r--r--examples/widgets/tools/.prev_CMakeLists.txt17
-rw-r--r--examples/widgets/tools/CMakeLists.txt11
-rw-r--r--examples/widgets/tools/completer/CMakeLists.txt17
-rw-r--r--examples/widgets/tools/customcompleter/CMakeLists.txt17
-rw-r--r--examples/widgets/tools/echoplugin/CMakeLists.txt2
-rw-r--r--examples/widgets/tools/echoplugin/echowindow/.prev_CMakeLists.txt41
-rw-r--r--examples/widgets/tools/echoplugin/echowindow/CMakeLists.txt2
-rw-r--r--examples/widgets/tools/echoplugin/plugin/.prev_CMakeLists.txt35
-rw-r--r--examples/widgets/tools/echoplugin/plugin/CMakeLists.txt3
-rw-r--r--examples/widgets/tools/i18n/CMakeLists.txt17
-rw-r--r--examples/widgets/tools/plugandpaint/CMakeLists.txt4
-rw-r--r--examples/widgets/tools/plugandpaint/app/.prev_CMakeLists.txt74
-rw-r--r--examples/widgets/tools/plugandpaint/app/CMakeLists.txt2
-rw-r--r--examples/widgets/tools/plugandpaint/plugins/basictools/.prev_CMakeLists.txt36
-rw-r--r--examples/widgets/tools/plugandpaint/plugins/basictools/CMakeLists.txt2
-rw-r--r--examples/widgets/tools/plugandpaint/plugins/extrafilters/.prev_CMakeLists.txt36
-rw-r--r--examples/widgets/tools/plugandpaint/plugins/extrafilters/CMakeLists.txt3
-rw-r--r--examples/widgets/tools/regularexpression/CMakeLists.txt17
-rw-r--r--examples/widgets/tools/settingseditor/CMakeLists.txt14
-rw-r--r--examples/widgets/tools/styleplugin/.prev_CMakeLists.txt4
-rw-r--r--examples/widgets/tools/styleplugin/CMakeLists.txt2
-rw-r--r--examples/widgets/tools/styleplugin/plugin/.prev_CMakeLists.txt32
-rw-r--r--examples/widgets/tools/styleplugin/plugin/CMakeLists.txt3
-rw-r--r--examples/widgets/tools/styleplugin/stylewindow/CMakeLists.txt3
-rw-r--r--examples/widgets/tools/treemodelcompleter/CMakeLists.txt17
-rw-r--r--examples/widgets/tools/undo/CMakeLists.txt14
-rw-r--r--examples/widgets/tools/undoframework/CMakeLists.txt17
-rw-r--r--examples/widgets/touch/CMakeLists.txt2
-rw-r--r--examples/widgets/touch/dials/CMakeLists.txt13
-rw-r--r--examples/widgets/touch/fingerpaint/.prev_CMakeLists.txt47
-rw-r--r--examples/widgets/touch/fingerpaint/CMakeLists.txt21
-rw-r--r--examples/widgets/touch/knobs/CMakeLists.txt14
-rw-r--r--examples/widgets/touch/pinchzoom/CMakeLists.txt17
-rw-r--r--examples/widgets/tutorials/CMakeLists.txt2
-rw-r--r--examples/widgets/tutorials/addressbook/CMakeLists.txt2
-rw-r--r--examples/widgets/tutorials/addressbook/part1/CMakeLists.txt14
-rw-r--r--examples/widgets/tutorials/addressbook/part2/CMakeLists.txt14
-rw-r--r--examples/widgets/tutorials/addressbook/part3/CMakeLists.txt14
-rw-r--r--examples/widgets/tutorials/addressbook/part4/CMakeLists.txt14
-rw-r--r--examples/widgets/tutorials/addressbook/part5/CMakeLists.txt14
-rw-r--r--examples/widgets/tutorials/addressbook/part6/CMakeLists.txt14
-rw-r--r--examples/widgets/tutorials/addressbook/part7/CMakeLists.txt14
-rw-r--r--examples/widgets/tutorials/gettingStarted/gsQt/CMakeLists.txt2
-rw-r--r--examples/widgets/tutorials/gettingStarted/gsQt/part1/CMakeLists.txt14
-rw-r--r--examples/widgets/tutorials/gettingStarted/gsQt/part2/CMakeLists.txt14
-rw-r--r--examples/widgets/tutorials/gettingStarted/gsQt/part3/CMakeLists.txt14
-rw-r--r--examples/widgets/tutorials/gettingStarted/gsQt/part4/CMakeLists.txt14
-rw-r--r--examples/widgets/tutorials/gettingStarted/gsQt/part5/CMakeLists.txt14
-rw-r--r--examples/widgets/tutorials/modelview/1_readonly/CMakeLists.txt14
-rw-r--r--examples/widgets/tutorials/modelview/2_formatting/CMakeLists.txt14
-rw-r--r--examples/widgets/tutorials/modelview/3_changingmodel/CMakeLists.txt14
-rw-r--r--examples/widgets/tutorials/modelview/4_headers/CMakeLists.txt14
-rw-r--r--examples/widgets/tutorials/modelview/5_edit/CMakeLists.txt14
-rw-r--r--examples/widgets/tutorials/modelview/6_treeview/CMakeLists.txt14
-rw-r--r--examples/widgets/tutorials/modelview/7_selections/CMakeLists.txt14
-rw-r--r--examples/widgets/tutorials/modelview/CMakeLists.txt2
-rw-r--r--examples/widgets/tutorials/notepad/.prev_CMakeLists.txt76
-rw-r--r--examples/widgets/tutorials/notepad/CMakeLists.txt20
-rw-r--r--examples/widgets/tutorials/widgets/CMakeLists.txt2
-rw-r--r--examples/widgets/tutorials/widgets/childwidget/CMakeLists.txt14
-rw-r--r--examples/widgets/tutorials/widgets/nestedlayouts/CMakeLists.txt14
-rw-r--r--examples/widgets/tutorials/widgets/toplevel/CMakeLists.txt14
-rw-r--r--examples/widgets/tutorials/widgets/windowlayout/CMakeLists.txt14
-rw-r--r--examples/widgets/widgets/CMakeLists.txt2
-rw-r--r--examples/widgets/widgets/analogclock/CMakeLists.txt14
-rw-r--r--examples/widgets/widgets/calculator/CMakeLists.txt14
-rw-r--r--examples/widgets/widgets/calendarwidget/CMakeLists.txt14
-rw-r--r--examples/widgets/widgets/charactermap/CMakeLists.txt14
-rw-r--r--examples/widgets/widgets/codeeditor/CMakeLists.txt14
-rw-r--r--examples/widgets/widgets/digitalclock/CMakeLists.txt14
-rw-r--r--examples/widgets/widgets/elidedlabel/CMakeLists.txt14
-rw-r--r--examples/widgets/widgets/groupbox/CMakeLists.txt14
-rw-r--r--examples/widgets/widgets/icons/.prev_CMakeLists.txt47
-rw-r--r--examples/widgets/widgets/icons/CMakeLists.txt16
-rw-r--r--examples/widgets/widgets/imageviewer/.prev_CMakeLists.txt46
-rw-r--r--examples/widgets/widgets/imageviewer/CMakeLists.txt21
-rw-r--r--examples/widgets/widgets/lineedits/CMakeLists.txt14
-rw-r--r--examples/widgets/widgets/mousebuttons/CMakeLists.txt14
-rw-r--r--examples/widgets/widgets/movie/CMakeLists.txt14
-rw-r--r--examples/widgets/widgets/scribble/.prev_CMakeLists.txt47
-rw-r--r--examples/widgets/widgets/scribble/CMakeLists.txt21
-rw-r--r--examples/widgets/widgets/shapedclock/CMakeLists.txt14
-rw-r--r--examples/widgets/widgets/sliders/CMakeLists.txt14
-rw-r--r--examples/widgets/widgets/spinboxes/CMakeLists.txt14
-rw-r--r--examples/widgets/widgets/styles/CMakeLists.txt17
-rw-r--r--examples/widgets/widgets/stylesheet/CMakeLists.txt16
-rw-r--r--examples/widgets/widgets/tablet/CMakeLists.txt17
-rw-r--r--examples/widgets/widgets/tetrix/CMakeLists.txt14
-rw-r--r--examples/widgets/widgets/tooltips/CMakeLists.txt17
-rw-r--r--examples/widgets/widgets/validators/CMakeLists.txt14
-rw-r--r--examples/widgets/widgets/wiggly/CMakeLists.txt14
-rw-r--r--examples/widgets/widgets/windowflags/CMakeLists.txt14
-rw-r--r--examples/widgets/windowcontainer/CMakeLists.txt15
208 files changed, 714 insertions, 3359 deletions
diff --git a/examples/widgets/.prev_CMakeLists.txt b/examples/widgets/.prev_CMakeLists.txt
deleted file mode 100644
index cffc0a6293..0000000000
--- a/examples/widgets/.prev_CMakeLists.txt
+++ /dev/null
@@ -1,32 +0,0 @@
-# Generated from widgets.pro.
-
-if(NOT TARGET Qt::Widgets)
- return()
-endif()
-if(QT_FEATURE_animation)
- add_subdirectory(animation)
-endif()
-add_subdirectory(desktop)
-add_subdirectory(dialogs)
-add_subdirectory(effects)
-add_subdirectory(gallery)
-add_subdirectory(gestures)
-add_subdirectory(graphicsview)
-add_subdirectory(itemviews)
-add_subdirectory(layouts)
-add_subdirectory(painting)
-add_subdirectory(richtext)
-add_subdirectory(scroller)
-add_subdirectory(tools)
-add_subdirectory(touch)
-add_subdirectory(tutorials)
-add_subdirectory(widgets)
-if(QT_FEATURE_draganddrop)
- add_subdirectory(draganddrop)
-endif()
-if(QT_FEATURE_cursor)
- add_subdirectory(mainwindows)
-endif()
-if(QT_FEATURE_opengl AND TARGET Qt::Gui)
- add_subdirectory(windowcontainer)
-endif()
diff --git a/examples/widgets/CMakeLists.txt b/examples/widgets/CMakeLists.txt
index 753e3b8499..13f8066ed8 100644
--- a/examples/widgets/CMakeLists.txt
+++ b/examples/widgets/CMakeLists.txt
@@ -1,5 +1,3 @@
-# Generated from widgets.pro.
-
if(NOT TARGET Qt::Widgets)
return()
endif()
@@ -24,7 +22,7 @@ add_subdirectory(widgets)
if(QT_FEATURE_draganddrop)
add_subdirectory(draganddrop)
endif()
-if(QT_FEATURE_cursor) # special case
+if(QT_FEATURE_cursor)
add_subdirectory(mainwindows)
endif()
if(QT_FEATURE_opengl AND TARGET Qt::Gui)
diff --git a/examples/widgets/animation/CMakeLists.txt b/examples/widgets/animation/CMakeLists.txt
index 70f484a778..d9a18bb866 100644
--- a/examples/widgets/animation/CMakeLists.txt
+++ b/examples/widgets/animation/CMakeLists.txt
@@ -1,3 +1 @@
-# Generated from animation.pro.
-
qt_internal_add_example(easing)
diff --git a/examples/widgets/animation/easing/CMakeLists.txt b/examples/widgets/animation/easing/CMakeLists.txt
index 4a577c5c0c..cb3d733de4 100644
--- a/examples/widgets/animation/easing/CMakeLists.txt
+++ b/examples/widgets/animation/easing/CMakeLists.txt
@@ -1,23 +1,16 @@
-# Generated from easing.pro.
-
cmake_minimum_required(VERSION 3.16)
project(easing LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/animation/easing")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(easing
animation.h
@@ -25,23 +18,24 @@ qt_add_executable(easing
main.cpp
window.cpp window.h
)
+
set_target_properties(easing PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(easing PUBLIC
Qt::Core
Qt::Gui
Qt::Widgets
)
-
# Resources:
set(easing_resource_files
"images/qt-logo.png"
)
-qt6_add_resources(easing "easing"
+qt_add_resources(easing "easing"
PREFIX
"/"
FILES
diff --git a/examples/widgets/desktop/CMakeLists.txt b/examples/widgets/desktop/CMakeLists.txt
index b317205c43..169fa9ffac 100644
--- a/examples/widgets/desktop/CMakeLists.txt
+++ b/examples/widgets/desktop/CMakeLists.txt
@@ -1,4 +1,2 @@
-# Generated from desktop.pro.
-
qt_internal_add_example(screenshot)
qt_internal_add_example(systray)
diff --git a/examples/widgets/desktop/screenshot/CMakeLists.txt b/examples/widgets/desktop/screenshot/CMakeLists.txt
index bbc525c719..bb392e049d 100644
--- a/examples/widgets/desktop/screenshot/CMakeLists.txt
+++ b/examples/widgets/desktop/screenshot/CMakeLists.txt
@@ -1,32 +1,26 @@
-# Generated from screenshot.pro.
-
cmake_minimum_required(VERSION 3.16)
project(screenshot LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/desktop/screenshot")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(screenshot
main.cpp
screenshot.cpp screenshot.h
)
+
set_target_properties(screenshot PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(screenshot PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/desktop/systray/CMakeLists.txt b/examples/widgets/desktop/systray/CMakeLists.txt
index f52a523ad4..64841e4066 100644
--- a/examples/widgets/desktop/systray/CMakeLists.txt
+++ b/examples/widgets/desktop/systray/CMakeLists.txt
@@ -1,39 +1,32 @@
-# Generated from systray.pro.
-
cmake_minimum_required(VERSION 3.16)
project(systray LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/desktop/systray")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(systray
main.cpp
window.cpp window.h
)
+
set_target_properties(systray PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(systray PUBLIC
Qt::Core
Qt::Gui
Qt::Widgets
)
-
# Resources:
set(systray_resource_files
"images/bad.png"
@@ -41,7 +34,7 @@ set(systray_resource_files
"images/trash.png"
)
-qt6_add_resources(systray "systray"
+qt_add_resources(systray "systray"
PREFIX
"/"
FILES
diff --git a/examples/widgets/desktop/systray/doc/src/systray.qdoc b/examples/widgets/desktop/systray/doc/src/systray.qdoc
index ae7e925bd8..3a2c1bfa6b 100644
--- a/examples/widgets/desktop/systray/doc/src/systray.qdoc
+++ b/examples/widgets/desktop/systray/doc/src/systray.qdoc
@@ -173,11 +173,11 @@
We have reimplemented the QWidget::closeEvent() event handler to
receive widget close events, showing the above message to the
- users when they are closing the editor window. On \macos we need to
+ users when they are closing the editor window. We need to
avoid showing the message and accepting the close event when the
- user really intends to quit the application, that is, when the
- user has triggered "Quit" in the menu bar or pressed the Command+Q
- shortcut.
+ user really intends to quit the application: that is, when the
+ user has triggered "Quit" in the menu bar, or in the tray icon's
+ context menu, or pressed Command+Q shortcut on \macOS.
In addition to the functions and slots discussed above, we have
also implemented several convenience functions to simplify the
diff --git a/examples/widgets/desktop/systray/window.cpp b/examples/widgets/desktop/systray/window.cpp
index e62b5fc0d0..f14a4e578f 100644
--- a/examples/widgets/desktop/systray/window.cpp
+++ b/examples/widgets/desktop/systray/window.cpp
@@ -111,11 +111,8 @@ void Window::setVisible(bool visible)
//! [2]
void Window::closeEvent(QCloseEvent *event)
{
-#ifdef Q_OS_MACOS
- if (!event->spontaneous() || !isVisible()) {
+ if (!event->spontaneous() || !isVisible())
return;
- }
-#endif
if (trayIcon->isVisible()) {
QMessageBox::information(this, tr("Systray"),
tr("The program will keep running in the "
diff --git a/examples/widgets/dialogs/.prev_CMakeLists.txt b/examples/widgets/dialogs/.prev_CMakeLists.txt
deleted file mode 100644
index 354424bf1f..0000000000
--- a/examples/widgets/dialogs/.prev_CMakeLists.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-# Generated from dialogs.pro.
-
-if(QT_FEATURE_wizard)
- add_subdirectory(classwizard)
- add_subdirectory(trivialwizard)
-endif()
-add_subdirectory(extension)
-add_subdirectory(findfiles)
-add_subdirectory(standarddialogs)
-add_subdirectory(tabdialog)
-if(QT_FEATURE_wizard AND TARGET Qt::PrintSupport)
- add_subdirectory(licensewizard)
-endif()
diff --git a/examples/widgets/dialogs/CMakeLists.txt b/examples/widgets/dialogs/CMakeLists.txt
index 32f8bc29a8..90361e2e28 100644
--- a/examples/widgets/dialogs/CMakeLists.txt
+++ b/examples/widgets/dialogs/CMakeLists.txt
@@ -1,5 +1,3 @@
-# Generated from dialogs.pro.
-
if(QT_FEATURE_wizard)
qt_internal_add_example(classwizard)
qt_internal_add_example(trivialwizard)
diff --git a/examples/widgets/dialogs/classwizard/CMakeLists.txt b/examples/widgets/dialogs/classwizard/CMakeLists.txt
index b45c5bbc15..5061f23d93 100644
--- a/examples/widgets/dialogs/classwizard/CMakeLists.txt
+++ b/examples/widgets/dialogs/classwizard/CMakeLists.txt
@@ -1,39 +1,32 @@
-# Generated from classwizard.pro.
-
cmake_minimum_required(VERSION 3.16)
project(classwizard LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/dialogs/classwizard")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(classwizard
classwizard.cpp classwizard.h
main.cpp
)
+
set_target_properties(classwizard PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(classwizard PUBLIC
Qt::Core
Qt::Gui
Qt::Widgets
)
-
# Resources:
set(classwizard_resource_files
"images/background.png"
@@ -45,7 +38,7 @@ set(classwizard_resource_files
"images/watermark2.png"
)
-qt6_add_resources(classwizard "classwizard"
+qt_add_resources(classwizard "classwizard"
PREFIX
"/"
FILES
diff --git a/examples/widgets/dialogs/extension/CMakeLists.txt b/examples/widgets/dialogs/extension/CMakeLists.txt
index be555e6a10..283cbd1364 100644
--- a/examples/widgets/dialogs/extension/CMakeLists.txt
+++ b/examples/widgets/dialogs/extension/CMakeLists.txt
@@ -1,32 +1,26 @@
-# Generated from extension.pro.
-
cmake_minimum_required(VERSION 3.16)
project(extension LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/dialogs/extension")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(extension
finddialog.cpp finddialog.h
main.cpp
)
+
set_target_properties(extension PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(extension PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/dialogs/findfiles/CMakeLists.txt b/examples/widgets/dialogs/findfiles/CMakeLists.txt
index cf183d29e2..cdd0a6964a 100644
--- a/examples/widgets/dialogs/findfiles/CMakeLists.txt
+++ b/examples/widgets/dialogs/findfiles/CMakeLists.txt
@@ -1,32 +1,26 @@
-# Generated from findfiles.pro.
-
cmake_minimum_required(VERSION 3.16)
project(findfiles LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/dialogs/findfiles")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(findfiles
main.cpp
window.cpp window.h
)
+
set_target_properties(findfiles PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(findfiles PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/dialogs/licensewizard/CMakeLists.txt b/examples/widgets/dialogs/licensewizard/CMakeLists.txt
index 7fc7ac65fa..497cfff064 100644
--- a/examples/widgets/dialogs/licensewizard/CMakeLists.txt
+++ b/examples/widgets/dialogs/licensewizard/CMakeLists.txt
@@ -1,33 +1,26 @@
-# Generated from licensewizard.pro.
-
cmake_minimum_required(VERSION 3.16)
project(licensewizard LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/dialogs/licensewizard")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
-find_package(Qt6 COMPONENTS PrintSupport)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui PrintSupport Widgets)
qt_add_executable(licensewizard
licensewizard.cpp licensewizard.h
main.cpp
)
+
set_target_properties(licensewizard PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(licensewizard PUBLIC
Qt::Core
Qt::Gui
@@ -35,14 +28,13 @@ target_link_libraries(licensewizard PUBLIC
Qt::Widgets
)
-
# Resources:
set(licensewizard_resource_files
"images/logo.png"
"images/watermark.png"
)
-qt6_add_resources(licensewizard "licensewizard"
+qt_add_resources(licensewizard "licensewizard"
PREFIX
"/"
FILES
diff --git a/examples/widgets/dialogs/standarddialogs/CMakeLists.txt b/examples/widgets/dialogs/standarddialogs/CMakeLists.txt
index 9cb52e22dd..b64c304262 100644
--- a/examples/widgets/dialogs/standarddialogs/CMakeLists.txt
+++ b/examples/widgets/dialogs/standarddialogs/CMakeLists.txt
@@ -1,32 +1,26 @@
-# Generated from standarddialogs.pro.
-
cmake_minimum_required(VERSION 3.16)
project(standarddialogs LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/dialogs/standarddialogs")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(standarddialogs
dialog.cpp dialog.h
main.cpp
)
+
set_target_properties(standarddialogs PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(standarddialogs PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/dialogs/tabdialog/CMakeLists.txt b/examples/widgets/dialogs/tabdialog/CMakeLists.txt
index b61a8ef89c..f03cdaacdb 100644
--- a/examples/widgets/dialogs/tabdialog/CMakeLists.txt
+++ b/examples/widgets/dialogs/tabdialog/CMakeLists.txt
@@ -1,32 +1,26 @@
-# Generated from tabdialog.pro.
-
cmake_minimum_required(VERSION 3.16)
project(tabdialog LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/dialogs/tabdialog")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(tabdialog
main.cpp
tabdialog.cpp tabdialog.h
)
+
set_target_properties(tabdialog PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(tabdialog PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/dialogs/trivialwizard/CMakeLists.txt b/examples/widgets/dialogs/trivialwizard/CMakeLists.txt
index d57cbd59c3..d3c1adf2aa 100644
--- a/examples/widgets/dialogs/trivialwizard/CMakeLists.txt
+++ b/examples/widgets/dialogs/trivialwizard/CMakeLists.txt
@@ -1,31 +1,25 @@
-# Generated from trivialwizard.pro.
-
cmake_minimum_required(VERSION 3.16)
project(trivialwizard LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/dialogs/trivialwizard")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(trivialwizard
trivialwizard.cpp
)
+
set_target_properties(trivialwizard PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(trivialwizard PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/draganddrop/CMakeLists.txt b/examples/widgets/draganddrop/CMakeLists.txt
index 87ba702aca..c7d8d068d6 100644
--- a/examples/widgets/draganddrop/CMakeLists.txt
+++ b/examples/widgets/draganddrop/CMakeLists.txt
@@ -1,5 +1,3 @@
-# Generated from draganddrop.pro.
-
qt_internal_add_example(draggableicons)
qt_internal_add_example(draggabletext)
qt_internal_add_example(dropsite)
diff --git a/examples/widgets/draganddrop/draggableicons/CMakeLists.txt b/examples/widgets/draganddrop/draggableicons/CMakeLists.txt
index 8c64fc9335..ed20dbf14b 100644
--- a/examples/widgets/draganddrop/draggableicons/CMakeLists.txt
+++ b/examples/widgets/draganddrop/draggableicons/CMakeLists.txt
@@ -1,39 +1,32 @@
-# Generated from draggableicons.pro.
-
cmake_minimum_required(VERSION 3.16)
project(draggableicons LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/draganddrop/draggableicons")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(draggableicons
dragwidget.cpp dragwidget.h
main.cpp
)
+
set_target_properties(draggableicons PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(draggableicons PUBLIC
Qt::Core
Qt::Gui
Qt::Widgets
)
-
# Resources:
set(draggableicons_resource_files
"images/boat.png"
@@ -41,7 +34,7 @@ set(draggableicons_resource_files
"images/house.png"
)
-qt6_add_resources(draggableicons "draggableicons"
+qt_add_resources(draggableicons "draggableicons"
PREFIX
"/"
FILES
diff --git a/examples/widgets/draganddrop/draggabletext/CMakeLists.txt b/examples/widgets/draganddrop/draggabletext/CMakeLists.txt
index c4fced0f89..71b7f59ab7 100644
--- a/examples/widgets/draganddrop/draggabletext/CMakeLists.txt
+++ b/examples/widgets/draganddrop/draggabletext/CMakeLists.txt
@@ -1,45 +1,38 @@
-# Generated from draggabletext.pro.
-
cmake_minimum_required(VERSION 3.16)
project(draggabletext LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/draganddrop/draggabletext")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(draggabletext
dragwidget.cpp dragwidget.h
main.cpp
)
+
set_target_properties(draggabletext PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(draggabletext PUBLIC
Qt::Core
Qt::Gui
Qt::Widgets
)
-
# Resources:
set(draggabletext_resource_files
"words.txt"
)
-qt6_add_resources(draggabletext "draggabletext"
+qt_add_resources(draggabletext "draggabletext"
PREFIX
"/dictionary"
FILES
diff --git a/examples/widgets/draganddrop/dropsite/CMakeLists.txt b/examples/widgets/draganddrop/dropsite/CMakeLists.txt
index ee29b665a5..86ce3b71af 100644
--- a/examples/widgets/draganddrop/dropsite/CMakeLists.txt
+++ b/examples/widgets/draganddrop/dropsite/CMakeLists.txt
@@ -1,33 +1,27 @@
-# Generated from dropsite.pro.
-
cmake_minimum_required(VERSION 3.16)
project(dropsite LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/draganddrop/dropsite")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(dropsite
droparea.cpp droparea.h
dropsitewindow.cpp dropsitewindow.h
main.cpp
)
+
set_target_properties(dropsite PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(dropsite PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/draganddrop/fridgemagnets/CMakeLists.txt b/examples/widgets/draganddrop/fridgemagnets/CMakeLists.txt
index 0292d661ac..4b956a7cee 100644
--- a/examples/widgets/draganddrop/fridgemagnets/CMakeLists.txt
+++ b/examples/widgets/draganddrop/fridgemagnets/CMakeLists.txt
@@ -1,46 +1,39 @@
-# Generated from fridgemagnets.pro.
-
cmake_minimum_required(VERSION 3.16)
project(fridgemagnets LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/draganddrop/fridgemagnets")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(fridgemagnets
draglabel.cpp draglabel.h
dragwidget.cpp dragwidget.h
main.cpp
)
+
set_target_properties(fridgemagnets PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(fridgemagnets PUBLIC
Qt::Core
Qt::Gui
Qt::Widgets
)
-
# Resources:
set(fridgemagnets_resource_files
"words.txt"
)
-qt6_add_resources(fridgemagnets "fridgemagnets"
+qt_add_resources(fridgemagnets "fridgemagnets"
PREFIX
"/dictionary"
FILES
diff --git a/examples/widgets/draganddrop/puzzle/.prev_CMakeLists.txt b/examples/widgets/draganddrop/puzzle/.prev_CMakeLists.txt
deleted file mode 100644
index bcc7708662..0000000000
--- a/examples/widgets/draganddrop/puzzle/.prev_CMakeLists.txt
+++ /dev/null
@@ -1,55 +0,0 @@
-# Generated from puzzle.pro.
-
-cmake_minimum_required(VERSION 3.14)
-project(puzzle LANGUAGES CXX)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
-
-if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
-endif()
-
-set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/draganddrop/puzzle")
-
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
-
-qt_add_executable(puzzle
- main.cpp
- mainwindow.cpp mainwindow.h
- pieceslist.cpp pieceslist.h
- puzzlewidget.cpp puzzlewidget.h
-)
-set_target_properties(puzzle PROPERTIES
- WIN32_EXECUTABLE TRUE
- MACOSX_BUNDLE TRUE
-)
-target_link_libraries(puzzle PUBLIC
- Qt::Core
- Qt::Gui
- Qt::Widgets
-)
-
-
-# Resources:
-set(puzzle_resource_files
- "example.jpg"
-)
-
-qt6_add_resources(puzzle "puzzle"
- PREFIX
- "/images"
- FILES
- ${puzzle_resource_files}
-)
-
-install(TARGETS puzzle
- RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
- BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
- LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
-)
diff --git a/examples/widgets/draganddrop/puzzle/CMakeLists.txt b/examples/widgets/draganddrop/puzzle/CMakeLists.txt
index 27ce443ffa..1aa33ae0c0 100644
--- a/examples/widgets/draganddrop/puzzle/CMakeLists.txt
+++ b/examples/widgets/draganddrop/puzzle/CMakeLists.txt
@@ -1,54 +1,47 @@
-# Generated from puzzle.pro.
-
cmake_minimum_required(VERSION 3.16)
project(puzzle LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
-set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/draganddrop_puzzle") # special case
+set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/draganddrop_puzzle")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
-qt_add_executable(draganddrop_puzzle # special case: renamed puzzle
+qt_add_executable(draganddrop_puzzle
main.cpp
mainwindow.cpp mainwindow.h
pieceslist.cpp pieceslist.h
puzzlewidget.cpp puzzlewidget.h
)
-set_target_properties(draganddrop_puzzle PROPERTIES # special case
+
+set_target_properties(draganddrop_puzzle PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
-target_link_libraries(draganddrop_puzzle PUBLIC # special case
+
+target_link_libraries(draganddrop_puzzle PUBLIC
Qt::Core
Qt::Gui
Qt::Widgets
)
-
# Resources:
set(puzzle_resource_files
"example.jpg"
)
-qt6_add_resources(draganddrop_puzzle "puzzle" # special case
+qt_add_resources(draganddrop_puzzle "puzzle"
PREFIX
"/images"
FILES
${puzzle_resource_files}
)
-install(TARGETS draganddrop_puzzle # special case: renamed puzzle
+install(TARGETS draganddrop_puzzle
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
diff --git a/examples/widgets/draganddrop/puzzle/puzzlewidget.cpp b/examples/widgets/draganddrop/puzzle/puzzlewidget.cpp
index 06dda9c29f..361c7e937b 100644
--- a/examples/widgets/draganddrop/puzzle/puzzlewidget.cpp
+++ b/examples/widgets/draganddrop/puzzle/puzzlewidget.cpp
@@ -199,8 +199,8 @@ void PuzzleWidget::paintEvent(QPaintEvent *event)
const QRect PuzzleWidget::targetSquare(const QPoint &position) const
{
- return QRect(position / pieceSize() * pieceSize(),
- QSize(pieceSize(), pieceSize()));
+ QPoint topLeft = QPoint(position.x() / pieceSize(), position.y() / pieceSize()) * pieceSize();
+ return QRect(topLeft, QSize(pieceSize(), pieceSize()));
}
int PuzzleWidget::pieceSize() const
diff --git a/examples/widgets/effects/CMakeLists.txt b/examples/widgets/effects/CMakeLists.txt
index 1f62945f76..8b1471d1c2 100644
--- a/examples/widgets/effects/CMakeLists.txt
+++ b/examples/widgets/effects/CMakeLists.txt
@@ -1,4 +1,2 @@
-# Generated from effects.pro.
-
qt_internal_add_example(blurpicker)
qt_internal_add_example(fademessage)
diff --git a/examples/widgets/effects/blurpicker/CMakeLists.txt b/examples/widgets/effects/blurpicker/CMakeLists.txt
index b0e3a08016..52a87c77fa 100644
--- a/examples/widgets/effects/blurpicker/CMakeLists.txt
+++ b/examples/widgets/effects/blurpicker/CMakeLists.txt
@@ -1,40 +1,33 @@
-# Generated from blurpicker.pro.
-
cmake_minimum_required(VERSION 3.16)
project(blurpicker LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/effects/blurpicker")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(blurpicker
blureffect.cpp blureffect.h
blurpicker.cpp blurpicker.h
main.cpp
)
+
set_target_properties(blurpicker PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(blurpicker PUBLIC
Qt::Core
Qt::Gui
Qt::Widgets
)
-
# Resources:
set(blurpicker_resource_files
"images/accessories-calculator.png"
@@ -48,7 +41,7 @@ set(blurpicker_resource_files
"images/system-users.png"
)
-qt6_add_resources(blurpicker "blurpicker"
+qt_add_resources(blurpicker "blurpicker"
PREFIX
"/"
FILES
diff --git a/examples/widgets/effects/fademessage/CMakeLists.txt b/examples/widgets/effects/fademessage/CMakeLists.txt
index 96e8f08df4..5623c11936 100644
--- a/examples/widgets/effects/fademessage/CMakeLists.txt
+++ b/examples/widgets/effects/fademessage/CMakeLists.txt
@@ -1,45 +1,38 @@
-# Generated from fademessage.pro.
-
cmake_minimum_required(VERSION 3.16)
project(fademessage LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/effects/fademessage")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(fademessage
fademessage.cpp fademessage.h
main.cpp
)
+
set_target_properties(fademessage PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(fademessage PUBLIC
Qt::Core
Qt::Gui
Qt::Widgets
)
-
# Resources:
set(fademessage_resource_files
"background.jpg"
)
-qt6_add_resources(fademessage "fademessage"
+qt_add_resources(fademessage "fademessage"
PREFIX
"/"
FILES
diff --git a/examples/widgets/gallery/CMakeLists.txt b/examples/widgets/gallery/CMakeLists.txt
index dacc09fcb1..2994dee4cf 100644
--- a/examples/widgets/gallery/CMakeLists.txt
+++ b/examples/widgets/gallery/CMakeLists.txt
@@ -1,32 +1,26 @@
-# Generated from gallery.pro.
-
cmake_minimum_required(VERSION 3.16)
project(gallery LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/gallery")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(gallery
main.cpp
widgetgallery.cpp widgetgallery.h
)
+
set_target_properties(gallery PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(gallery PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/gestures/CMakeLists.txt b/examples/widgets/gestures/CMakeLists.txt
index 34fb6d0202..ccd2654936 100644
--- a/examples/widgets/gestures/CMakeLists.txt
+++ b/examples/widgets/gestures/CMakeLists.txt
@@ -1,5 +1,3 @@
-# Generated from gestures.pro.
-
if(NOT TARGET Qt::Widgets)
return()
endif()
diff --git a/examples/widgets/gestures/imagegestures/CMakeLists.txt b/examples/widgets/gestures/imagegestures/CMakeLists.txt
index 17b7a61103..7fc151838e 100644
--- a/examples/widgets/gestures/imagegestures/CMakeLists.txt
+++ b/examples/widgets/gestures/imagegestures/CMakeLists.txt
@@ -1,33 +1,27 @@
-# Generated from imagegestures.pro.
-
cmake_minimum_required(VERSION 3.16)
project(imagegestures LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/gestures/imagegestures")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(imagegestures
imagewidget.cpp imagewidget.h
main.cpp
mainwidget.cpp mainwidget.h
)
+
set_target_properties(imagegestures PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(imagegestures PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/graphicsview/CMakeLists.txt b/examples/widgets/graphicsview/CMakeLists.txt
index 961807eb55..86936a8321 100644
--- a/examples/widgets/graphicsview/CMakeLists.txt
+++ b/examples/widgets/graphicsview/CMakeLists.txt
@@ -1,5 +1,3 @@
-# Generated from graphicsview.pro.
-
qt_internal_add_example(chip)
qt_internal_add_example(elasticnodes)
qt_internal_add_example(embeddeddialogs)
diff --git a/examples/widgets/graphicsview/anchorlayout/CMakeLists.txt b/examples/widgets/graphicsview/anchorlayout/CMakeLists.txt
index 9b6db3a2f0..26deabe7b3 100644
--- a/examples/widgets/graphicsview/anchorlayout/CMakeLists.txt
+++ b/examples/widgets/graphicsview/anchorlayout/CMakeLists.txt
@@ -1,31 +1,25 @@
-# Generated from anchorlayout.pro.
-
cmake_minimum_required(VERSION 3.16)
project(anchorlayout LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/graphicsview/anchorlayout")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(anchorlayout
main.cpp
)
+
set_target_properties(anchorlayout PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(anchorlayout PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/graphicsview/basicgraphicslayouts/CMakeLists.txt b/examples/widgets/graphicsview/basicgraphicslayouts/CMakeLists.txt
index f98e5c78b3..16bf5d02b2 100644
--- a/examples/widgets/graphicsview/basicgraphicslayouts/CMakeLists.txt
+++ b/examples/widgets/graphicsview/basicgraphicslayouts/CMakeLists.txt
@@ -1,46 +1,39 @@
-# Generated from basicgraphicslayouts.pro.
-
cmake_minimum_required(VERSION 3.16)
project(basicgraphicslayouts LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/graphicsview/basicgraphicslayouts")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(basicgraphicslayouts
layoutitem.cpp layoutitem.h
main.cpp
window.cpp window.h
)
+
set_target_properties(basicgraphicslayouts PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(basicgraphicslayouts PUBLIC
Qt::Core
Qt::Gui
Qt::Widgets
)
-
# Resources:
set(basicgraphicslayouts_resource_files
"images/block.png"
)
-qt6_add_resources(basicgraphicslayouts "basicgraphicslayouts"
+qt_add_resources(basicgraphicslayouts "basicgraphicslayouts"
PREFIX
"/"
FILES
diff --git a/examples/widgets/graphicsview/chip/.prev_CMakeLists.txt b/examples/widgets/graphicsview/chip/.prev_CMakeLists.txt
deleted file mode 100644
index 1140aeb969..0000000000
--- a/examples/widgets/graphicsview/chip/.prev_CMakeLists.txt
+++ /dev/null
@@ -1,66 +0,0 @@
-# Generated from chip.pro.
-
-cmake_minimum_required(VERSION 3.14)
-project(chip LANGUAGES CXX)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
-
-if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
-endif()
-
-set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/graphicsview/chip")
-
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
-
-qt_add_executable(chip
- chip.cpp chip.h
- main.cpp
- mainwindow.cpp mainwindow.h
- view.cpp view.h
-)
-set_target_properties(chip PROPERTIES
- WIN32_EXECUTABLE TRUE
- MACOSX_BUNDLE TRUE
-)
-target_link_libraries(chip PUBLIC
- Qt::Core
- Qt::Gui
- Qt::Widgets
-)
-
-
-# Resources:
-set(images_resource_files
- "fileprint.png"
- "qt4logo.png"
- "rotateleft.png"
- "rotateright.png"
- "zoomin.png"
- "zoomout.png"
-)
-
-qt6_add_resources(chip "images"
- PREFIX
- "/"
- FILES
- ${images_resource_files}
-)
-
-if(TARGET Qt::PrintSupport)
- target_link_libraries(chip PUBLIC
- Qt::PrintSupport
- )
-endif()
-
-install(TARGETS chip
- RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
- BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
- LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
-)
diff --git a/examples/widgets/graphicsview/chip/CMakeLists.txt b/examples/widgets/graphicsview/chip/CMakeLists.txt
index 6b8160e2a8..5897a8c6d0 100644
--- a/examples/widgets/graphicsview/chip/CMakeLists.txt
+++ b/examples/widgets/graphicsview/chip/CMakeLists.txt
@@ -1,25 +1,18 @@
-# Generated from chip.pro.
-
cmake_minimum_required(VERSION 3.16)
project(chip LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/graphicsview/chip")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
-find_package(Qt6 COMPONENTS OpenGL) # special case
-find_package(Qt6 COMPONENTS PrintSupport) # special case
+find_package(Qt6
+ REQUIRED COMPONENTS Core Gui OpenGL Widgets
+ OPTIONAL_COMPONENTS PrintSupport
+)
qt_add_executable(chip
chip.cpp chip.h
@@ -27,17 +20,18 @@ qt_add_executable(chip
mainwindow.cpp mainwindow.h
view.cpp view.h
)
+
set_target_properties(chip PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(chip PUBLIC
Qt::Core
Qt::Gui
Qt::Widgets
)
-
# Resources:
set(images_resource_files
"fileprint.png"
@@ -48,7 +42,7 @@ set(images_resource_files
"zoomout.png"
)
-qt6_add_resources(chip "images"
+qt_add_resources(chip "images"
PREFIX
"/"
FILES
diff --git a/examples/widgets/graphicsview/collidingmice/CMakeLists.txt b/examples/widgets/graphicsview/collidingmice/CMakeLists.txt
index 143c45a7d6..6804880bfa 100644
--- a/examples/widgets/graphicsview/collidingmice/CMakeLists.txt
+++ b/examples/widgets/graphicsview/collidingmice/CMakeLists.txt
@@ -1,45 +1,38 @@
-# Generated from collidingmice.pro.
-
cmake_minimum_required(VERSION 3.16)
project(collidingmice LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/graphicsview/collidingmice")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(collidingmice
main.cpp
mouse.cpp mouse.h
)
+
set_target_properties(collidingmice PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(collidingmice PUBLIC
Qt::Core
Qt::Gui
Qt::Widgets
)
-
# Resources:
set(mice_resource_files
"images/cheese.jpg"
)
-qt6_add_resources(collidingmice "mice"
+qt_add_resources(collidingmice "mice"
PREFIX
"/"
FILES
diff --git a/examples/widgets/graphicsview/diagramscene/CMakeLists.txt b/examples/widgets/graphicsview/diagramscene/CMakeLists.txt
index 2d2ad96576..a473b29304 100644
--- a/examples/widgets/graphicsview/diagramscene/CMakeLists.txt
+++ b/examples/widgets/graphicsview/diagramscene/CMakeLists.txt
@@ -1,23 +1,15 @@
-# Generated from diagramscene.pro.
-
cmake_minimum_required(VERSION 3.16)
project(diagramscene LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/graphicsview/diagramscene")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(diagramscene
arrow.cpp arrow.h
@@ -27,17 +19,18 @@ qt_add_executable(diagramscene
main.cpp
mainwindow.cpp mainwindow.h
)
+
set_target_properties(diagramscene PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(diagramscene PUBLIC
Qt::Core
Qt::Gui
Qt::Widgets
)
-
# Resources:
set(diagramscene_resource_files
"images/background1.png"
@@ -57,7 +50,7 @@ set(diagramscene_resource_files
"images/underline.png"
)
-qt6_add_resources(diagramscene "diagramscene"
+qt_add_resources(diagramscene "diagramscene"
PREFIX
"/"
FILES
diff --git a/examples/widgets/graphicsview/dragdroprobot/CMakeLists.txt b/examples/widgets/graphicsview/dragdroprobot/CMakeLists.txt
index 584adb2160..7f9d4a3be0 100644
--- a/examples/widgets/graphicsview/dragdroprobot/CMakeLists.txt
+++ b/examples/widgets/graphicsview/dragdroprobot/CMakeLists.txt
@@ -1,46 +1,39 @@
-# Generated from dragdroprobot.pro.
-
cmake_minimum_required(VERSION 3.16)
project(dragdroprobot LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/graphicsview/dragdroprobot")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(dragdroprobot
coloritem.cpp coloritem.h
main.cpp
robot.cpp robot.h
)
+
set_target_properties(dragdroprobot PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(dragdroprobot PUBLIC
Qt::Core
Qt::Gui
Qt::Widgets
)
-
# Resources:
set(robot_resource_files
"images/head.png"
)
-qt6_add_resources(dragdroprobot "robot"
+qt_add_resources(dragdroprobot "robot"
PREFIX
"/"
FILES
diff --git a/examples/widgets/graphicsview/elasticnodes/CMakeLists.txt b/examples/widgets/graphicsview/elasticnodes/CMakeLists.txt
index f14cf835e6..b10f11a45c 100644
--- a/examples/widgets/graphicsview/elasticnodes/CMakeLists.txt
+++ b/examples/widgets/graphicsview/elasticnodes/CMakeLists.txt
@@ -1,23 +1,15 @@
-# Generated from elasticnodes.pro.
-
cmake_minimum_required(VERSION 3.16)
project(elasticnodes LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/graphicsview/elasticnodes")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(elasticnodes
edge.cpp edge.h
@@ -25,10 +17,12 @@ qt_add_executable(elasticnodes
main.cpp
node.cpp node.h
)
+
set_target_properties(elasticnodes PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(elasticnodes PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/graphicsview/embeddeddialogs/CMakeLists.txt b/examples/widgets/graphicsview/embeddeddialogs/CMakeLists.txt
index b63e15d785..d9684236ab 100644
--- a/examples/widgets/graphicsview/embeddeddialogs/CMakeLists.txt
+++ b/examples/widgets/graphicsview/embeddeddialogs/CMakeLists.txt
@@ -1,46 +1,40 @@
-# Generated from embeddeddialogs.pro.
-
cmake_minimum_required(VERSION 3.16)
project(embeddeddialogs LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/graphicsview/embeddeddialogs")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(embeddeddialogs
customproxy.cpp customproxy.h
embeddeddialog.cpp embeddeddialog.h embeddeddialog.ui
main.cpp
)
+
set_target_properties(embeddeddialogs PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(embeddeddialogs PUBLIC
Qt::Core
Qt::Gui
Qt::Widgets
)
-
# Resources:
set(embeddeddialogs_resource_files
"No-Ones-Laughing-3.jpg"
)
-qt6_add_resources(embeddeddialogs "embeddeddialogs"
+qt_add_resources(embeddeddialogs "embeddeddialogs"
PREFIX
"/"
FILES
diff --git a/examples/widgets/graphicsview/flowlayout/.prev_CMakeLists.txt b/examples/widgets/graphicsview/flowlayout/.prev_CMakeLists.txt
deleted file mode 100644
index 4208ba303e..0000000000
--- a/examples/widgets/graphicsview/flowlayout/.prev_CMakeLists.txt
+++ /dev/null
@@ -1,41 +0,0 @@
-# Generated from flowlayout.pro.
-
-cmake_minimum_required(VERSION 3.14)
-project(flowlayout LANGUAGES CXX)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
-
-if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
-endif()
-
-set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/graphicsview/flowlayout")
-
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
-
-qt_add_executable(flowlayout
- flowlayout.cpp flowlayout.h
- main.cpp
- window.cpp window.h
-)
-set_target_properties(flowlayout PROPERTIES
- WIN32_EXECUTABLE TRUE
- MACOSX_BUNDLE TRUE
-)
-target_link_libraries(flowlayout PUBLIC
- Qt::Core
- Qt::Gui
- Qt::Widgets
-)
-
-install(TARGETS flowlayout
- RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
- BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
- LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
-)
diff --git a/examples/widgets/graphicsview/flowlayout/CMakeLists.txt b/examples/widgets/graphicsview/flowlayout/CMakeLists.txt
index 9c44ec575d..4c1edc0060 100644
--- a/examples/widgets/graphicsview/flowlayout/CMakeLists.txt
+++ b/examples/widgets/graphicsview/flowlayout/CMakeLists.txt
@@ -1,40 +1,34 @@
-# Generated from flowlayout.pro.
-
cmake_minimum_required(VERSION 3.16)
project(flowlayout LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
-set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/graphicsview_flowlayout") # special case
+set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/graphicsview_flowlayout")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
-qt_add_executable(graphicsview_flowlayout # special case: renamed flowlayout
+qt_add_executable(graphicsview_flowlayout
flowlayout.cpp flowlayout.h
main.cpp
window.cpp window.h
)
-set_target_properties(graphicsview_flowlayout PROPERTIES # special case
+
+set_target_properties(graphicsview_flowlayout PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
-target_link_libraries(graphicsview_flowlayout PUBLIC # special case
+
+target_link_libraries(graphicsview_flowlayout PUBLIC
Qt::Core
Qt::Gui
Qt::Widgets
)
-install(TARGETS graphicsview_flowlayout # special case: renamed flowlayout
+install(TARGETS graphicsview_flowlayout
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
diff --git a/examples/widgets/graphicsview/simpleanchorlayout/CMakeLists.txt b/examples/widgets/graphicsview/simpleanchorlayout/CMakeLists.txt
index e4118c0d87..12005229c8 100644
--- a/examples/widgets/graphicsview/simpleanchorlayout/CMakeLists.txt
+++ b/examples/widgets/graphicsview/simpleanchorlayout/CMakeLists.txt
@@ -1,31 +1,25 @@
-# Generated from simpleanchorlayout.pro.
-
cmake_minimum_required(VERSION 3.16)
project(simpleanchorlayout LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/graphicsview/simpleanchorlayout")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(simpleanchorlayout
main.cpp
)
+
set_target_properties(simpleanchorlayout PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(simpleanchorlayout PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/graphicsview/weatheranchorlayout/CMakeLists.txt b/examples/widgets/graphicsview/weatheranchorlayout/CMakeLists.txt
index 2aa69e59a0..629e551281 100644
--- a/examples/widgets/graphicsview/weatheranchorlayout/CMakeLists.txt
+++ b/examples/widgets/graphicsview/weatheranchorlayout/CMakeLists.txt
@@ -1,38 +1,31 @@
-# Generated from weatheranchorlayout.pro.
-
cmake_minimum_required(VERSION 3.16)
project(weatheranchorlayout LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/graphicsview/weatheranchorlayout")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(weatheranchorlayout
main.cpp
)
+
set_target_properties(weatheranchorlayout PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(weatheranchorlayout PUBLIC
Qt::Core
Qt::Gui
Qt::Widgets
)
-
# Resources:
set(weatheranchorlayout_resource_files
"images/5days.jpg"
@@ -43,7 +36,7 @@ set(weatheranchorlayout_resource_files
"images/weather-few-clouds.png"
)
-qt6_add_resources(weatheranchorlayout "weatheranchorlayout"
+qt_add_resources(weatheranchorlayout "weatheranchorlayout"
PREFIX
"/"
FILES
diff --git a/examples/widgets/itemviews/.prev_CMakeLists.txt b/examples/widgets/itemviews/.prev_CMakeLists.txt
deleted file mode 100644
index 96f03a2e61..0000000000
--- a/examples/widgets/itemviews/.prev_CMakeLists.txt
+++ /dev/null
@@ -1,27 +0,0 @@
-# Generated from itemviews.pro.
-
-add_subdirectory(addressbook)
-add_subdirectory(basicsortfiltermodel)
-add_subdirectory(chart)
-add_subdirectory(coloreditorfactory)
-add_subdirectory(combowidgetmapper)
-add_subdirectory(customsortfiltermodel)
-add_subdirectory(dirview)
-add_subdirectory(editabletreemodel)
-add_subdirectory(fetchmore)
-add_subdirectory(flattreeview)
-add_subdirectory(frozencolumn)
-add_subdirectory(interview)
-add_subdirectory(pixelator)
-add_subdirectory(simpletreemodel)
-add_subdirectory(simplewidgetmapper)
-add_subdirectory(spinboxdelegate)
-add_subdirectory(spreadsheet)
-add_subdirectory(stardelegate)
-add_subdirectory(storageview)
-if(QT_FEATURE_draganddrop)
- add_subdirectory(puzzle)
-endif()
-if(TARGET Qt::Xml)
- add_subdirectory(simpledommodel)
-endif()
diff --git a/examples/widgets/itemviews/CMakeLists.txt b/examples/widgets/itemviews/CMakeLists.txt
index 10d77c43c8..df7e8cefec 100644
--- a/examples/widgets/itemviews/CMakeLists.txt
+++ b/examples/widgets/itemviews/CMakeLists.txt
@@ -1,5 +1,3 @@
-# Generated from itemviews.pro.
-
qt_internal_add_example(addressbook)
qt_internal_add_example(basicsortfiltermodel)
qt_internal_add_example(chart)
diff --git a/examples/widgets/itemviews/addressbook/CMakeLists.txt b/examples/widgets/itemviews/addressbook/CMakeLists.txt
index 6127008fdc..1c440451e7 100644
--- a/examples/widgets/itemviews/addressbook/CMakeLists.txt
+++ b/examples/widgets/itemviews/addressbook/CMakeLists.txt
@@ -1,23 +1,15 @@
-# Generated from addressbook.pro.
-
cmake_minimum_required(VERSION 3.16)
project(addressbook LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/itemviews/addressbook")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(addressbook
adddialog.cpp adddialog.h
@@ -27,10 +19,12 @@ qt_add_executable(addressbook
newaddresstab.cpp newaddresstab.h
tablemodel.cpp tablemodel.h
)
+
set_target_properties(addressbook PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(addressbook PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/itemviews/basicsortfiltermodel/CMakeLists.txt b/examples/widgets/itemviews/basicsortfiltermodel/CMakeLists.txt
index 3bc56f1c5b..555d16f0f1 100644
--- a/examples/widgets/itemviews/basicsortfiltermodel/CMakeLists.txt
+++ b/examples/widgets/itemviews/basicsortfiltermodel/CMakeLists.txt
@@ -1,32 +1,26 @@
-# Generated from basicsortfiltermodel.pro.
-
cmake_minimum_required(VERSION 3.16)
project(basicsortfiltermodel LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/itemviews/basicsortfiltermodel")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(basicsortfiltermodel
main.cpp
window.cpp window.h
)
+
set_target_properties(basicsortfiltermodel PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(basicsortfiltermodel PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/itemviews/chart/CMakeLists.txt b/examples/widgets/itemviews/chart/CMakeLists.txt
index 82771605d2..43111a414a 100644
--- a/examples/widgets/itemviews/chart/CMakeLists.txt
+++ b/examples/widgets/itemviews/chart/CMakeLists.txt
@@ -1,46 +1,39 @@
-# Generated from chart.pro.
-
cmake_minimum_required(VERSION 3.16)
project(chart LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/itemviews/chart")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(chart
main.cpp
mainwindow.cpp mainwindow.h
pieview.cpp pieview.h
)
+
set_target_properties(chart PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(chart PUBLIC
Qt::Core
Qt::Gui
Qt::Widgets
)
-
# Resources:
set(chart_resource_files
"qtdata.cht"
)
-qt6_add_resources(chart "chart"
+qt_add_resources(chart "chart"
PREFIX
"/Charts"
FILES
diff --git a/examples/widgets/itemviews/coloreditorfactory/CMakeLists.txt b/examples/widgets/itemviews/coloreditorfactory/CMakeLists.txt
index 3887a4b162..74055bcdf2 100644
--- a/examples/widgets/itemviews/coloreditorfactory/CMakeLists.txt
+++ b/examples/widgets/itemviews/coloreditorfactory/CMakeLists.txt
@@ -1,33 +1,27 @@
-# Generated from coloreditorfactory.pro.
-
cmake_minimum_required(VERSION 3.16)
project(coloreditorfactory LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/itemviews/coloreditorfactory")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(coloreditorfactory
colorlisteditor.cpp colorlisteditor.h
main.cpp
window.cpp window.h
)
+
set_target_properties(coloreditorfactory PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(coloreditorfactory PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/itemviews/combowidgetmapper/CMakeLists.txt b/examples/widgets/itemviews/combowidgetmapper/CMakeLists.txt
index 07df054d50..b31c2b62ea 100644
--- a/examples/widgets/itemviews/combowidgetmapper/CMakeLists.txt
+++ b/examples/widgets/itemviews/combowidgetmapper/CMakeLists.txt
@@ -1,32 +1,26 @@
-# Generated from combowidgetmapper.pro.
-
cmake_minimum_required(VERSION 3.16)
project(combowidgetmapper LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/itemviews/combowidgetmapper")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(combowidgetmapper
main.cpp
window.cpp window.h
)
+
set_target_properties(combowidgetmapper PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(combowidgetmapper PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/itemviews/customsortfiltermodel/CMakeLists.txt b/examples/widgets/itemviews/customsortfiltermodel/CMakeLists.txt
index 3da9b7d327..973c1a41bf 100644
--- a/examples/widgets/itemviews/customsortfiltermodel/CMakeLists.txt
+++ b/examples/widgets/itemviews/customsortfiltermodel/CMakeLists.txt
@@ -1,23 +1,15 @@
-# Generated from customsortfiltermodel.pro.
-
cmake_minimum_required(VERSION 3.16)
project(customsortfiltermodel LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/itemviews/customsortfiltermodel")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(customsortfiltermodel
filterwidget.cpp filterwidget.h
@@ -25,23 +17,24 @@ qt_add_executable(customsortfiltermodel
mysortfilterproxymodel.cpp mysortfilterproxymodel.h
window.cpp window.h
)
+
set_target_properties(customsortfiltermodel PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(customsortfiltermodel PUBLIC
Qt::Core
Qt::Gui
Qt::Widgets
)
-
# Resources:
set(customsortfiltermodel_resource_files
"images/find.png"
)
-qt6_add_resources(customsortfiltermodel "customsortfiltermodel"
+qt_add_resources(customsortfiltermodel "customsortfiltermodel"
PREFIX
"/"
FILES
diff --git a/examples/widgets/itemviews/dirview/CMakeLists.txt b/examples/widgets/itemviews/dirview/CMakeLists.txt
index 86d87c2ae1..701922a813 100644
--- a/examples/widgets/itemviews/dirview/CMakeLists.txt
+++ b/examples/widgets/itemviews/dirview/CMakeLists.txt
@@ -1,31 +1,25 @@
-# Generated from dirview.pro.
-
cmake_minimum_required(VERSION 3.16)
project(dirview LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/itemviews/dirview")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(dirview
main.cpp
)
+
set_target_properties(dirview PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(dirview PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/itemviews/editabletreemodel/CMakeLists.txt b/examples/widgets/itemviews/editabletreemodel/CMakeLists.txt
index 4302519b55..e796bf8bca 100644
--- a/examples/widgets/itemviews/editabletreemodel/CMakeLists.txt
+++ b/examples/widgets/itemviews/editabletreemodel/CMakeLists.txt
@@ -1,23 +1,16 @@
-# Generated from editabletreemodel.pro.
-
cmake_minimum_required(VERSION 3.16)
project(editabletreemodel LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/itemviews/editabletreemodel")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(editabletreemodel
main.cpp
@@ -25,23 +18,24 @@ qt_add_executable(editabletreemodel
treeitem.cpp treeitem.h
treemodel.cpp treemodel.h
)
+
set_target_properties(editabletreemodel PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(editabletreemodel PUBLIC
Qt::Core
Qt::Gui
Qt::Widgets
)
-
# Resources:
set(editabletreemodel_resource_files
"default.txt"
)
-qt6_add_resources(editabletreemodel "editabletreemodel"
+qt_add_resources(editabletreemodel "editabletreemodel"
PREFIX
"/"
FILES
diff --git a/examples/widgets/itemviews/fetchmore/CMakeLists.txt b/examples/widgets/itemviews/fetchmore/CMakeLists.txt
index ffc45b8339..9d1b3b99c9 100644
--- a/examples/widgets/itemviews/fetchmore/CMakeLists.txt
+++ b/examples/widgets/itemviews/fetchmore/CMakeLists.txt
@@ -1,33 +1,27 @@
-# Generated from fetchmore.pro.
-
cmake_minimum_required(VERSION 3.16)
project(fetchmore LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/itemviews/fetchmore")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(fetchmore
filelistmodel.cpp filelistmodel.h
main.cpp
window.cpp window.h
)
+
set_target_properties(fetchmore PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(fetchmore PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/itemviews/flattreeview/CMakeLists.txt b/examples/widgets/itemviews/flattreeview/CMakeLists.txt
index 3464f82c24..c379646a8f 100644
--- a/examples/widgets/itemviews/flattreeview/CMakeLists.txt
+++ b/examples/widgets/itemviews/flattreeview/CMakeLists.txt
@@ -1,31 +1,25 @@
-# Generated from flattreeview.pro.
-
cmake_minimum_required(VERSION 3.16)
project(flattreeview LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/itemviews/flattreeview")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(flattreeview
main.cpp
)
+
set_target_properties(flattreeview PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(flattreeview PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/itemviews/frozencolumn/CMakeLists.txt b/examples/widgets/itemviews/frozencolumn/CMakeLists.txt
index 1bd4df20a5..c45fb725cf 100644
--- a/examples/widgets/itemviews/frozencolumn/CMakeLists.txt
+++ b/examples/widgets/itemviews/frozencolumn/CMakeLists.txt
@@ -1,45 +1,38 @@
-# Generated from frozencolumn.pro.
-
cmake_minimum_required(VERSION 3.16)
project(frozencolumn LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/itemviews/frozencolumn")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(frozencolumn
freezetablewidget.cpp freezetablewidget.h
main.cpp
)
+
set_target_properties(frozencolumn PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(frozencolumn PUBLIC
Qt::Core
Qt::Gui
Qt::Widgets
)
-
# Resources:
set(grades_resource_files
"grades.txt"
)
-qt6_add_resources(frozencolumn "grades"
+qt_add_resources(frozencolumn "grades"
PREFIX
"/"
FILES
diff --git a/examples/widgets/itemviews/interview/CMakeLists.txt b/examples/widgets/itemviews/interview/CMakeLists.txt
index cf5c9abe7d..610db3972d 100644
--- a/examples/widgets/itemviews/interview/CMakeLists.txt
+++ b/examples/widgets/itemviews/interview/CMakeLists.txt
@@ -1,39 +1,32 @@
-# Generated from interview.pro.
-
cmake_minimum_required(VERSION 3.16)
project(interview LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/itemviews/interview")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(interview
main.cpp
model.cpp model.h
)
+
set_target_properties(interview PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(interview PUBLIC
Qt::Core
Qt::Gui
Qt::Widgets
)
-
# Resources:
set(interview_resource_files
"images/folder.png"
@@ -41,7 +34,7 @@ set(interview_resource_files
"images/services.png"
)
-qt6_add_resources(interview "interview"
+qt_add_resources(interview "interview"
PREFIX
"/"
FILES
diff --git a/examples/widgets/itemviews/pixelator/.prev_CMakeLists.txt b/examples/widgets/itemviews/pixelator/.prev_CMakeLists.txt
deleted file mode 100644
index 2beeba0939..0000000000
--- a/examples/widgets/itemviews/pixelator/.prev_CMakeLists.txt
+++ /dev/null
@@ -1,61 +0,0 @@
-# Generated from pixelator.pro.
-
-cmake_minimum_required(VERSION 3.14)
-project(pixelator LANGUAGES CXX)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
-
-if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
-endif()
-
-set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/itemviews/pixelator")
-
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
-
-qt_add_executable(pixelator
- imagemodel.cpp imagemodel.h
- main.cpp
- mainwindow.cpp mainwindow.h
- pixeldelegate.cpp pixeldelegate.h
-)
-set_target_properties(pixelator PROPERTIES
- WIN32_EXECUTABLE TRUE
- MACOSX_BUNDLE TRUE
-)
-target_link_libraries(pixelator PUBLIC
- Qt::Core
- Qt::Gui
- Qt::Widgets
-)
-
-
-# Resources:
-set(images_resource_files
- "images/qt.png"
-)
-
-qt6_add_resources(pixelator "images"
- PREFIX
- "/"
- FILES
- ${images_resource_files}
-)
-
-if(TARGET Qt::PrintSupport)
- target_link_libraries(pixelator PUBLIC
- Qt::PrintSupport
- )
-endif()
-
-install(TARGETS pixelator
- RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
- BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
- LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
-)
diff --git a/examples/widgets/itemviews/pixelator/CMakeLists.txt b/examples/widgets/itemviews/pixelator/CMakeLists.txt
index 1960b7089e..463d859595 100644
--- a/examples/widgets/itemviews/pixelator/CMakeLists.txt
+++ b/examples/widgets/itemviews/pixelator/CMakeLists.txt
@@ -1,24 +1,18 @@
-# Generated from pixelator.pro.
-
cmake_minimum_required(VERSION 3.16)
project(pixelator LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/itemviews/pixelator")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
-find_package(Qt6 COMPONENTS PrintSupport) # special case
+find_package(Qt6
+ REQUIRED COMPONENTS Core Gui Widgets
+ OPTIONAL_COMPONENTS PrintSupport
+)
qt_add_executable(pixelator
imagemodel.cpp imagemodel.h
@@ -26,23 +20,24 @@ qt_add_executable(pixelator
mainwindow.cpp mainwindow.h
pixeldelegate.cpp pixeldelegate.h
)
+
set_target_properties(pixelator PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(pixelator PUBLIC
Qt::Core
Qt::Gui
Qt::Widgets
)
-
# Resources:
set(images_resource_files
"images/qt.png"
)
-qt6_add_resources(pixelator "images"
+qt_add_resources(pixelator "images"
PREFIX
"/"
FILES
diff --git a/examples/widgets/itemviews/puzzle/.prev_CMakeLists.txt b/examples/widgets/itemviews/puzzle/.prev_CMakeLists.txt
deleted file mode 100644
index b80cb9c29b..0000000000
--- a/examples/widgets/itemviews/puzzle/.prev_CMakeLists.txt
+++ /dev/null
@@ -1,55 +0,0 @@
-# Generated from puzzle.pro.
-
-cmake_minimum_required(VERSION 3.14)
-project(puzzle LANGUAGES CXX)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
-
-if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
-endif()
-
-set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/itemviews/puzzle")
-
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
-
-qt_add_executable(puzzle
- main.cpp
- mainwindow.cpp mainwindow.h
- piecesmodel.cpp piecesmodel.h
- puzzlewidget.cpp puzzlewidget.h
-)
-set_target_properties(puzzle PROPERTIES
- WIN32_EXECUTABLE TRUE
- MACOSX_BUNDLE TRUE
-)
-target_link_libraries(puzzle PUBLIC
- Qt::Core
- Qt::Gui
- Qt::Widgets
-)
-
-
-# Resources:
-set(puzzle_resource_files
- "example.jpg"
-)
-
-qt6_add_resources(puzzle "puzzle"
- PREFIX
- "/images"
- FILES
- ${puzzle_resource_files}
-)
-
-install(TARGETS puzzle
- RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
- BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
- LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
-)
diff --git a/examples/widgets/itemviews/puzzle/CMakeLists.txt b/examples/widgets/itemviews/puzzle/CMakeLists.txt
index 70a3dbab47..77624cc623 100644
--- a/examples/widgets/itemviews/puzzle/CMakeLists.txt
+++ b/examples/widgets/itemviews/puzzle/CMakeLists.txt
@@ -1,54 +1,47 @@
-# Generated from puzzle.pro.
-
cmake_minimum_required(VERSION 3.16)
project(puzzle LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/itemviews/puzzle")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
-qt_add_executable(itemviews_puzzle # special case: renamed puzzle
+qt_add_executable(itemviews_puzzle
main.cpp
mainwindow.cpp mainwindow.h
piecesmodel.cpp piecesmodel.h
puzzlewidget.cpp puzzlewidget.h
)
-set_target_properties(itemviews_puzzle PROPERTIES # special case
+
+set_target_properties(itemviews_puzzle PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
-target_link_libraries(itemviews_puzzle PUBLIC # special case
+
+target_link_libraries(itemviews_puzzle PUBLIC
Qt::Core
Qt::Gui
Qt::Widgets
)
-
# Resources:
set(puzzle_resource_files
"example.jpg"
)
-qt6_add_resources(itemviews_puzzle "puzzle"
+qt_add_resources(itemviews_puzzle "puzzle"
PREFIX
"/images"
FILES
${puzzle_resource_files}
)
-install(TARGETS itemviews_puzzle # special case: renamed puzzle
+install(TARGETS itemviews_puzzle
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
diff --git a/examples/widgets/itemviews/puzzle/puzzlewidget.cpp b/examples/widgets/itemviews/puzzle/puzzlewidget.cpp
index 2c60d28946..e5e0192c96 100644
--- a/examples/widgets/itemviews/puzzle/puzzlewidget.cpp
+++ b/examples/widgets/itemviews/puzzle/puzzlewidget.cpp
@@ -195,8 +195,8 @@ void PuzzleWidget::paintEvent(QPaintEvent *event)
const QRect PuzzleWidget::targetSquare(const QPoint &position) const
{
- return QRect(position / pieceSize() * pieceSize(),
- QSize(pieceSize(), pieceSize()));
+ QPoint topLeft = QPoint(position.x() / pieceSize(), position.y() / pieceSize()) * pieceSize();
+ return QRect(topLeft, QSize(pieceSize(), pieceSize()));
}
int PuzzleWidget::pieceSize() const
diff --git a/examples/widgets/itemviews/simpledommodel/CMakeLists.txt b/examples/widgets/itemviews/simpledommodel/CMakeLists.txt
index 70c6fe2e4b..d6ad561216 100644
--- a/examples/widgets/itemviews/simpledommodel/CMakeLists.txt
+++ b/examples/widgets/itemviews/simpledommodel/CMakeLists.txt
@@ -1,24 +1,15 @@
-# Generated from simpledommodel.pro.
-
cmake_minimum_required(VERSION 3.16)
project(simpledommodel LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/itemviews/simpledommodel")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Xml)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets Xml)
qt_add_executable(simpledommodel
domitem.cpp domitem.h
@@ -26,10 +17,12 @@ qt_add_executable(simpledommodel
main.cpp
mainwindow.cpp mainwindow.h
)
+
set_target_properties(simpledommodel PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(simpledommodel PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/itemviews/simpletreemodel/CMakeLists.txt b/examples/widgets/itemviews/simpletreemodel/CMakeLists.txt
index 6c7bc4d097..462d843ee4 100644
--- a/examples/widgets/itemviews/simpletreemodel/CMakeLists.txt
+++ b/examples/widgets/itemviews/simpletreemodel/CMakeLists.txt
@@ -1,46 +1,39 @@
-# Generated from simpletreemodel.pro.
-
cmake_minimum_required(VERSION 3.16)
project(simpletreemodel LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/itemviews/simpletreemodel")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(simpletreemodel
main.cpp
treeitem.cpp treeitem.h
treemodel.cpp treemodel.h
)
+
set_target_properties(simpletreemodel PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(simpletreemodel PUBLIC
Qt::Core
Qt::Gui
Qt::Widgets
)
-
# Resources:
set(simpletreemodel_resource_files
"default.txt"
)
-qt6_add_resources(simpletreemodel "simpletreemodel"
+qt_add_resources(simpletreemodel "simpletreemodel"
PREFIX
"/"
FILES
diff --git a/examples/widgets/itemviews/simplewidgetmapper/CMakeLists.txt b/examples/widgets/itemviews/simplewidgetmapper/CMakeLists.txt
index 627ec07633..18d9a7ac29 100644
--- a/examples/widgets/itemviews/simplewidgetmapper/CMakeLists.txt
+++ b/examples/widgets/itemviews/simplewidgetmapper/CMakeLists.txt
@@ -1,32 +1,26 @@
-# Generated from simplewidgetmapper.pro.
-
cmake_minimum_required(VERSION 3.16)
project(simplewidgetmapper LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/itemviews/simplewidgetmapper")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(simplewidgetmapper
main.cpp
window.cpp window.h
)
+
set_target_properties(simplewidgetmapper PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(simplewidgetmapper PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/itemviews/spinboxdelegate/CMakeLists.txt b/examples/widgets/itemviews/spinboxdelegate/CMakeLists.txt
index 413bfa0945..67c58674c2 100644
--- a/examples/widgets/itemviews/spinboxdelegate/CMakeLists.txt
+++ b/examples/widgets/itemviews/spinboxdelegate/CMakeLists.txt
@@ -1,32 +1,26 @@
-# Generated from spinboxdelegate.pro.
-
cmake_minimum_required(VERSION 3.16)
project(spinboxdelegate LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/itemviews/spinboxdelegate")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(spinboxdelegate
delegate.cpp delegate.h
main.cpp
)
+
set_target_properties(spinboxdelegate PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(spinboxdelegate PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/itemviews/spreadsheet/.prev_CMakeLists.txt b/examples/widgets/itemviews/spreadsheet/.prev_CMakeLists.txt
deleted file mode 100644
index e14931e62f..0000000000
--- a/examples/widgets/itemviews/spreadsheet/.prev_CMakeLists.txt
+++ /dev/null
@@ -1,62 +0,0 @@
-# Generated from spreadsheet.pro.
-
-cmake_minimum_required(VERSION 3.14)
-project(spreadsheet LANGUAGES CXX)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
-
-if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
-endif()
-
-set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/itemviews/spreadsheet")
-
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
-
-qt_add_executable(spreadsheet
- main.cpp
- printview.cpp printview.h
- spreadsheet.cpp spreadsheet.h
- spreadsheetdelegate.cpp spreadsheetdelegate.h
- spreadsheetitem.cpp spreadsheetitem.h
-)
-set_target_properties(spreadsheet PROPERTIES
- WIN32_EXECUTABLE TRUE
- MACOSX_BUNDLE TRUE
-)
-target_link_libraries(spreadsheet PUBLIC
- Qt::Core
- Qt::Gui
- Qt::Widgets
-)
-
-
-# Resources:
-set(spreadsheet_resource_files
- "images/interview.png"
-)
-
-qt6_add_resources(spreadsheet "spreadsheet"
- PREFIX
- "/"
- FILES
- ${spreadsheet_resource_files}
-)
-
-if(TARGET Qt::PrintSupport)
- target_link_libraries(spreadsheet PUBLIC
- Qt::PrintSupport
- )
-endif()
-
-install(TARGETS spreadsheet
- RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
- BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
- LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
-)
diff --git a/examples/widgets/itemviews/spreadsheet/CMakeLists.txt b/examples/widgets/itemviews/spreadsheet/CMakeLists.txt
index 2f0aa028ea..031489185e 100644
--- a/examples/widgets/itemviews/spreadsheet/CMakeLists.txt
+++ b/examples/widgets/itemviews/spreadsheet/CMakeLists.txt
@@ -1,24 +1,18 @@
-# Generated from spreadsheet.pro.
-
cmake_minimum_required(VERSION 3.16)
project(spreadsheet LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/itemviews/spreadsheet")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
-find_package(Qt6 COMPONENTS PrintSupport) # special case
+find_package(Qt6
+ REQUIRED COMPONENTS Core Gui Widgets
+ OPTIONAL_COMPONENTS PrintSupport
+)
qt_add_executable(spreadsheet
main.cpp
@@ -27,28 +21,28 @@ qt_add_executable(spreadsheet
spreadsheetdelegate.cpp spreadsheetdelegate.h
spreadsheetitem.cpp spreadsheetitem.h
)
+
set_target_properties(spreadsheet PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(spreadsheet PUBLIC
Qt::Core
Qt::Gui
Qt::Widgets
)
-# special case begin
+
if (TARGET Qt::PrintSupport)
target_link_libraries(spreadsheet PUBLIC Qt::PrintSupport)
endif()
-# special case end
-
# Resources:
set(spreadsheet_resource_files
"images/interview.png"
)
-qt6_add_resources(spreadsheet "spreadsheet"
+qt_add_resources(spreadsheet "spreadsheet"
PREFIX
"/"
FILES
diff --git a/examples/widgets/itemviews/stardelegate/CMakeLists.txt b/examples/widgets/itemviews/stardelegate/CMakeLists.txt
index 7f89abe524..a9b7c58c4e 100644
--- a/examples/widgets/itemviews/stardelegate/CMakeLists.txt
+++ b/examples/widgets/itemviews/stardelegate/CMakeLists.txt
@@ -1,23 +1,15 @@
-# Generated from stardelegate.pro.
-
cmake_minimum_required(VERSION 3.16)
project(stardelegate LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/itemviews/stardelegate")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(stardelegate
main.cpp
@@ -25,10 +17,12 @@ qt_add_executable(stardelegate
stareditor.cpp stareditor.h
starrating.cpp starrating.h
)
+
set_target_properties(stardelegate PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(stardelegate PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/itemviews/storageview/CMakeLists.txt b/examples/widgets/itemviews/storageview/CMakeLists.txt
index 22f1724ed1..9f0e5eed3f 100644
--- a/examples/widgets/itemviews/storageview/CMakeLists.txt
+++ b/examples/widgets/itemviews/storageview/CMakeLists.txt
@@ -1,32 +1,26 @@
-# Generated from storageview.pro.
-
cmake_minimum_required(VERSION 3.16)
project(storageview LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/itemviews/storageview")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(storageview
main.cpp
storagemodel.cpp storagemodel.h
)
+
set_target_properties(storageview PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(storageview PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/layouts/CMakeLists.txt b/examples/widgets/layouts/CMakeLists.txt
index 656b602650..1950c7f641 100644
--- a/examples/widgets/layouts/CMakeLists.txt
+++ b/examples/widgets/layouts/CMakeLists.txt
@@ -1,5 +1,3 @@
-# Generated from layouts.pro.
-
qt_internal_add_example(basiclayouts)
qt_internal_add_example(borderlayout)
qt_internal_add_example(dynamiclayouts)
diff --git a/examples/widgets/layouts/basiclayouts/CMakeLists.txt b/examples/widgets/layouts/basiclayouts/CMakeLists.txt
index a3c99e2d4a..f755975a6e 100644
--- a/examples/widgets/layouts/basiclayouts/CMakeLists.txt
+++ b/examples/widgets/layouts/basiclayouts/CMakeLists.txt
@@ -1,32 +1,26 @@
-# Generated from basiclayouts.pro.
-
cmake_minimum_required(VERSION 3.16)
project(basiclayouts LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/layouts/basiclayouts")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(basiclayouts
dialog.cpp dialog.h
main.cpp
)
+
set_target_properties(basiclayouts PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(basiclayouts PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/layouts/borderlayout/CMakeLists.txt b/examples/widgets/layouts/borderlayout/CMakeLists.txt
index 92030252ba..ab7090a33c 100644
--- a/examples/widgets/layouts/borderlayout/CMakeLists.txt
+++ b/examples/widgets/layouts/borderlayout/CMakeLists.txt
@@ -1,33 +1,27 @@
-# Generated from borderlayout.pro.
-
cmake_minimum_required(VERSION 3.16)
project(borderlayout LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/layouts/borderlayout")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(borderlayout
borderlayout.cpp borderlayout.h
main.cpp
window.cpp window.h
)
+
set_target_properties(borderlayout PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(borderlayout PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/layouts/dynamiclayouts/CMakeLists.txt b/examples/widgets/layouts/dynamiclayouts/CMakeLists.txt
index e969f21cb0..946a82f6fa 100644
--- a/examples/widgets/layouts/dynamiclayouts/CMakeLists.txt
+++ b/examples/widgets/layouts/dynamiclayouts/CMakeLists.txt
@@ -1,32 +1,26 @@
-# Generated from dynamiclayouts.pro.
-
cmake_minimum_required(VERSION 3.16)
project(dynamiclayouts LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/layouts/dynamiclayouts")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(dynamiclayouts
dialog.cpp dialog.h
main.cpp
)
+
set_target_properties(dynamiclayouts PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(dynamiclayouts PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/layouts/flowlayout/CMakeLists.txt b/examples/widgets/layouts/flowlayout/CMakeLists.txt
index ef6d970ad9..fdaaec19ea 100644
--- a/examples/widgets/layouts/flowlayout/CMakeLists.txt
+++ b/examples/widgets/layouts/flowlayout/CMakeLists.txt
@@ -1,33 +1,27 @@
-# Generated from flowlayout.pro.
-
cmake_minimum_required(VERSION 3.16)
project(flowlayout LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/layouts/flowlayout")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(flowlayout
flowlayout.cpp flowlayout.h
main.cpp
window.cpp window.h
)
+
set_target_properties(flowlayout PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(flowlayout PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/mainwindows/CMakeLists.txt b/examples/widgets/mainwindows/CMakeLists.txt
index ba87029ef8..60dbc59310 100644
--- a/examples/widgets/mainwindows/CMakeLists.txt
+++ b/examples/widgets/mainwindows/CMakeLists.txt
@@ -1,5 +1,3 @@
-# Generated from mainwindows.pro.
-
qt_internal_add_example(application)
qt_internal_add_example(dockwidgets)
qt_internal_add_example(mainwindow)
diff --git a/examples/widgets/mainwindows/application/CMakeLists.txt b/examples/widgets/mainwindows/application/CMakeLists.txt
index 483edcda4a..6daecf9882 100644
--- a/examples/widgets/mainwindows/application/CMakeLists.txt
+++ b/examples/widgets/mainwindows/application/CMakeLists.txt
@@ -1,39 +1,32 @@
-# Generated from application.pro.
-
cmake_minimum_required(VERSION 3.16)
project(application LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/mainwindows/application")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(application
main.cpp
mainwindow.cpp mainwindow.h
)
+
set_target_properties(application PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(application PUBLIC
Qt::Core
Qt::Gui
Qt::Widgets
)
-
# Resources:
set(application_resource_files
"images/copy.png"
@@ -44,7 +37,7 @@ set(application_resource_files
"images/save.png"
)
-qt6_add_resources(application "application"
+qt_add_resources(application "application"
PREFIX
"/"
FILES
diff --git a/examples/widgets/mainwindows/dockwidgets/.prev_CMakeLists.txt b/examples/widgets/mainwindows/dockwidgets/.prev_CMakeLists.txt
deleted file mode 100644
index 2affbef3b9..0000000000
--- a/examples/widgets/mainwindows/dockwidgets/.prev_CMakeLists.txt
+++ /dev/null
@@ -1,62 +0,0 @@
-# Generated from dockwidgets.pro.
-
-cmake_minimum_required(VERSION 3.14)
-project(dockwidgets LANGUAGES CXX)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
-
-if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
-endif()
-
-set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/mainwindows/dockwidgets")
-
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
-
-qt_add_executable(dockwidgets
- main.cpp
- mainwindow.cpp mainwindow.h
-)
-set_target_properties(dockwidgets PROPERTIES
- WIN32_EXECUTABLE TRUE
- MACOSX_BUNDLE TRUE
-)
-target_link_libraries(dockwidgets PUBLIC
- Qt::Core
- Qt::Gui
- Qt::Widgets
-)
-
-
-# Resources:
-set(dockwidgets_resource_files
- "images/new.png"
- "images/print.png"
- "images/save.png"
- "images/undo.png"
-)
-
-qt6_add_resources(dockwidgets "dockwidgets"
- PREFIX
- "/"
- FILES
- ${dockwidgets_resource_files}
-)
-
-if(TARGET Qt::PrintSupport)
- target_link_libraries(dockwidgets PUBLIC
- Qt::PrintSupport
- )
-endif()
-
-install(TARGETS dockwidgets
- RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
- BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
- LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
-)
diff --git a/examples/widgets/mainwindows/dockwidgets/CMakeLists.txt b/examples/widgets/mainwindows/dockwidgets/CMakeLists.txt
index faf964f2d3..cf1d71ae52 100644
--- a/examples/widgets/mainwindows/dockwidgets/CMakeLists.txt
+++ b/examples/widgets/mainwindows/dockwidgets/CMakeLists.txt
@@ -1,44 +1,38 @@
-# Generated from dockwidgets.pro.
-
cmake_minimum_required(VERSION 3.16)
project(dockwidgets LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/mainwindows/dockwidgets")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
-find_package(Qt6 COMPONENTS PrintSupport) # special case
+find_package(Qt6
+ REQUIRED COMPONENTS Core Gui Widgets
+ OPTIONAL_COMPONENTS PrintSupport
+)
qt_add_executable(dockwidgets
main.cpp
mainwindow.cpp mainwindow.h
)
+
set_target_properties(dockwidgets PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(dockwidgets PUBLIC
Qt::Core
Qt::Gui
Qt::Widgets
)
-# special case begin
+
if (TARGET Qt::PrintSupport)
target_link_libraries(dockwidgets PUBLIC Qt::PrintSupport)
endif()
-# special case end
-
# Resources:
set(dockwidgets_resource_files
@@ -48,7 +42,7 @@ set(dockwidgets_resource_files
"images/undo.png"
)
-qt6_add_resources(dockwidgets "dockwidgets"
+qt_add_resources(dockwidgets "dockwidgets"
PREFIX
"/"
FILES
diff --git a/examples/widgets/mainwindows/mainwindow/CMakeLists.txt b/examples/widgets/mainwindows/mainwindow/CMakeLists.txt
index 3d26b5d632..211456f43e 100644
--- a/examples/widgets/mainwindows/mainwindow/CMakeLists.txt
+++ b/examples/widgets/mainwindows/mainwindow/CMakeLists.txt
@@ -1,23 +1,15 @@
-# Generated from mainwindow.pro.
-
cmake_minimum_required(VERSION 3.16)
project(mainwindow LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/mainwindows/mainwindow")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(mainwindow
colorswatch.cpp colorswatch.h
@@ -25,17 +17,18 @@ qt_add_executable(mainwindow
mainwindow.cpp mainwindow.h
toolbar.cpp toolbar.h
)
+
set_target_properties(mainwindow PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(mainwindow PUBLIC
Qt::Core
Qt::Gui
Qt::Widgets
)
-
# Resources:
set(mainwindow_resource_files
"qt.png"
@@ -44,7 +37,7 @@ set(mainwindow_resource_files
"titlebarRight.png"
)
-qt6_add_resources(mainwindow "mainwindow"
+qt_add_resources(mainwindow "mainwindow"
PREFIX
"/res"
FILES
diff --git a/examples/widgets/mainwindows/mdi/CMakeLists.txt b/examples/widgets/mainwindows/mdi/CMakeLists.txt
index c34d0e9ad7..7a4908f37d 100644
--- a/examples/widgets/mainwindows/mdi/CMakeLists.txt
+++ b/examples/widgets/mainwindows/mdi/CMakeLists.txt
@@ -1,40 +1,33 @@
-# Generated from mdi.pro.
-
cmake_minimum_required(VERSION 3.16)
project(mdi LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/mainwindows/mdi")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(mdi
main.cpp
mainwindow.cpp mainwindow.h
mdichild.cpp mdichild.h
)
+
set_target_properties(mdi PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(mdi PUBLIC
Qt::Core
Qt::Gui
Qt::Widgets
)
-
# Resources:
set(mdi_resource_files
"images/copy.png"
@@ -45,7 +38,7 @@ set(mdi_resource_files
"images/save.png"
)
-qt6_add_resources(mdi "mdi"
+qt_add_resources(mdi "mdi"
PREFIX
"/"
FILES
diff --git a/examples/widgets/mainwindows/menus/CMakeLists.txt b/examples/widgets/mainwindows/menus/CMakeLists.txt
index c2c97b9f64..39802f8927 100644
--- a/examples/widgets/mainwindows/menus/CMakeLists.txt
+++ b/examples/widgets/mainwindows/menus/CMakeLists.txt
@@ -1,32 +1,26 @@
-# Generated from menus.pro.
-
cmake_minimum_required(VERSION 3.16)
project(menus LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/mainwindows/menus")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(menus
main.cpp
mainwindow.cpp mainwindow.h
)
+
set_target_properties(menus PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(menus PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/mainwindows/sdi/CMakeLists.txt b/examples/widgets/mainwindows/sdi/CMakeLists.txt
index 4a255be50b..195c27210c 100644
--- a/examples/widgets/mainwindows/sdi/CMakeLists.txt
+++ b/examples/widgets/mainwindows/sdi/CMakeLists.txt
@@ -1,39 +1,32 @@
-# Generated from sdi.pro.
-
cmake_minimum_required(VERSION 3.16)
project(sdi LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/mainwindows/sdi")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(sdi
main.cpp
mainwindow.cpp mainwindow.h
)
+
set_target_properties(sdi PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(sdi PUBLIC
Qt::Core
Qt::Gui
Qt::Widgets
)
-
# Resources:
set(sdi_resource_files
"images/copy.png"
@@ -44,7 +37,7 @@ set(sdi_resource_files
"images/save.png"
)
-qt6_add_resources(sdi "sdi"
+qt_add_resources(sdi "sdi"
PREFIX
"/"
FILES
diff --git a/examples/widgets/painting/.prev_CMakeLists.txt b/examples/widgets/painting/.prev_CMakeLists.txt
deleted file mode 100644
index 2ef5da303a..0000000000
--- a/examples/widgets/painting/.prev_CMakeLists.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-# Generated from painting.pro.
-
-add_subdirectory(basicdrawing)
-add_subdirectory(concentriccircles)
-add_subdirectory(affine)
-add_subdirectory(composition)
-add_subdirectory(deform)
-add_subdirectory(gradients)
-add_subdirectory(pathstroke)
-add_subdirectory(imagecomposition)
-add_subdirectory(painterpaths)
-add_subdirectory(transformations)
-add_subdirectory(fontsampler)
diff --git a/examples/widgets/painting/CMakeLists.txt b/examples/widgets/painting/CMakeLists.txt
index 40ebafdc31..35f3af71b5 100644
--- a/examples/widgets/painting/CMakeLists.txt
+++ b/examples/widgets/painting/CMakeLists.txt
@@ -1,10 +1,7 @@
-# Generated from painting.pro.
-
-#add_subdirectory(shared) # special case pulled in by other subdirs as needed
qt_internal_add_example(basicdrawing)
qt_internal_add_example(concentriccircles)
qt_internal_add_example(affine)
-# qt_internal_add_example(composition) # special case FIXME: Seems buggy wrt. usesOpenGL function
+# qt_internal_add_example(composition) # FIXME: Seems buggy wrt. usesOpenGL function
qt_internal_add_example(deform)
qt_internal_add_example(gradients)
qt_internal_add_example(pathstroke)
diff --git a/examples/widgets/painting/affine/.prev_CMakeLists.txt b/examples/widgets/painting/affine/.prev_CMakeLists.txt
deleted file mode 100644
index 4efe5f28a7..0000000000
--- a/examples/widgets/painting/affine/.prev_CMakeLists.txt
+++ /dev/null
@@ -1,118 +0,0 @@
-# Generated from affine.pro.
-
-cmake_minimum_required(VERSION 3.14)
-project(affine LANGUAGES CXX)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
-
-if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
-endif()
-
-set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/painting/affine")
-
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
-
-qt_add_executable(affine
- ../shared/arthurstyle.cpp ../shared/arthurstyle.h
- ../shared/arthurwidgets.cpp ../shared/arthurwidgets.h
- ../shared/hoverpoints.cpp ../shared/hoverpoints.h
- main.cpp
- xform.cpp xform.h
-)
-set_target_properties(affine PROPERTIES
- WIN32_EXECUTABLE TRUE
- MACOSX_BUNDLE TRUE
-)
-target_include_directories(affine PUBLIC
- ../shared
-)
-
-target_link_libraries(affine PUBLIC
- Qt::Core
- Qt::Gui
- Qt::Widgets
-)
-
-
-# Resources:
-set(shared_resource_files
- "../shared/images/button_normal_cap_left.png"
- "../shared/images/button_normal_cap_right.png"
- "../shared/images/button_normal_stretch.png"
- "../shared/images/button_pressed_cap_left.png"
- "../shared/images/button_pressed_cap_right.png"
- "../shared/images/button_pressed_stretch.png"
- "../shared/images/frame_bottom.png"
- "../shared/images/frame_bottomleft.png"
- "../shared/images/frame_bottomright.png"
- "../shared/images/frame_left.png"
- "../shared/images/frame_right.png"
- "../shared/images/frame_top.png"
- "../shared/images/frame_topleft.png"
- "../shared/images/frame_topright.png"
- "../shared/images/groupframe_bottom_left.png"
- "../shared/images/groupframe_bottom_right.png"
- "../shared/images/groupframe_bottom_stretch.png"
- "../shared/images/groupframe_left_stretch.png"
- "../shared/images/groupframe_right_stretch.png"
- "../shared/images/groupframe_top_stretch.png"
- "../shared/images/groupframe_topleft.png"
- "../shared/images/groupframe_topright.png"
- "../shared/images/line_dash_dot.png"
- "../shared/images/line_dash_dot_dot.png"
- "../shared/images/line_dashed.png"
- "../shared/images/line_dotted.png"
- "../shared/images/line_solid.png"
- "../shared/images/radiobutton-on.png"
- "../shared/images/radiobutton_off.png"
- "../shared/images/radiobutton_on.png"
- "../shared/images/slider_bar.png"
- "../shared/images/slider_thumb_on.png"
- "../shared/images/title_cap_left.png"
- "../shared/images/title_cap_right.png"
- "../shared/images/title_stretch.png"
-)
-
-qt6_add_resources(affine "shared"
- PREFIX
- "/res"
- BASE
- "../shared"
- FILES
- ${shared_resource_files}
-)
-set(affine_resource_files
- "bg1.jpg"
- "xform.cpp"
- "xform.html"
-)
-
-qt6_add_resources(affine "affine"
- PREFIX
- "/res/affine"
- FILES
- ${affine_resource_files}
-)
-
-if(QT_FEATURE_opengl)
- target_sources(affine PUBLIC
- ../shared/fbopaintdevice.cpp ../shared/fbopaintdevice.h
- )
-
- target_link_libraries(affine PUBLIC
- Qt::OpenGL
- )
-endif()
-
-install(TARGETS affine
- RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
- BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
- LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
-)
diff --git a/examples/widgets/painting/affine/CMakeLists.txt b/examples/widgets/painting/affine/CMakeLists.txt
index 8594017d30..602b1807d6 100644
--- a/examples/widgets/painting/affine/CMakeLists.txt
+++ b/examples/widgets/painting/affine/CMakeLists.txt
@@ -1,56 +1,45 @@
-# Generated from affine.pro.
-
cmake_minimum_required(VERSION 3.16)
project(affine LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/painting/affine")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(affine
- # special case begin
# remove files from ../shared
#../shared/arthurstyle.cpp ../shared/arthurstyle.h
#../shared/arthurwidgets.cpp ../shared/arthurwidgets.h
#../shared/hoverpoints.cpp ../shared/hoverpoints.h
- # special case end
main.cpp
xform.cpp xform.h
)
+
set_target_properties(affine PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_include_directories(affine PUBLIC
../shared
)
-# special case begin
if(NOT TARGET painting_shared::painting_shared)
include(../shared/use_lib.cmake)
endif()
-# special case end
target_link_libraries(affine PUBLIC
Qt::Core
Qt::Gui
Qt::Widgets
- painting_shared::painting_shared # special case
+ painting_shared::painting_shared
)
-
# Resources:
set(shared_resource_files
"../shared/images/button_normal_cap_left.png"
@@ -90,7 +79,7 @@ set(shared_resource_files
"../shared/images/title_stretch.png"
)
-qt6_add_resources(affine "shared"
+qt_add_resources(affine "shared"
PREFIX
"/res"
BASE
@@ -98,20 +87,20 @@ qt6_add_resources(affine "shared"
FILES
${shared_resource_files}
)
+
set(affine_resource_files
"bg1.jpg"
"xform.cpp"
"xform.html"
)
-qt6_add_resources(affine "affine"
+qt_add_resources(affine "affine"
PREFIX
"/res/affine"
FILES
${affine_resource_files}
)
-# special case begin
# remove files from ../shared
#if(QT_FEATURE_opengl)
#target_sources(affine PUBLIC
@@ -122,7 +111,6 @@ qt6_add_resources(affine "affine"
#Qt::OpenGL
#)
#endif()
-# special case end
install(TARGETS affine
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
diff --git a/examples/widgets/painting/basicdrawing/CMakeLists.txt b/examples/widgets/painting/basicdrawing/CMakeLists.txt
index 74e05e2f5e..496f1abfbe 100644
--- a/examples/widgets/painting/basicdrawing/CMakeLists.txt
+++ b/examples/widgets/painting/basicdrawing/CMakeLists.txt
@@ -1,47 +1,40 @@
-# Generated from basicdrawing.pro.
-
cmake_minimum_required(VERSION 3.16)
project(basicdrawing LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/painting/basicdrawing")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(basicdrawing
main.cpp
renderarea.cpp renderarea.h
window.cpp window.h
)
+
set_target_properties(basicdrawing PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(basicdrawing PUBLIC
Qt::Core
Qt::Gui
Qt::Widgets
)
-
# Resources:
set(basicdrawing_resource_files
"images/brick.png"
"images/qt-logo.png"
)
-qt6_add_resources(basicdrawing "basicdrawing"
+qt_add_resources(basicdrawing "basicdrawing"
PREFIX
"/"
FILES
diff --git a/examples/widgets/painting/composition/.prev_CMakeLists.txt b/examples/widgets/painting/composition/.prev_CMakeLists.txt
deleted file mode 100644
index 7cf2aab45f..0000000000
--- a/examples/widgets/painting/composition/.prev_CMakeLists.txt
+++ /dev/null
@@ -1,119 +0,0 @@
-# Generated from composition.pro.
-
-cmake_minimum_required(VERSION 3.14)
-project(composition LANGUAGES CXX)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
-
-if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
-endif()
-
-set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/painting/composition")
-
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
-
-qt_add_executable(composition
- ../shared/arthurstyle.cpp ../shared/arthurstyle.h
- ../shared/arthurwidgets.cpp ../shared/arthurwidgets.h
- ../shared/hoverpoints.cpp ../shared/hoverpoints.h
- composition.cpp composition.h
- main.cpp
-)
-set_target_properties(composition PROPERTIES
- WIN32_EXECUTABLE TRUE
- MACOSX_BUNDLE TRUE
-)
-target_include_directories(composition PUBLIC
- ../shared
-)
-
-target_link_libraries(composition PUBLIC
- Qt::Core
- Qt::Gui
- Qt::Widgets
-)
-
-
-# Resources:
-set(shared_resource_files
- "../shared/images/button_normal_cap_left.png"
- "../shared/images/button_normal_cap_right.png"
- "../shared/images/button_normal_stretch.png"
- "../shared/images/button_pressed_cap_left.png"
- "../shared/images/button_pressed_cap_right.png"
- "../shared/images/button_pressed_stretch.png"
- "../shared/images/frame_bottom.png"
- "../shared/images/frame_bottomleft.png"
- "../shared/images/frame_bottomright.png"
- "../shared/images/frame_left.png"
- "../shared/images/frame_right.png"
- "../shared/images/frame_top.png"
- "../shared/images/frame_topleft.png"
- "../shared/images/frame_topright.png"
- "../shared/images/groupframe_bottom_left.png"
- "../shared/images/groupframe_bottom_right.png"
- "../shared/images/groupframe_bottom_stretch.png"
- "../shared/images/groupframe_left_stretch.png"
- "../shared/images/groupframe_right_stretch.png"
- "../shared/images/groupframe_top_stretch.png"
- "../shared/images/groupframe_topleft.png"
- "../shared/images/groupframe_topright.png"
- "../shared/images/line_dash_dot.png"
- "../shared/images/line_dash_dot_dot.png"
- "../shared/images/line_dashed.png"
- "../shared/images/line_dotted.png"
- "../shared/images/line_solid.png"
- "../shared/images/radiobutton-on.png"
- "../shared/images/radiobutton_off.png"
- "../shared/images/radiobutton_on.png"
- "../shared/images/slider_bar.png"
- "../shared/images/slider_thumb_on.png"
- "../shared/images/title_cap_left.png"
- "../shared/images/title_cap_right.png"
- "../shared/images/title_stretch.png"
-)
-
-qt6_add_resources(composition "shared"
- PREFIX
- "/res"
- BASE
- "../shared"
- FILES
- ${shared_resource_files}
-)
-set(composition_resource_files
- "composition.cpp"
- "composition.html"
- "flower.jpg"
- "flower_alpha.jpg"
-)
-
-qt6_add_resources(composition "composition"
- PREFIX
- "/res/composition"
- FILES
- ${composition_resource_files}
-)
-
-if(QT_FEATURE_opengl)
- target_sources(composition PUBLIC
- ../shared/fbopaintdevice.cpp ../shared/fbopaintdevice.h
- )
-
- target_link_libraries(composition PUBLIC
- Qt::OpenGL
- )
-endif()
-
-install(TARGETS composition
- RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
- BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
- LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
-)
diff --git a/examples/widgets/painting/composition/CMakeLists.txt b/examples/widgets/painting/composition/CMakeLists.txt
index a859340074..252b46daca 100644
--- a/examples/widgets/painting/composition/CMakeLists.txt
+++ b/examples/widgets/painting/composition/CMakeLists.txt
@@ -1,56 +1,45 @@
-# Generated from composition.pro.
-
cmake_minimum_required(VERSION 3.16)
project(composition LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/painting/composition")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(composition
- # special case begin
# remove files from ../shared
#../shared/arthurstyle.cpp ../shared/arthurstyle.h
#../shared/arthurwidgets.cpp ../shared/arthurwidgets.h
#../shared/hoverpoints.cpp ../shared/hoverpoints.h
- # special case end
composition.cpp composition.h
main.cpp
)
+
set_target_properties(composition PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_include_directories(composition PUBLIC
../shared
)
-# special case begin
if(NOT TARGET painting_shared::painting_shared)
include(../shared/use_lib.cmake)
endif()
-# special case end
target_link_libraries(composition PUBLIC
Qt::Core
Qt::Gui
Qt::Widgets
- painting_shared::painting_shared # special case
+ painting_shared::painting_shared
)
-
# Resources:
set(shared_resource_files
"../shared/images/button_normal_cap_left.png"
@@ -90,7 +79,7 @@ set(shared_resource_files
"../shared/images/title_stretch.png"
)
-qt6_add_resources(composition "shared"
+qt_add_resources(composition "shared"
PREFIX
"/res"
BASE
@@ -98,6 +87,7 @@ qt6_add_resources(composition "shared"
FILES
${shared_resource_files}
)
+
set(composition_resource_files
"composition.cpp"
"composition.html"
@@ -105,14 +95,13 @@ set(composition_resource_files
"flower_alpha.jpg"
)
-qt6_add_resources(composition "composition"
+qt_add_resources(composition "composition"
PREFIX
"/res/composition"
FILES
${composition_resource_files}
)
-# special case begin
# remove files from ../shared
#if(QT_FEATURE_opengl)
#target_sources(affine PUBLIC
@@ -123,7 +112,6 @@ qt6_add_resources(composition "composition"
#Qt::OpenGL
#)
#endif()
-# special case end
install(TARGETS composition
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
diff --git a/examples/widgets/painting/concentriccircles/CMakeLists.txt b/examples/widgets/painting/concentriccircles/CMakeLists.txt
index 6ed7822902..b14db844b4 100644
--- a/examples/widgets/painting/concentriccircles/CMakeLists.txt
+++ b/examples/widgets/painting/concentriccircles/CMakeLists.txt
@@ -1,33 +1,27 @@
-# Generated from concentriccircles.pro.
-
cmake_minimum_required(VERSION 3.16)
project(concentriccircles LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/painting/concentriccircles")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(concentriccircles
circlewidget.cpp circlewidget.h
main.cpp
window.cpp window.h
)
+
set_target_properties(concentriccircles PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(concentriccircles PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/painting/deform/.prev_CMakeLists.txt b/examples/widgets/painting/deform/.prev_CMakeLists.txt
deleted file mode 100644
index c99df00a5a..0000000000
--- a/examples/widgets/painting/deform/.prev_CMakeLists.txt
+++ /dev/null
@@ -1,117 +0,0 @@
-# Generated from deform.pro.
-
-cmake_minimum_required(VERSION 3.14)
-project(deform LANGUAGES CXX)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
-
-if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
-endif()
-
-set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/painting/deform")
-
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
-
-qt_add_executable(deform
- ../shared/arthurstyle.cpp ../shared/arthurstyle.h
- ../shared/arthurwidgets.cpp ../shared/arthurwidgets.h
- ../shared/hoverpoints.cpp ../shared/hoverpoints.h
- main.cpp
- pathdeform.cpp pathdeform.h
-)
-set_target_properties(deform PROPERTIES
- WIN32_EXECUTABLE TRUE
- MACOSX_BUNDLE TRUE
-)
-target_include_directories(deform PUBLIC
- ../shared
-)
-
-target_link_libraries(deform PUBLIC
- Qt::Core
- Qt::Gui
- Qt::Widgets
-)
-
-
-# Resources:
-set(shared_resource_files
- "../shared/images/button_normal_cap_left.png"
- "../shared/images/button_normal_cap_right.png"
- "../shared/images/button_normal_stretch.png"
- "../shared/images/button_pressed_cap_left.png"
- "../shared/images/button_pressed_cap_right.png"
- "../shared/images/button_pressed_stretch.png"
- "../shared/images/frame_bottom.png"
- "../shared/images/frame_bottomleft.png"
- "../shared/images/frame_bottomright.png"
- "../shared/images/frame_left.png"
- "../shared/images/frame_right.png"
- "../shared/images/frame_top.png"
- "../shared/images/frame_topleft.png"
- "../shared/images/frame_topright.png"
- "../shared/images/groupframe_bottom_left.png"
- "../shared/images/groupframe_bottom_right.png"
- "../shared/images/groupframe_bottom_stretch.png"
- "../shared/images/groupframe_left_stretch.png"
- "../shared/images/groupframe_right_stretch.png"
- "../shared/images/groupframe_top_stretch.png"
- "../shared/images/groupframe_topleft.png"
- "../shared/images/groupframe_topright.png"
- "../shared/images/line_dash_dot.png"
- "../shared/images/line_dash_dot_dot.png"
- "../shared/images/line_dashed.png"
- "../shared/images/line_dotted.png"
- "../shared/images/line_solid.png"
- "../shared/images/radiobutton-on.png"
- "../shared/images/radiobutton_off.png"
- "../shared/images/radiobutton_on.png"
- "../shared/images/slider_bar.png"
- "../shared/images/slider_thumb_on.png"
- "../shared/images/title_cap_left.png"
- "../shared/images/title_cap_right.png"
- "../shared/images/title_stretch.png"
-)
-
-qt6_add_resources(deform "shared"
- PREFIX
- "/res"
- BASE
- "../shared"
- FILES
- ${shared_resource_files}
-)
-set(deform_resource_files
- "pathdeform.cpp"
- "pathdeform.html"
-)
-
-qt6_add_resources(deform "deform"
- PREFIX
- "/res/deform"
- FILES
- ${deform_resource_files}
-)
-
-if(QT_FEATURE_opengl)
- target_sources(deform PUBLIC
- ../shared/fbopaintdevice.cpp ../shared/fbopaintdevice.h
- )
-
- target_link_libraries(deform PUBLIC
- Qt::OpenGL
- )
-endif()
-
-install(TARGETS deform
- RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
- BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
- LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
-)
diff --git a/examples/widgets/painting/deform/CMakeLists.txt b/examples/widgets/painting/deform/CMakeLists.txt
index c95ae5f2f5..dc8f533711 100644
--- a/examples/widgets/painting/deform/CMakeLists.txt
+++ b/examples/widgets/painting/deform/CMakeLists.txt
@@ -1,56 +1,45 @@
-# Generated from deform.pro.
-
cmake_minimum_required(VERSION 3.16)
project(deform LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/painting/deform")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(deform
- # special case begin
# remove files from ../shared
#../shared/arthurstyle.cpp ../shared/arthurstyle.h
#../shared/arthurwidgets.cpp ../shared/arthurwidgets.h
#../shared/hoverpoints.cpp ../shared/hoverpoints.h
- # special case end
main.cpp
pathdeform.cpp pathdeform.h
)
+
set_target_properties(deform PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_include_directories(deform PUBLIC
../shared
)
-# special case begin
if(NOT TARGET painting_shared::painting_shared)
include(../shared/use_lib.cmake)
endif()
-# special case end
target_link_libraries(deform PUBLIC
Qt::Core
Qt::Gui
Qt::Widgets
- painting_shared::painting_shared # special case
+ painting_shared::painting_shared
)
-
# Resources:
set(shared_resource_files
"../shared/images/button_normal_cap_left.png"
@@ -90,7 +79,7 @@ set(shared_resource_files
"../shared/images/title_stretch.png"
)
-qt6_add_resources(deform "shared"
+qt_add_resources(deform "shared"
PREFIX
"/res"
BASE
@@ -98,19 +87,19 @@ qt6_add_resources(deform "shared"
FILES
${shared_resource_files}
)
+
set(deform_resource_files
"pathdeform.cpp"
"pathdeform.html"
)
-qt6_add_resources(deform "deform"
+qt_add_resources(deform "deform"
PREFIX
"/res/deform"
FILES
${deform_resource_files}
)
-# special case begin
# remove files from ../shared
#if(QT_FEATURE_opengl)
#target_sources(affine PUBLIC
@@ -121,7 +110,6 @@ qt6_add_resources(deform "deform"
#Qt::OpenGL
#)
#endif()
-# special case end
install(TARGETS deform
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
diff --git a/examples/widgets/painting/fontsampler/CMakeLists.txt b/examples/widgets/painting/fontsampler/CMakeLists.txt
index 58c610cf1c..0897e9b664 100644
--- a/examples/widgets/painting/fontsampler/CMakeLists.txt
+++ b/examples/widgets/painting/fontsampler/CMakeLists.txt
@@ -1,34 +1,31 @@
-# Generated from fontsampler.pro.
-
cmake_minimum_required(VERSION 3.16)
project(fontsampler LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/painting/fontsampler")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
-find_package(Qt6 COMPONENTS PrintSupport)
+find_package(Qt6
+ REQUIRED COMPONENTS Core Gui Widgets
+ OPTIONAL_COMPONENTS PrintSupport
+)
qt_add_executable(fontsampler
main.cpp
mainwindow.cpp mainwindow.h
mainwindowbase.ui
)
+
set_target_properties(fontsampler PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(fontsampler PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/painting/gradients/.prev_CMakeLists.txt b/examples/widgets/painting/gradients/.prev_CMakeLists.txt
deleted file mode 100644
index 1260b18089..0000000000
--- a/examples/widgets/painting/gradients/.prev_CMakeLists.txt
+++ /dev/null
@@ -1,117 +0,0 @@
-# Generated from gradients.pro.
-
-cmake_minimum_required(VERSION 3.14)
-project(gradients LANGUAGES CXX)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
-
-if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
-endif()
-
-set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/painting/gradients")
-
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
-
-qt_add_executable(gradients
- ../shared/arthurstyle.cpp ../shared/arthurstyle.h
- ../shared/arthurwidgets.cpp ../shared/arthurwidgets.h
- ../shared/hoverpoints.cpp ../shared/hoverpoints.h
- gradients.cpp gradients.h
- main.cpp
-)
-set_target_properties(gradients PROPERTIES
- WIN32_EXECUTABLE TRUE
- MACOSX_BUNDLE TRUE
-)
-target_include_directories(gradients PUBLIC
- ../shared
-)
-
-target_link_libraries(gradients PUBLIC
- Qt::Core
- Qt::Gui
- Qt::Widgets
-)
-
-
-# Resources:
-set(shared_resource_files
- "../shared/images/button_normal_cap_left.png"
- "../shared/images/button_normal_cap_right.png"
- "../shared/images/button_normal_stretch.png"
- "../shared/images/button_pressed_cap_left.png"
- "../shared/images/button_pressed_cap_right.png"
- "../shared/images/button_pressed_stretch.png"
- "../shared/images/frame_bottom.png"
- "../shared/images/frame_bottomleft.png"
- "../shared/images/frame_bottomright.png"
- "../shared/images/frame_left.png"
- "../shared/images/frame_right.png"
- "../shared/images/frame_top.png"
- "../shared/images/frame_topleft.png"
- "../shared/images/frame_topright.png"
- "../shared/images/groupframe_bottom_left.png"
- "../shared/images/groupframe_bottom_right.png"
- "../shared/images/groupframe_bottom_stretch.png"
- "../shared/images/groupframe_left_stretch.png"
- "../shared/images/groupframe_right_stretch.png"
- "../shared/images/groupframe_top_stretch.png"
- "../shared/images/groupframe_topleft.png"
- "../shared/images/groupframe_topright.png"
- "../shared/images/line_dash_dot.png"
- "../shared/images/line_dash_dot_dot.png"
- "../shared/images/line_dashed.png"
- "../shared/images/line_dotted.png"
- "../shared/images/line_solid.png"
- "../shared/images/radiobutton-on.png"
- "../shared/images/radiobutton_off.png"
- "../shared/images/radiobutton_on.png"
- "../shared/images/slider_bar.png"
- "../shared/images/slider_thumb_on.png"
- "../shared/images/title_cap_left.png"
- "../shared/images/title_cap_right.png"
- "../shared/images/title_stretch.png"
-)
-
-qt6_add_resources(gradients "shared"
- PREFIX
- "/res"
- BASE
- "../shared"
- FILES
- ${shared_resource_files}
-)
-set(gradients_resource_files
- "gradients.cpp"
- "gradients.html"
-)
-
-qt6_add_resources(gradients "gradients"
- PREFIX
- "/res/gradients"
- FILES
- ${gradients_resource_files}
-)
-
-if(QT_FEATURE_opengl)
- target_sources(gradients PUBLIC
- ../shared/fbopaintdevice.cpp ../shared/fbopaintdevice.h
- )
-
- target_link_libraries(gradients PUBLIC
- Qt::OpenGL
- )
-endif()
-
-install(TARGETS gradients
- RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
- BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
- LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
-)
diff --git a/examples/widgets/painting/gradients/CMakeLists.txt b/examples/widgets/painting/gradients/CMakeLists.txt
index 199389a47a..93e24d5400 100644
--- a/examples/widgets/painting/gradients/CMakeLists.txt
+++ b/examples/widgets/painting/gradients/CMakeLists.txt
@@ -1,56 +1,45 @@
-# Generated from gradients.pro.
-
cmake_minimum_required(VERSION 3.16)
project(gradients LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/painting/gradients")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(gradients
- # special case begin
# remove files from ../shared
#../shared/arthurstyle.cpp ../shared/arthurstyle.h
#../shared/arthurwidgets.cpp ../shared/arthurwidgets.h
#../shared/hoverpoints.cpp ../shared/hoverpoints.h
- # special case end
gradients.cpp gradients.h
main.cpp
)
+
set_target_properties(gradients PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_include_directories(gradients PUBLIC
../shared
)
-# special case begin
if(NOT TARGET painting_shared::painting_shared)
include(../shared/use_lib.cmake)
endif()
-# special case end
target_link_libraries(gradients PUBLIC
Qt::Core
Qt::Gui
Qt::Widgets
- painting_shared::painting_shared # special case
+ painting_shared::painting_shared
)
-
# Resources:
set(shared_resource_files
"../shared/images/button_normal_cap_left.png"
@@ -90,7 +79,7 @@ set(shared_resource_files
"../shared/images/title_stretch.png"
)
-qt6_add_resources(gradients "shared"
+qt_add_resources(gradients "shared"
PREFIX
"/res"
BASE
@@ -98,19 +87,19 @@ qt6_add_resources(gradients "shared"
FILES
${shared_resource_files}
)
+
set(gradients_resource_files
"gradients.cpp"
"gradients.html"
)
-qt6_add_resources(gradients "gradients"
+qt_add_resources(gradients "gradients"
PREFIX
"/res/gradients"
FILES
${gradients_resource_files}
)
-# special case begin
# remove files from ../shared
#if(QT_FEATURE_opengl)
#target_sources(affine PUBLIC
@@ -121,7 +110,6 @@ qt6_add_resources(gradients "gradients"
#Qt::OpenGL
#)
#endif()
-# special case end
install(TARGETS gradients
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
diff --git a/examples/widgets/painting/imagecomposition/CMakeLists.txt b/examples/widgets/painting/imagecomposition/CMakeLists.txt
index 902987ab64..035f9729b1 100644
--- a/examples/widgets/painting/imagecomposition/CMakeLists.txt
+++ b/examples/widgets/painting/imagecomposition/CMakeLists.txt
@@ -1,46 +1,39 @@
-# Generated from imagecomposition.pro.
-
cmake_minimum_required(VERSION 3.16)
project(imagecomposition LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/painting/imagecomposition")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(imagecomposition
imagecomposer.cpp imagecomposer.h
main.cpp
)
+
set_target_properties(imagecomposition PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(imagecomposition PUBLIC
Qt::Core
Qt::Gui
Qt::Widgets
)
-
# Resources:
set(imagecomposition_resource_files
"images/butterfly.png"
"images/checker.png"
)
-qt6_add_resources(imagecomposition "imagecomposition"
+qt_add_resources(imagecomposition "imagecomposition"
PREFIX
"/"
FILES
diff --git a/examples/widgets/painting/painterpaths/CMakeLists.txt b/examples/widgets/painting/painterpaths/CMakeLists.txt
index d26906e2f9..fde9403554 100644
--- a/examples/widgets/painting/painterpaths/CMakeLists.txt
+++ b/examples/widgets/painting/painterpaths/CMakeLists.txt
@@ -1,33 +1,27 @@
-# Generated from painterpaths.pro.
-
cmake_minimum_required(VERSION 3.16)
project(painterpaths LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/painting/painterpaths")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(painterpaths
main.cpp
renderarea.cpp renderarea.h
window.cpp window.h
)
+
set_target_properties(painterpaths PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(painterpaths PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/painting/pathstroke/.prev_CMakeLists.txt b/examples/widgets/painting/pathstroke/.prev_CMakeLists.txt
deleted file mode 100644
index e2c1d5f793..0000000000
--- a/examples/widgets/painting/pathstroke/.prev_CMakeLists.txt
+++ /dev/null
@@ -1,117 +0,0 @@
-# Generated from pathstroke.pro.
-
-cmake_minimum_required(VERSION 3.14)
-project(pathstroke LANGUAGES CXX)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
-
-if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
-endif()
-
-set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/painting/pathstroke")
-
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
-
-qt_add_executable(pathstroke
- ../shared/arthurstyle.cpp ../shared/arthurstyle.h
- ../shared/arthurwidgets.cpp ../shared/arthurwidgets.h
- ../shared/hoverpoints.cpp ../shared/hoverpoints.h
- main.cpp
- pathstroke.cpp pathstroke.h
-)
-set_target_properties(pathstroke PROPERTIES
- WIN32_EXECUTABLE TRUE
- MACOSX_BUNDLE TRUE
-)
-target_include_directories(pathstroke PUBLIC
- ../shared
-)
-
-target_link_libraries(pathstroke PUBLIC
- Qt::Core
- Qt::Gui
- Qt::Widgets
-)
-
-
-# Resources:
-set(shared_resource_files
- "../shared/images/button_normal_cap_left.png"
- "../shared/images/button_normal_cap_right.png"
- "../shared/images/button_normal_stretch.png"
- "../shared/images/button_pressed_cap_left.png"
- "../shared/images/button_pressed_cap_right.png"
- "../shared/images/button_pressed_stretch.png"
- "../shared/images/frame_bottom.png"
- "../shared/images/frame_bottomleft.png"
- "../shared/images/frame_bottomright.png"
- "../shared/images/frame_left.png"
- "../shared/images/frame_right.png"
- "../shared/images/frame_top.png"
- "../shared/images/frame_topleft.png"
- "../shared/images/frame_topright.png"
- "../shared/images/groupframe_bottom_left.png"
- "../shared/images/groupframe_bottom_right.png"
- "../shared/images/groupframe_bottom_stretch.png"
- "../shared/images/groupframe_left_stretch.png"
- "../shared/images/groupframe_right_stretch.png"
- "../shared/images/groupframe_top_stretch.png"
- "../shared/images/groupframe_topleft.png"
- "../shared/images/groupframe_topright.png"
- "../shared/images/line_dash_dot.png"
- "../shared/images/line_dash_dot_dot.png"
- "../shared/images/line_dashed.png"
- "../shared/images/line_dotted.png"
- "../shared/images/line_solid.png"
- "../shared/images/radiobutton-on.png"
- "../shared/images/radiobutton_off.png"
- "../shared/images/radiobutton_on.png"
- "../shared/images/slider_bar.png"
- "../shared/images/slider_thumb_on.png"
- "../shared/images/title_cap_left.png"
- "../shared/images/title_cap_right.png"
- "../shared/images/title_stretch.png"
-)
-
-qt6_add_resources(pathstroke "shared"
- PREFIX
- "/res"
- BASE
- "../shared"
- FILES
- ${shared_resource_files}
-)
-set(pathstroke_resource_files
- "pathstroke.cpp"
- "pathstroke.html"
-)
-
-qt6_add_resources(pathstroke "pathstroke"
- PREFIX
- "/res/pathstroke"
- FILES
- ${pathstroke_resource_files}
-)
-
-if(QT_FEATURE_opengl)
- target_sources(pathstroke PUBLIC
- ../shared/fbopaintdevice.cpp ../shared/fbopaintdevice.h
- )
-
- target_link_libraries(pathstroke PUBLIC
- Qt::OpenGL
- )
-endif()
-
-install(TARGETS pathstroke
- RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
- BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
- LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
-)
diff --git a/examples/widgets/painting/pathstroke/CMakeLists.txt b/examples/widgets/painting/pathstroke/CMakeLists.txt
index 2911a0f0e4..4c57495ff8 100644
--- a/examples/widgets/painting/pathstroke/CMakeLists.txt
+++ b/examples/widgets/painting/pathstroke/CMakeLists.txt
@@ -1,56 +1,45 @@
-# Generated from pathstroke.pro.
-
cmake_minimum_required(VERSION 3.16)
project(pathstroke LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/painting/pathstroke")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(pathstroke
- # special case begin
# remove files from ../shared
#../shared/arthurstyle.cpp ../shared/arthurstyle.h
#../shared/arthurwidgets.cpp ../shared/arthurwidgets.h
#../shared/hoverpoints.cpp ../shared/hoverpoints.h
- # special case end
main.cpp
pathstroke.cpp pathstroke.h
)
+
set_target_properties(pathstroke PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_include_directories(pathstroke PUBLIC
../shared
)
-# special case begin
if(NOT TARGET painting_shared::painting_shared)
include(../shared/use_lib.cmake)
endif()
-# special case end
target_link_libraries(pathstroke PUBLIC
Qt::Core
Qt::Gui
Qt::Widgets
- painting_shared::painting_shared # special case
+ painting_shared::painting_shared
)
-
# Resources:
set(shared_resource_files
"../shared/images/button_normal_cap_left.png"
@@ -90,7 +79,7 @@ set(shared_resource_files
"../shared/images/title_stretch.png"
)
-qt6_add_resources(pathstroke "shared"
+qt_add_resources(pathstroke "shared"
PREFIX
"/res"
BASE
@@ -98,19 +87,19 @@ qt6_add_resources(pathstroke "shared"
FILES
${shared_resource_files}
)
+
set(pathstroke_resource_files
"pathstroke.cpp"
"pathstroke.html"
)
-qt6_add_resources(pathstroke "pathstroke"
+qt_add_resources(pathstroke "pathstroke"
PREFIX
"/res/pathstroke"
FILES
${pathstroke_resource_files}
)
-# special case begin
# remove files from ../shared
#if(QT_FEATURE_opengl)
#target_sources(affine PUBLIC
@@ -121,7 +110,6 @@ qt6_add_resources(pathstroke "pathstroke"
#Qt::OpenGL
#)
#endif()
-# special case end
install(TARGETS pathstroke
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
diff --git a/examples/widgets/painting/shared/CMakeLists.txt b/examples/widgets/painting/shared/CMakeLists.txt
index 0fc65d3d99..a81b1413c7 100644
--- a/examples/widgets/painting/shared/CMakeLists.txt
+++ b/examples/widgets/painting/shared/CMakeLists.txt
@@ -1,6 +1,3 @@
-# special case skip regeneration
-# Port of shared.pri to be included by painting examples
-
add_library(painting_shared OBJECT)
add_library(painting_shared::painting_shared ALIAS painting_shared)
qt6_wrap_cpp(moc_files arthurwidgets.h hoverpoints.h) # no automoc for OBJECT libs:-/
@@ -10,6 +7,7 @@ target_sources(painting_shared PRIVATE
hoverpoints.cpp hoverpoints.h
${moc_files}
)
+
target_link_libraries(painting_shared PUBLIC Qt::Widgets)
target_include_directories(painting_shared PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")
diff --git a/examples/widgets/painting/transformations/CMakeLists.txt b/examples/widgets/painting/transformations/CMakeLists.txt
index c756f77d61..fcf03d1592 100644
--- a/examples/widgets/painting/transformations/CMakeLists.txt
+++ b/examples/widgets/painting/transformations/CMakeLists.txt
@@ -1,33 +1,27 @@
-# Generated from transformations.pro.
-
cmake_minimum_required(VERSION 3.16)
project(transformations LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/painting/transformations")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(transformations
main.cpp
renderarea.cpp renderarea.h
window.cpp window.h
)
+
set_target_properties(transformations PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(transformations PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/qnx/foreignwindows/collector.cpp b/examples/widgets/qnx/foreignwindows/collector.cpp
index 4b9e774945..f5406da793 100644
--- a/examples/widgets/qnx/foreignwindows/collector.cpp
+++ b/examples/widgets/qnx/foreignwindows/collector.cpp
@@ -63,7 +63,7 @@ Collector::~Collector()
QApplication::instance()->removeNativeEventFilter(this);
}
-bool Collector::nativeEventFilter(const QByteArray &eventType, void *message, long *result)
+bool Collector::nativeEventFilter(const QByteArray &eventType, void *message, qintptr *result)
{
Q_UNUSED(result);
diff --git a/examples/widgets/qnx/foreignwindows/collector.h b/examples/widgets/qnx/foreignwindows/collector.h
index 7c0b2e5cb6..1675099437 100644
--- a/examples/widgets/qnx/foreignwindows/collector.h
+++ b/examples/widgets/qnx/foreignwindows/collector.h
@@ -52,7 +52,7 @@ public:
explicit Collector(QWidget *parent = nullptr);
~Collector() override;
- bool nativeEventFilter(const QByteArray &eventType, void *message, long *result) override;
+ bool nativeEventFilter(const QByteArray &eventType, void *message, qintptr *result) override;
private:
struct Collectible
diff --git a/examples/widgets/richtext/CMakeLists.txt b/examples/widgets/richtext/CMakeLists.txt
index 86bbcccea5..cb49c61fa6 100644
--- a/examples/widgets/richtext/CMakeLists.txt
+++ b/examples/widgets/richtext/CMakeLists.txt
@@ -1,5 +1,3 @@
-# Generated from richtext.pro.
-
qt_internal_add_example(calendar)
qt_internal_add_example(orderform)
qt_internal_add_example(syntaxhighlighter)
diff --git a/examples/widgets/richtext/calendar/CMakeLists.txt b/examples/widgets/richtext/calendar/CMakeLists.txt
index 5846020183..8e75bcf83f 100644
--- a/examples/widgets/richtext/calendar/CMakeLists.txt
+++ b/examples/widgets/richtext/calendar/CMakeLists.txt
@@ -1,32 +1,26 @@
-# Generated from calendar.pro.
-
cmake_minimum_required(VERSION 3.16)
project(calendar LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/richtext/calendar")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(calendar
main.cpp
mainwindow.cpp mainwindow.h
)
+
set_target_properties(calendar PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(calendar PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/richtext/orderform/CMakeLists.txt b/examples/widgets/richtext/orderform/CMakeLists.txt
index 6903348223..28e9d92880 100644
--- a/examples/widgets/richtext/orderform/CMakeLists.txt
+++ b/examples/widgets/richtext/orderform/CMakeLists.txt
@@ -1,33 +1,27 @@
-# Generated from orderform.pro.
-
cmake_minimum_required(VERSION 3.16)
project(orderform LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/richtext/orderform")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(orderform
detailsdialog.cpp detailsdialog.h
main.cpp
mainwindow.cpp mainwindow.h
)
+
set_target_properties(orderform PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(orderform PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/richtext/syntaxhighlighter/CMakeLists.txt b/examples/widgets/richtext/syntaxhighlighter/CMakeLists.txt
index 3e288b1a25..4ec2cc8ee3 100644
--- a/examples/widgets/richtext/syntaxhighlighter/CMakeLists.txt
+++ b/examples/widgets/richtext/syntaxhighlighter/CMakeLists.txt
@@ -1,33 +1,27 @@
-# Generated from syntaxhighlighter.pro.
-
cmake_minimum_required(VERSION 3.16)
project(syntaxhighlighter LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/richtext/syntaxhighlighter")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(syntaxhighlighter
highlighter.cpp highlighter.h
main.cpp
mainwindow.cpp mainwindow.h
)
+
set_target_properties(syntaxhighlighter PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(syntaxhighlighter PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/richtext/textedit/.prev_CMakeLists.txt b/examples/widgets/richtext/textedit/.prev_CMakeLists.txt
deleted file mode 100644
index c32496a98b..0000000000
--- a/examples/widgets/richtext/textedit/.prev_CMakeLists.txt
+++ /dev/null
@@ -1,108 +0,0 @@
-# Generated from textedit.pro.
-
-cmake_minimum_required(VERSION 3.14)
-project(textedit LANGUAGES CXX)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
-
-if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
-endif()
-
-set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/richtext/textedit")
-
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
-
-qt_add_executable(textedit
- main.cpp
- textedit.cpp textedit.h
-)
-set_target_properties(textedit PROPERTIES
- WIN32_EXECUTABLE TRUE
- MACOSX_BUNDLE TRUE
-)
-target_link_libraries(textedit PUBLIC
- Qt::Core
- Qt::Gui
- Qt::Widgets
-)
-
-
-# Resources:
-set(textedit_resource_files
- "example.html"
- "images/logo32.png"
- "images/mac/checkbox-checked.png"
- "images/mac/checkbox.png"
- "images/mac/editcopy.png"
- "images/mac/editcut.png"
- "images/mac/editpaste.png"
- "images/mac/editredo.png"
- "images/mac/editundo.png"
- "images/mac/exportpdf.png"
- "images/mac/filenew.png"
- "images/mac/fileopen.png"
- "images/mac/fileprint.png"
- "images/mac/filesave.png"
- "images/mac/format-indent-less.png"
- "images/mac/format-indent-more.png"
- "images/mac/textbold.png"
- "images/mac/textcenter.png"
- "images/mac/textitalic.png"
- "images/mac/textjustify.png"
- "images/mac/textleft.png"
- "images/mac/textright.png"
- "images/mac/textunder.png"
- "images/mac/textundercolor.png"
- "images/mac/zoomin.png"
- "images/mac/zoomout.png"
- "images/win/checkbox-checked.png"
- "images/win/checkbox.png"
- "images/win/editcopy.png"
- "images/win/editcut.png"
- "images/win/editpaste.png"
- "images/win/editredo.png"
- "images/win/editundo.png"
- "images/win/exportpdf.png"
- "images/win/filenew.png"
- "images/win/fileopen.png"
- "images/win/fileprint.png"
- "images/win/filesave.png"
- "images/win/format-indent-less.png"
- "images/win/format-indent-more.png"
- "images/win/textbold.png"
- "images/win/textcenter.png"
- "images/win/textitalic.png"
- "images/win/textjustify.png"
- "images/win/textleft.png"
- "images/win/textright.png"
- "images/win/textunder.png"
- "images/win/textundercolor.png"
- "images/win/zoomin.png"
- "images/win/zoomout.png"
-)
-
-qt6_add_resources(textedit "textedit"
- PREFIX
- "/"
- FILES
- ${textedit_resource_files}
-)
-
-if(TARGET Qt::PrintSupport)
- target_link_libraries(textedit PUBLIC
- Qt::PrintSupport
- )
-endif()
-
-install(TARGETS textedit
- RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
- BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
- LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
-)
diff --git a/examples/widgets/richtext/textedit/CMakeLists.txt b/examples/widgets/richtext/textedit/CMakeLists.txt
index a94f50d988..f4d48a25eb 100644
--- a/examples/widgets/richtext/textedit/CMakeLists.txt
+++ b/examples/widgets/richtext/textedit/CMakeLists.txt
@@ -1,44 +1,38 @@
-# Generated from textedit.pro.
-
cmake_minimum_required(VERSION 3.16)
project(textedit LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/richtext/textedit")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
-find_package(Qt6 COMPONENTS PrintSupport) # special case
+find_package(Qt6
+ REQUIRED COMPONENTS Core Gui Widgets
+ OPTIONAL_COMPONENTS PrintSupport
+)
qt_add_executable(textedit
main.cpp
textedit.cpp textedit.h
)
+
set_target_properties(textedit PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(textedit PUBLIC
Qt::Core
Qt::Gui
Qt::Widgets
)
-# special case begin
+
if (TARGET Qt::PrintSupport)
target_link_libraries(textedit PUBLIC Qt::PrintSupport)
endif()
-# special case end
-
# Resources:
set(textedit_resource_files
@@ -94,7 +88,7 @@ set(textedit_resource_files
"images/win/zoomout.png"
)
-qt6_add_resources(textedit "textedit"
+qt_add_resources(textedit "textedit"
PREFIX
"/"
FILES
diff --git a/examples/widgets/scroller/CMakeLists.txt b/examples/widgets/scroller/CMakeLists.txt
index 37ee7ea08f..fb9ebc2848 100644
--- a/examples/widgets/scroller/CMakeLists.txt
+++ b/examples/widgets/scroller/CMakeLists.txt
@@ -1,3 +1 @@
-# Generated from scroller.pro.
-
qt_internal_add_example(graphicsview)
diff --git a/examples/widgets/scroller/graphicsview/CMakeLists.txt b/examples/widgets/scroller/graphicsview/CMakeLists.txt
index 5efa7f94ca..7316cfdfd6 100644
--- a/examples/widgets/scroller/graphicsview/CMakeLists.txt
+++ b/examples/widgets/scroller/graphicsview/CMakeLists.txt
@@ -1,31 +1,25 @@
-# Generated from graphicsview.pro.
-
cmake_minimum_required(VERSION 3.16)
project(graphicsview LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/scroller/graphicsview")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(graphicsview
main.cpp
)
+
set_target_properties(graphicsview PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(graphicsview PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/tools/.prev_CMakeLists.txt b/examples/widgets/tools/.prev_CMakeLists.txt
deleted file mode 100644
index 29e7f8f9e8..0000000000
--- a/examples/widgets/tools/.prev_CMakeLists.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-# Generated from tools.pro.
-
-add_subdirectory(completer)
-add_subdirectory(customcompleter)
-add_subdirectory(regularexpression)
-add_subdirectory(settingseditor)
-add_subdirectory(styleplugin)
-add_subdirectory(treemodelcompleter)
-add_subdirectory(undo)
-add_subdirectory(undoframework)
-if(QT_FEATURE_library)
- add_subdirectory(echoplugin)
- add_subdirectory(plugandpaint)
-endif()
-if(QT_FEATURE_translation)
- add_subdirectory(i18n)
-endif()
diff --git a/examples/widgets/tools/CMakeLists.txt b/examples/widgets/tools/CMakeLists.txt
index 0056518f1e..79c231e9be 100644
--- a/examples/widgets/tools/CMakeLists.txt
+++ b/examples/widgets/tools/CMakeLists.txt
@@ -1,8 +1,6 @@
-# Generated from tools.pro.
-
qt_internal_add_example(completer)
qt_internal_add_example(customcompleter)
-if(QT_FEATURE_translation) # special case
+if(QT_FEATURE_translation)
qt_internal_add_example(i18n)
endif()
qt_internal_add_example(regularexpression)
@@ -12,11 +10,10 @@ qt_internal_add_example(treemodelcompleter)
qt_internal_add_example(undo)
qt_internal_add_example(undoframework)
-if(QT_FEATURE_library) # special case
- add_subdirectory(echoplugin)
- # special case begin
+if(QT_FEATURE_library)
+ qt_internal_add_example(echoplugin)
+
if(QT_FEATURE_inputdialog)
qt_internal_add_example(plugandpaint)
endif()
- # special case end
endif()
diff --git a/examples/widgets/tools/completer/CMakeLists.txt b/examples/widgets/tools/completer/CMakeLists.txt
index e03092543e..1224984b11 100644
--- a/examples/widgets/tools/completer/CMakeLists.txt
+++ b/examples/widgets/tools/completer/CMakeLists.txt
@@ -1,47 +1,40 @@
-# Generated from completer.pro.
-
cmake_minimum_required(VERSION 3.16)
project(completer LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/tools/completer")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(completer
fsmodel.cpp fsmodel.h
main.cpp
mainwindow.cpp mainwindow.h
)
+
set_target_properties(completer PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(completer PUBLIC
Qt::Core
Qt::Gui
Qt::Widgets
)
-
# Resources:
set(completer_resource_files
"resources/countries.txt"
"resources/wordlist.txt"
)
-qt6_add_resources(completer "completer"
+qt_add_resources(completer "completer"
PREFIX
"/"
FILES
diff --git a/examples/widgets/tools/customcompleter/CMakeLists.txt b/examples/widgets/tools/customcompleter/CMakeLists.txt
index c725f85336..a32870b047 100644
--- a/examples/widgets/tools/customcompleter/CMakeLists.txt
+++ b/examples/widgets/tools/customcompleter/CMakeLists.txt
@@ -1,46 +1,39 @@
-# Generated from customcompleter.pro.
-
cmake_minimum_required(VERSION 3.16)
project(customcompleter LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/tools/customcompleter")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(customcompleter
main.cpp
mainwindow.cpp mainwindow.h
textedit.cpp textedit.h
)
+
set_target_properties(customcompleter PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(customcompleter PUBLIC
Qt::Core
Qt::Gui
Qt::Widgets
)
-
# Resources:
set(customcompleter_resource_files
"resources/wordlist.txt"
)
-qt6_add_resources(customcompleter "customcompleter"
+qt_add_resources(customcompleter "customcompleter"
PREFIX
"/"
FILES
diff --git a/examples/widgets/tools/echoplugin/CMakeLists.txt b/examples/widgets/tools/echoplugin/CMakeLists.txt
index 6e32a4de09..93b49b43d7 100644
--- a/examples/widgets/tools/echoplugin/CMakeLists.txt
+++ b/examples/widgets/tools/echoplugin/CMakeLists.txt
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.16)
project(plugandpaint LANGUAGES CXX)
-find_package(Qt6 COMPONENTS Core Gui Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
set(CMAKE_AUTOMOC ON)
diff --git a/examples/widgets/tools/echoplugin/echowindow/.prev_CMakeLists.txt b/examples/widgets/tools/echoplugin/echowindow/.prev_CMakeLists.txt
deleted file mode 100644
index 1262ce5452..0000000000
--- a/examples/widgets/tools/echoplugin/echowindow/.prev_CMakeLists.txt
+++ /dev/null
@@ -1,41 +0,0 @@
-# Generated from echowindow.pro.
-
-cmake_minimum_required(VERSION 3.14)
-project(echoplugin LANGUAGES CXX)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
-
-if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
-endif()
-
-set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/tools/echoplugin")
-
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
-
-qt_add_executable(echoplugin
- echointerface.h
- echowindow.cpp echowindow.h
- main.cpp
-)
-set_target_properties(echoplugin PROPERTIES
- WIN32_EXECUTABLE TRUE
- MACOSX_BUNDLE TRUE
-)
-target_link_libraries(echoplugin PUBLIC
- Qt::Core
- Qt::Gui
- Qt::Widgets
-)
-
-install(TARGETS echoplugin
- RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
- BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
- LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
-)
diff --git a/examples/widgets/tools/echoplugin/echowindow/CMakeLists.txt b/examples/widgets/tools/echoplugin/echowindow/CMakeLists.txt
index 3fcbe17172..29183a7c1f 100644
--- a/examples/widgets/tools/echoplugin/echowindow/CMakeLists.txt
+++ b/examples/widgets/tools/echoplugin/echowindow/CMakeLists.txt
@@ -3,10 +3,12 @@ qt_add_executable(echopluginwindow
echowindow.cpp echowindow.h
main.cpp
)
+
set_target_properties(echopluginwindow PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(echopluginwindow PRIVATE
Qt::Core
Qt::Gui
diff --git a/examples/widgets/tools/echoplugin/plugin/.prev_CMakeLists.txt b/examples/widgets/tools/echoplugin/plugin/.prev_CMakeLists.txt
deleted file mode 100644
index 9f3a93b3bd..0000000000
--- a/examples/widgets/tools/echoplugin/plugin/.prev_CMakeLists.txt
+++ /dev/null
@@ -1,35 +0,0 @@
-# Generated from plugin.pro.
-
-cmake_minimum_required(VERSION 3.14)
-project(echoplugin 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/tools/echoplugin/plugins")
-
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
-
-add_library(echoplugin MODULE
- echoplugin.cpp echoplugin.h
-)
-target_include_directories(echoplugin PUBLIC
- ../echowindow
-)
-
-target_link_libraries(echoplugin PUBLIC
- Qt::Core
- Qt::Gui
- Qt::Widgets
-)
-
-install(TARGETS echoplugin
- RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
- BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
- LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
-)
diff --git a/examples/widgets/tools/echoplugin/plugin/CMakeLists.txt b/examples/widgets/tools/echoplugin/plugin/CMakeLists.txt
index fb727aa1d7..7d63180a87 100644
--- a/examples/widgets/tools/echoplugin/plugin/CMakeLists.txt
+++ b/examples/widgets/tools/echoplugin/plugin/CMakeLists.txt
@@ -1,12 +1,15 @@
qt_add_plugin(echoplugin
CLASS_NAME EchoPlugin
)
+
target_sources(echoplugin PRIVATE
echoplugin.cpp echoplugin.h
)
+
set_target_properties(echoplugin PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/echowindow"
)
+
target_include_directories(echoplugin PUBLIC
../echowindow
)
diff --git a/examples/widgets/tools/i18n/CMakeLists.txt b/examples/widgets/tools/i18n/CMakeLists.txt
index 4ff9402dec..ba357aa312 100644
--- a/examples/widgets/tools/i18n/CMakeLists.txt
+++ b/examples/widgets/tools/i18n/CMakeLists.txt
@@ -1,40 +1,33 @@
-# Generated from i18n.pro.
-
cmake_minimum_required(VERSION 3.16)
project(i18n LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/tools/i18n")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(i18n
languagechooser.cpp languagechooser.h
main.cpp
mainwindow.cpp mainwindow.h
)
+
set_target_properties(i18n PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(i18n PUBLIC
Qt::Core
Qt::Gui
Qt::Widgets
)
-
# Resources:
set(i18n_resource_files
"translations/i18n_ar.qm"
@@ -53,7 +46,7 @@ set(i18n_resource_files
"translations/i18n_zh.qm"
)
-qt6_add_resources(i18n "i18n"
+qt_add_resources(i18n "i18n"
PREFIX
"/"
FILES
diff --git a/examples/widgets/tools/plugandpaint/CMakeLists.txt b/examples/widgets/tools/plugandpaint/CMakeLists.txt
index e681812dad..54cb83fd89 100644
--- a/examples/widgets/tools/plugandpaint/CMakeLists.txt
+++ b/examples/widgets/tools/plugandpaint/CMakeLists.txt
@@ -1,11 +1,9 @@
cmake_minimum_required(VERSION 3.16)
project(plugandpaint LANGUAGES CXX)
-find_package(Qt6 COMPONENTS Core Gui Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
set(INSTALL_EXAMPLESDIR "examples")
diff --git a/examples/widgets/tools/plugandpaint/app/.prev_CMakeLists.txt b/examples/widgets/tools/plugandpaint/app/.prev_CMakeLists.txt
deleted file mode 100644
index feaac7ad8f..0000000000
--- a/examples/widgets/tools/plugandpaint/app/.prev_CMakeLists.txt
+++ /dev/null
@@ -1,74 +0,0 @@
-# Generated from app.pro.
-
-cmake_minimum_required(VERSION 3.14)
-project(plugandpaint LANGUAGES CXX)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
-
-if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
-endif()
-
-set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/tools/plugandpaint")
-
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
-
-qt_add_executable(plugandpaint
- interfaces.h
- main.cpp
- mainwindow.cpp mainwindow.h
- paintarea.cpp paintarea.h
- plugindialog.cpp plugindialog.h
-)
-set_target_properties(plugandpaint PROPERTIES
- WIN32_EXECUTABLE TRUE
- MACOSX_BUNDLE TRUE
-)
-target_link_libraries(plugandpaint PUBLIC
- # Remove: L../plugins
- Qt::Core
- Qt::Gui
- Qt::Widgets
-)
-
-if(macx-xcode)
- target_link_libraries(plugandpaint PUBLIC
- (
- )
- pnp_basictools$
- )
-endif()
-
-if(NOT macx-xcode)
- target_link_libraries(plugandpaint PUBLIC
- pnp_basictools
- )
-endif()
-
-if(((NOT (macx-xcode)) AND (( NOT debug_and_release OR build_pass ) AND CONFIG(debug,debug OR release))) AND (APPLE))
- target_link_libraries(plugandpaint PUBLIC
- (LIBS, 0)
- (LIBS, 1)
- _debug
- )
-endif()
-
-if(((NOT (macx-xcode)) AND (( NOT debug_and_release OR build_pass ) AND CONFIG(debug,debug OR release))) AND (WIN32))
- target_link_libraries(plugandpaint PUBLIC
- (LIBS, 0)
- (LIBS, 1)
- d
- )
-endif()
-
-install(TARGETS plugandpaint
- RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
- BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
- LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
-)
diff --git a/examples/widgets/tools/plugandpaint/app/CMakeLists.txt b/examples/widgets/tools/plugandpaint/app/CMakeLists.txt
index 3e46331f81..f2b5b4937f 100644
--- a/examples/widgets/tools/plugandpaint/app/CMakeLists.txt
+++ b/examples/widgets/tools/plugandpaint/app/CMakeLists.txt
@@ -5,10 +5,12 @@ qt_add_executable(plugandpaint
paintarea.cpp paintarea.h
plugindialog.cpp plugindialog.h
)
+
set_target_properties(plugandpaint PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(plugandpaint PRIVATE
Qt::Widgets
pnp_basictools
diff --git a/examples/widgets/tools/plugandpaint/plugins/basictools/.prev_CMakeLists.txt b/examples/widgets/tools/plugandpaint/plugins/basictools/.prev_CMakeLists.txt
deleted file mode 100644
index 76474c282b..0000000000
--- a/examples/widgets/tools/plugandpaint/plugins/basictools/.prev_CMakeLists.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-# Generated from basictools.pro.
-
-cmake_minimum_required(VERSION 3.14)
-project(pnp_basictools 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/tools/plugandpaint/plugins")
-
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
-
-qt6_add_plugin(pnp_basictools STATIC)
-target_sources(pnp_basictools PRIVATE
- basictoolsplugin.cpp basictoolsplugin.h
-)
-target_include_directories(pnp_basictools PUBLIC
- ../../app
-)
-
-target_link_libraries(pnp_basictools PUBLIC
- Qt::Core
- Qt::Gui
- Qt::Widgets
-)
-
-install(TARGETS pnp_basictools
- RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
- BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
- LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
-)
diff --git a/examples/widgets/tools/plugandpaint/plugins/basictools/CMakeLists.txt b/examples/widgets/tools/plugandpaint/plugins/basictools/CMakeLists.txt
index 0056205319..638bb53ef6 100644
--- a/examples/widgets/tools/plugandpaint/plugins/basictools/CMakeLists.txt
+++ b/examples/widgets/tools/plugandpaint/plugins/basictools/CMakeLists.txt
@@ -2,9 +2,11 @@ qt_add_plugin(pnp_basictools
STATIC
CLASS_NAME BasicToolsPlugin
)
+
target_sources(pnp_basictools PRIVATE
basictoolsplugin.cpp basictoolsplugin.h
)
+
target_include_directories(pnp_basictools PUBLIC
../../app
)
diff --git a/examples/widgets/tools/plugandpaint/plugins/extrafilters/.prev_CMakeLists.txt b/examples/widgets/tools/plugandpaint/plugins/extrafilters/.prev_CMakeLists.txt
deleted file mode 100644
index 57f37843b8..0000000000
--- a/examples/widgets/tools/plugandpaint/plugins/extrafilters/.prev_CMakeLists.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-# Generated from extrafilters.pro.
-
-cmake_minimum_required(VERSION 3.14)
-project(pnp_extrafilters 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/tools/plugandpaint/plugins")
-
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
-
-qt_add_plugin(pnp_extrafilters)
-target_sources(pnp_extrafilters PRIVATE
- extrafiltersplugin.cpp extrafiltersplugin.h
-)
-target_include_directories(pnp_extrafilters PUBLIC
- ../../app
-)
-
-target_link_libraries(pnp_extrafilters PUBLIC
- Qt::Core
- Qt::Gui
- Qt::Widgets
-)
-
-install(TARGETS pnp_extrafilters
- RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
- BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
- LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
-)
diff --git a/examples/widgets/tools/plugandpaint/plugins/extrafilters/CMakeLists.txt b/examples/widgets/tools/plugandpaint/plugins/extrafilters/CMakeLists.txt
index 2332f84399..4a3dd45de9 100644
--- a/examples/widgets/tools/plugandpaint/plugins/extrafilters/CMakeLists.txt
+++ b/examples/widgets/tools/plugandpaint/plugins/extrafilters/CMakeLists.txt
@@ -1,12 +1,15 @@
qt_add_plugin(pnp_extrafilters
CLASS_NAME ExtraFiltersPlugin
)
+
target_sources(pnp_extrafilters PRIVATE
extrafiltersplugin.cpp extrafiltersplugin.h
)
+
set_target_properties(pnp_extrafilters PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/app"
)
+
target_include_directories(pnp_extrafilters PUBLIC
../../app
)
diff --git a/examples/widgets/tools/regularexpression/CMakeLists.txt b/examples/widgets/tools/regularexpression/CMakeLists.txt
index 26865e5179..4675f251a4 100644
--- a/examples/widgets/tools/regularexpression/CMakeLists.txt
+++ b/examples/widgets/tools/regularexpression/CMakeLists.txt
@@ -1,45 +1,38 @@
-# Generated from regularexpression.pro.
-
cmake_minimum_required(VERSION 3.16)
project(regularexpression LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/tools/regularexpression")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(regularexpression
main.cpp
regularexpressiondialog.cpp regularexpressiondialog.h
)
+
set_target_properties(regularexpression PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(regularexpression PUBLIC
Qt::Core
Qt::Gui
Qt::Widgets
)
-
# Resources:
set(regularexpression_resource_files
"images/copy.png"
)
-qt6_add_resources(regularexpression "regularexpression"
+qt_add_resources(regularexpression "regularexpression"
PREFIX
"/"
FILES
diff --git a/examples/widgets/tools/settingseditor/CMakeLists.txt b/examples/widgets/tools/settingseditor/CMakeLists.txt
index fc050b5f76..f72dc7c912 100644
--- a/examples/widgets/tools/settingseditor/CMakeLists.txt
+++ b/examples/widgets/tools/settingseditor/CMakeLists.txt
@@ -1,23 +1,15 @@
-# Generated from settingseditor.pro.
-
cmake_minimum_required(VERSION 3.16)
project(settingseditor LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/tools/settingseditor")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(settingseditor
locationdialog.cpp locationdialog.h
@@ -26,10 +18,12 @@ qt_add_executable(settingseditor
settingstree.cpp settingstree.h
variantdelegate.cpp variantdelegate.h
)
+
set_target_properties(settingseditor PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(settingseditor PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/tools/styleplugin/.prev_CMakeLists.txt b/examples/widgets/tools/styleplugin/.prev_CMakeLists.txt
deleted file mode 100644
index 630c3703f8..0000000000
--- a/examples/widgets/tools/styleplugin/.prev_CMakeLists.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-# Generated from styleplugin.pro.
-
-add_subdirectory(stylewindow)
-add_subdirectory(plugin)
diff --git a/examples/widgets/tools/styleplugin/CMakeLists.txt b/examples/widgets/tools/styleplugin/CMakeLists.txt
index 33412f5306..acd918786d 100644
--- a/examples/widgets/tools/styleplugin/CMakeLists.txt
+++ b/examples/widgets/tools/styleplugin/CMakeLists.txt
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.16)
project(styleplugin LANGUAGES CXX)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Widgets)
set(CMAKE_AUTOMOC ON)
diff --git a/examples/widgets/tools/styleplugin/plugin/.prev_CMakeLists.txt b/examples/widgets/tools/styleplugin/plugin/.prev_CMakeLists.txt
deleted file mode 100644
index c1be706fde..0000000000
--- a/examples/widgets/tools/styleplugin/plugin/.prev_CMakeLists.txt
+++ /dev/null
@@ -1,32 +0,0 @@
-# Generated from plugin.pro.
-
-cmake_minimum_required(VERSION 3.14)
-project(simplestyleplugin 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/tools/styleplugin/styles")
-
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
-
-add_library(simplestyleplugin MODULE
- simplestyle.cpp simplestyle.h
- simplestyleplugin.cpp simplestyleplugin.h
-)
-target_link_libraries(simplestyleplugin PUBLIC
- Qt::Core
- Qt::Gui
- Qt::Widgets
-)
-
-install(TARGETS simplestyleplugin
- RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
- BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
- LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
-)
diff --git a/examples/widgets/tools/styleplugin/plugin/CMakeLists.txt b/examples/widgets/tools/styleplugin/plugin/CMakeLists.txt
index 30a06231c1..fb2b877ca6 100644
--- a/examples/widgets/tools/styleplugin/plugin/CMakeLists.txt
+++ b/examples/widgets/tools/styleplugin/plugin/CMakeLists.txt
@@ -1,13 +1,16 @@
qt_add_plugin(simplestyleplugin
CLASS_NAME SimpleStylePlugin
)
+
target_sources(simplestyleplugin PRIVATE
simplestyle.cpp simplestyle.h
simplestyleplugin.cpp simplestyleplugin.h
)
+
set_target_properties(simplestyleplugin PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/stylewindow/styles"
)
+
target_link_libraries(simplestyleplugin PRIVATE
Qt::Core
Qt::Gui
diff --git a/examples/widgets/tools/styleplugin/stylewindow/CMakeLists.txt b/examples/widgets/tools/styleplugin/stylewindow/CMakeLists.txt
index aab63afbf2..fe844aaf4b 100644
--- a/examples/widgets/tools/styleplugin/stylewindow/CMakeLists.txt
+++ b/examples/widgets/tools/styleplugin/stylewindow/CMakeLists.txt
@@ -2,15 +2,18 @@ qt_add_executable(styleplugin
main.cpp
stylewindow.cpp stylewindow.h
)
+
set_target_properties(styleplugin PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(styleplugin PRIVATE
Qt::Core
Qt::Gui
Qt::Widgets
)
+
if(NOT QT6_IS_SHARED_LIBS_BUILD)
target_link_libraries(styleplugin PRIVATE
simplestyleplugin
diff --git a/examples/widgets/tools/treemodelcompleter/CMakeLists.txt b/examples/widgets/tools/treemodelcompleter/CMakeLists.txt
index 92ec0f7944..11279629d8 100644
--- a/examples/widgets/tools/treemodelcompleter/CMakeLists.txt
+++ b/examples/widgets/tools/treemodelcompleter/CMakeLists.txt
@@ -1,46 +1,39 @@
-# Generated from treemodelcompleter.pro.
-
cmake_minimum_required(VERSION 3.16)
project(treemodelcompleter LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/tools/treemodelcompleter")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(treemodelcompleter
main.cpp
mainwindow.cpp mainwindow.h
treemodelcompleter.cpp treemodelcompleter.h
)
+
set_target_properties(treemodelcompleter PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(treemodelcompleter PUBLIC
Qt::Core
Qt::Gui
Qt::Widgets
)
-
# Resources:
set(treemodelcompleter_resource_files
"resources/treemodel.txt"
)
-qt6_add_resources(treemodelcompleter "treemodelcompleter"
+qt_add_resources(treemodelcompleter "treemodelcompleter"
PREFIX
"/"
FILES
diff --git a/examples/widgets/tools/undo/CMakeLists.txt b/examples/widgets/tools/undo/CMakeLists.txt
index 94e63a665c..6f3e2781b7 100644
--- a/examples/widgets/tools/undo/CMakeLists.txt
+++ b/examples/widgets/tools/undo/CMakeLists.txt
@@ -1,23 +1,18 @@
-# Generated from undo.pro.
-
cmake_minimum_required(VERSION 3.16)
project(undo LANGUAGES CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/tools/undo")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(undo
commands.cpp commands.h
@@ -25,17 +20,18 @@ qt_add_executable(undo
main.cpp
mainwindow.cpp mainwindow.h mainwindow.ui
)
+
set_target_properties(undo PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(undo PUBLIC
Qt::Core
Qt::Gui
Qt::Widgets
)
-
# Resources:
set(undo_resource_files
"icons/background.png"
@@ -56,7 +52,7 @@ set(undo_resource_files
"icons/undo.png"
)
-qt6_add_resources(undo "undo"
+qt_add_resources(undo "undo"
PREFIX
"/"
FILES
diff --git a/examples/widgets/tools/undoframework/CMakeLists.txt b/examples/widgets/tools/undoframework/CMakeLists.txt
index a315ab46d6..ff222a1a8b 100644
--- a/examples/widgets/tools/undoframework/CMakeLists.txt
+++ b/examples/widgets/tools/undoframework/CMakeLists.txt
@@ -1,23 +1,15 @@
-# Generated from undoframework.pro.
-
cmake_minimum_required(VERSION 3.16)
project(undoframework LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/tools/undoframework")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(undoframework
commands.cpp commands.h
@@ -26,23 +18,24 @@ qt_add_executable(undoframework
main.cpp
mainwindow.cpp mainwindow.h
)
+
set_target_properties(undoframework PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(undoframework PUBLIC
Qt::Core
Qt::Gui
Qt::Widgets
)
-
# Resources:
set(undoframework_resource_files
"images/cross.png"
)
-qt6_add_resources(undoframework "undoframework"
+qt_add_resources(undoframework "undoframework"
PREFIX
"/"
FILES
diff --git a/examples/widgets/touch/CMakeLists.txt b/examples/widgets/touch/CMakeLists.txt
index ca6ef7fcb8..96d46484b6 100644
--- a/examples/widgets/touch/CMakeLists.txt
+++ b/examples/widgets/touch/CMakeLists.txt
@@ -1,5 +1,3 @@
-# Generated from touch.pro.
-
if(NOT TARGET Qt::Widgets)
return()
endif()
diff --git a/examples/widgets/touch/dials/CMakeLists.txt b/examples/widgets/touch/dials/CMakeLists.txt
index dcfb3a9194..c20ce4ac4a 100644
--- a/examples/widgets/touch/dials/CMakeLists.txt
+++ b/examples/widgets/touch/dials/CMakeLists.txt
@@ -1,32 +1,27 @@
-# Generated from dials.pro.
-
cmake_minimum_required(VERSION 3.16)
project(dials LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/touch/dials")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(dials
dials.ui
main.cpp
)
+
set_target_properties(dials PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(dials PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/touch/fingerpaint/.prev_CMakeLists.txt b/examples/widgets/touch/fingerpaint/.prev_CMakeLists.txt
deleted file mode 100644
index 3077bf5bc6..0000000000
--- a/examples/widgets/touch/fingerpaint/.prev_CMakeLists.txt
+++ /dev/null
@@ -1,47 +0,0 @@
-# Generated from fingerpaint.pro.
-
-cmake_minimum_required(VERSION 3.14)
-project(fingerpaint LANGUAGES CXX)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
-
-if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
-endif()
-
-set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/touch/fingerpaint")
-
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
-
-qt_add_executable(fingerpaint
- main.cpp
- mainwindow.cpp mainwindow.h
- scribblearea.cpp scribblearea.h
-)
-set_target_properties(fingerpaint PROPERTIES
- WIN32_EXECUTABLE TRUE
- MACOSX_BUNDLE TRUE
-)
-target_link_libraries(fingerpaint PUBLIC
- Qt::Core
- Qt::Gui
- Qt::Widgets
-)
-
-if(TARGET Qt::PrintSupport)
- target_link_libraries(fingerpaint PUBLIC
- Qt::PrintSupport
- )
-endif()
-
-install(TARGETS fingerpaint
- RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
- BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
- LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
-)
diff --git a/examples/widgets/touch/fingerpaint/CMakeLists.txt b/examples/widgets/touch/fingerpaint/CMakeLists.txt
index 12e96173cf..72697951c4 100644
--- a/examples/widgets/touch/fingerpaint/CMakeLists.txt
+++ b/examples/widgets/touch/fingerpaint/CMakeLists.txt
@@ -1,44 +1,39 @@
-# Generated from fingerpaint.pro.
-
cmake_minimum_required(VERSION 3.16)
project(fingerpaint LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/touch/fingerpaint")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
-find_package(Qt6 COMPONENTS PrintSupport) # special case
+find_package(Qt6
+ REQUIRED COMPONENTS Core Gui Widgets
+ OPTIONAL_COMPONENTS PrintSupport
+)
qt_add_executable(fingerpaint
main.cpp
mainwindow.cpp mainwindow.h
scribblearea.cpp scribblearea.h
)
+
set_target_properties(fingerpaint PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(fingerpaint PUBLIC
Qt::Core
Qt::Gui
Qt::Widgets
)
-# special case begin
+
if (TARGET Qt::PrintSupport)
target_link_libraries(fingerpaint PUBLIC Qt::PrintSupport)
endif()
-# special case end
if(TARGET Qt::PrintSupport)
target_link_libraries(fingerpaint PUBLIC
diff --git a/examples/widgets/touch/knobs/CMakeLists.txt b/examples/widgets/touch/knobs/CMakeLists.txt
index a3b118a7ef..399ffe8127 100644
--- a/examples/widgets/touch/knobs/CMakeLists.txt
+++ b/examples/widgets/touch/knobs/CMakeLists.txt
@@ -1,32 +1,26 @@
-# Generated from knobs.pro.
-
cmake_minimum_required(VERSION 3.16)
project(knobs LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/touch/knobs")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(knobs
knob.cpp knob.h
main.cpp
)
+
set_target_properties(knobs PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(knobs PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/touch/pinchzoom/CMakeLists.txt b/examples/widgets/touch/pinchzoom/CMakeLists.txt
index 6efbf831ec..ecfbb3d7f6 100644
--- a/examples/widgets/touch/pinchzoom/CMakeLists.txt
+++ b/examples/widgets/touch/pinchzoom/CMakeLists.txt
@@ -1,46 +1,39 @@
-# Generated from pinchzoom.pro.
-
cmake_minimum_required(VERSION 3.16)
project(pinchzoom LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/touch/pinchzoom")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(pinchzoom
graphicsview.cpp graphicsview.h
main.cpp
mouse.cpp mouse.h
)
+
set_target_properties(pinchzoom PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(pinchzoom PUBLIC
Qt::Core
Qt::Gui
Qt::Widgets
)
-
# Resources:
set(mice_resource_files
"images/cheese.jpg"
)
-qt6_add_resources(pinchzoom "mice"
+qt_add_resources(pinchzoom "mice"
PREFIX
"/"
FILES
diff --git a/examples/widgets/tutorials/CMakeLists.txt b/examples/widgets/tutorials/CMakeLists.txt
index 733eb42151..091bf7109b 100644
--- a/examples/widgets/tutorials/CMakeLists.txt
+++ b/examples/widgets/tutorials/CMakeLists.txt
@@ -1,5 +1,3 @@
-# Generated from tutorials.pro.
-
add_subdirectory(addressbook)
add_subdirectory(widgets)
add_subdirectory(modelview)
diff --git a/examples/widgets/tutorials/addressbook/CMakeLists.txt b/examples/widgets/tutorials/addressbook/CMakeLists.txt
index cb00cbc084..1d8a65bb0b 100644
--- a/examples/widgets/tutorials/addressbook/CMakeLists.txt
+++ b/examples/widgets/tutorials/addressbook/CMakeLists.txt
@@ -1,5 +1,3 @@
-# Generated from addressbook.pro.
-
qt_internal_add_example(part1)
qt_internal_add_example(part2)
qt_internal_add_example(part3)
diff --git a/examples/widgets/tutorials/addressbook/part1/CMakeLists.txt b/examples/widgets/tutorials/addressbook/part1/CMakeLists.txt
index 66d07422a7..ffa3a0d0ad 100644
--- a/examples/widgets/tutorials/addressbook/part1/CMakeLists.txt
+++ b/examples/widgets/tutorials/addressbook/part1/CMakeLists.txt
@@ -1,32 +1,26 @@
-# Generated from part1.pro.
-
cmake_minimum_required(VERSION 3.16)
project(part1 LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/tutorials/addressbook/part1")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(part1
addressbook.cpp addressbook.h
main.cpp
)
+
set_target_properties(part1 PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(part1 PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/tutorials/addressbook/part2/CMakeLists.txt b/examples/widgets/tutorials/addressbook/part2/CMakeLists.txt
index 0af325d2eb..907b97d147 100644
--- a/examples/widgets/tutorials/addressbook/part2/CMakeLists.txt
+++ b/examples/widgets/tutorials/addressbook/part2/CMakeLists.txt
@@ -1,32 +1,26 @@
-# Generated from part2.pro.
-
cmake_minimum_required(VERSION 3.16)
project(part2 LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/tutorials/addressbook/part2")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(part2
addressbook.cpp addressbook.h
main.cpp
)
+
set_target_properties(part2 PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(part2 PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/tutorials/addressbook/part3/CMakeLists.txt b/examples/widgets/tutorials/addressbook/part3/CMakeLists.txt
index bf250b92ed..7eda1c0f7e 100644
--- a/examples/widgets/tutorials/addressbook/part3/CMakeLists.txt
+++ b/examples/widgets/tutorials/addressbook/part3/CMakeLists.txt
@@ -1,32 +1,26 @@
-# Generated from part3.pro.
-
cmake_minimum_required(VERSION 3.16)
project(part3 LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/tutorials/addressbook/part3")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(part3
addressbook.cpp addressbook.h
main.cpp
)
+
set_target_properties(part3 PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(part3 PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/tutorials/addressbook/part4/CMakeLists.txt b/examples/widgets/tutorials/addressbook/part4/CMakeLists.txt
index 4bba55d0f4..a274ca0b24 100644
--- a/examples/widgets/tutorials/addressbook/part4/CMakeLists.txt
+++ b/examples/widgets/tutorials/addressbook/part4/CMakeLists.txt
@@ -1,32 +1,26 @@
-# Generated from part4.pro.
-
cmake_minimum_required(VERSION 3.16)
project(part4 LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/tutorials/addressbook/part4")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(part4
addressbook.cpp addressbook.h
main.cpp
)
+
set_target_properties(part4 PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(part4 PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/tutorials/addressbook/part5/CMakeLists.txt b/examples/widgets/tutorials/addressbook/part5/CMakeLists.txt
index 646a404c64..4f1756e581 100644
--- a/examples/widgets/tutorials/addressbook/part5/CMakeLists.txt
+++ b/examples/widgets/tutorials/addressbook/part5/CMakeLists.txt
@@ -1,33 +1,27 @@
-# Generated from part5.pro.
-
cmake_minimum_required(VERSION 3.16)
project(part5 LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/tutorials/addressbook/part5")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(part5
addressbook.cpp addressbook.h
finddialog.cpp finddialog.h
main.cpp
)
+
set_target_properties(part5 PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(part5 PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/tutorials/addressbook/part6/CMakeLists.txt b/examples/widgets/tutorials/addressbook/part6/CMakeLists.txt
index 2300e6fa58..9188e1738b 100644
--- a/examples/widgets/tutorials/addressbook/part6/CMakeLists.txt
+++ b/examples/widgets/tutorials/addressbook/part6/CMakeLists.txt
@@ -1,33 +1,27 @@
-# Generated from part6.pro.
-
cmake_minimum_required(VERSION 3.16)
project(part6 LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/tutorials/addressbook/part6")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(part6
addressbook.cpp addressbook.h
finddialog.cpp finddialog.h
main.cpp
)
+
set_target_properties(part6 PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(part6 PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/tutorials/addressbook/part7/CMakeLists.txt b/examples/widgets/tutorials/addressbook/part7/CMakeLists.txt
index 93c51ebed9..a186d9499c 100644
--- a/examples/widgets/tutorials/addressbook/part7/CMakeLists.txt
+++ b/examples/widgets/tutorials/addressbook/part7/CMakeLists.txt
@@ -1,33 +1,27 @@
-# Generated from part7.pro.
-
cmake_minimum_required(VERSION 3.16)
project(part7 LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/tutorials/addressbook/part7")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(part7
addressbook.cpp addressbook.h
finddialog.cpp finddialog.h
main.cpp
)
+
set_target_properties(part7 PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(part7 PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/tutorials/gettingStarted/gsQt/CMakeLists.txt b/examples/widgets/tutorials/gettingStarted/gsQt/CMakeLists.txt
index 8302fd7598..6ceae61bce 100644
--- a/examples/widgets/tutorials/gettingStarted/gsQt/CMakeLists.txt
+++ b/examples/widgets/tutorials/gettingStarted/gsQt/CMakeLists.txt
@@ -1,5 +1,3 @@
-# Generated from gsqt.pro.
-
qt_internal_add_example(part1)
qt_internal_add_example(part2)
qt_internal_add_example(part3)
diff --git a/examples/widgets/tutorials/gettingStarted/gsQt/part1/CMakeLists.txt b/examples/widgets/tutorials/gettingStarted/gsQt/part1/CMakeLists.txt
index 0e73ada7ba..a8525a53ba 100644
--- a/examples/widgets/tutorials/gettingStarted/gsQt/part1/CMakeLists.txt
+++ b/examples/widgets/tutorials/gettingStarted/gsQt/part1/CMakeLists.txt
@@ -1,31 +1,25 @@
-# Generated from part1.pro.
-
cmake_minimum_required(VERSION 3.16)
project(getting_started_part1 LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/tutorials/gettingStarted/gsQt/part1")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(getting_started_part1
main.cpp
)
+
set_target_properties(getting_started_part1 PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(getting_started_part1 PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/tutorials/gettingStarted/gsQt/part2/CMakeLists.txt b/examples/widgets/tutorials/gettingStarted/gsQt/part2/CMakeLists.txt
index 0b828abc0f..dc5e7361db 100644
--- a/examples/widgets/tutorials/gettingStarted/gsQt/part2/CMakeLists.txt
+++ b/examples/widgets/tutorials/gettingStarted/gsQt/part2/CMakeLists.txt
@@ -1,31 +1,25 @@
-# Generated from part2.pro.
-
cmake_minimum_required(VERSION 3.16)
project(getting_started_part2 LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/tutorials/gettingStarted/gsQt/part2")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(getting_started_part2
main.cpp
)
+
set_target_properties(getting_started_part2 PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(getting_started_part2 PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/tutorials/gettingStarted/gsQt/part3/CMakeLists.txt b/examples/widgets/tutorials/gettingStarted/gsQt/part3/CMakeLists.txt
index 7b8506399a..75d2a4e407 100644
--- a/examples/widgets/tutorials/gettingStarted/gsQt/part3/CMakeLists.txt
+++ b/examples/widgets/tutorials/gettingStarted/gsQt/part3/CMakeLists.txt
@@ -1,31 +1,25 @@
-# Generated from part3.pro.
-
cmake_minimum_required(VERSION 3.16)
project(getting_started_part3 LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/tutorials/gettingStarted/gsQt/part3")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(getting_started_part3
main.cpp
)
+
set_target_properties(getting_started_part3 PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(getting_started_part3 PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/tutorials/gettingStarted/gsQt/part4/CMakeLists.txt b/examples/widgets/tutorials/gettingStarted/gsQt/part4/CMakeLists.txt
index f28bc9f3fa..f96e92b184 100644
--- a/examples/widgets/tutorials/gettingStarted/gsQt/part4/CMakeLists.txt
+++ b/examples/widgets/tutorials/gettingStarted/gsQt/part4/CMakeLists.txt
@@ -1,31 +1,25 @@
-# Generated from part4.pro.
-
cmake_minimum_required(VERSION 3.16)
project(getting_started_part4 LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/tutorials/gettingStarted/gsQt/part4")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(getting_started_part4
main.cpp
)
+
set_target_properties(getting_started_part4 PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(getting_started_part4 PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/tutorials/gettingStarted/gsQt/part5/CMakeLists.txt b/examples/widgets/tutorials/gettingStarted/gsQt/part5/CMakeLists.txt
index 95e0f1db43..efaf7d8b14 100644
--- a/examples/widgets/tutorials/gettingStarted/gsQt/part5/CMakeLists.txt
+++ b/examples/widgets/tutorials/gettingStarted/gsQt/part5/CMakeLists.txt
@@ -1,31 +1,25 @@
-# Generated from part5.pro.
-
cmake_minimum_required(VERSION 3.16)
project(getting_started_part5 LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/tutorials/gettingStarted/gsQt/part5")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(getting_started_part5
main.cpp
)
+
set_target_properties(getting_started_part5 PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(getting_started_part5 PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/tutorials/modelview/1_readonly/CMakeLists.txt b/examples/widgets/tutorials/modelview/1_readonly/CMakeLists.txt
index a87df63fd9..e4b1459e55 100644
--- a/examples/widgets/tutorials/modelview/1_readonly/CMakeLists.txt
+++ b/examples/widgets/tutorials/modelview/1_readonly/CMakeLists.txt
@@ -1,32 +1,26 @@
-# Generated from 1_readonly.pro.
-
cmake_minimum_required(VERSION 3.16)
project(mv_readonly LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/tutorials/modelview/1_readonly")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(mv_readonly
main.cpp
mymodel.cpp mymodel.h
)
+
set_target_properties(mv_readonly PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(mv_readonly PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/tutorials/modelview/2_formatting/CMakeLists.txt b/examples/widgets/tutorials/modelview/2_formatting/CMakeLists.txt
index 20c3181cf5..cec088d059 100644
--- a/examples/widgets/tutorials/modelview/2_formatting/CMakeLists.txt
+++ b/examples/widgets/tutorials/modelview/2_formatting/CMakeLists.txt
@@ -1,32 +1,26 @@
-# Generated from 2_formatting.pro.
-
cmake_minimum_required(VERSION 3.16)
project(mv_formatting LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/tutorials/modelview/2_formatting")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(mv_formatting
main.cpp
mymodel.cpp mymodel.h
)
+
set_target_properties(mv_formatting PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(mv_formatting PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/tutorials/modelview/3_changingmodel/CMakeLists.txt b/examples/widgets/tutorials/modelview/3_changingmodel/CMakeLists.txt
index fa4397528b..0b99f28682 100644
--- a/examples/widgets/tutorials/modelview/3_changingmodel/CMakeLists.txt
+++ b/examples/widgets/tutorials/modelview/3_changingmodel/CMakeLists.txt
@@ -1,32 +1,26 @@
-# Generated from 3_changingmodel.pro.
-
cmake_minimum_required(VERSION 3.16)
project(mv_changingmodel LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/tutorials/modelview/3_changingmodel")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(mv_changingmodel
main.cpp
mymodel.cpp mymodel.h
)
+
set_target_properties(mv_changingmodel PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(mv_changingmodel PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/tutorials/modelview/4_headers/CMakeLists.txt b/examples/widgets/tutorials/modelview/4_headers/CMakeLists.txt
index 4bf8f5fd0b..71932d5a62 100644
--- a/examples/widgets/tutorials/modelview/4_headers/CMakeLists.txt
+++ b/examples/widgets/tutorials/modelview/4_headers/CMakeLists.txt
@@ -1,32 +1,26 @@
-# Generated from 4_headers.pro.
-
cmake_minimum_required(VERSION 3.16)
project(mv_headers LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/tutorials/modelview/4_headers")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(mv_headers
main.cpp
mymodel.cpp mymodel.h
)
+
set_target_properties(mv_headers PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(mv_headers PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/tutorials/modelview/5_edit/CMakeLists.txt b/examples/widgets/tutorials/modelview/5_edit/CMakeLists.txt
index 388491db8b..0f9a075b50 100644
--- a/examples/widgets/tutorials/modelview/5_edit/CMakeLists.txt
+++ b/examples/widgets/tutorials/modelview/5_edit/CMakeLists.txt
@@ -1,33 +1,27 @@
-# Generated from 5_edit.pro.
-
cmake_minimum_required(VERSION 3.16)
project(mv_edit LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/tutorials/modelview/5_edit")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(mv_edit
main.cpp
mainwindow.cpp mainwindow.h
mymodel.cpp mymodel.h
)
+
set_target_properties(mv_edit PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(mv_edit PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/tutorials/modelview/6_treeview/CMakeLists.txt b/examples/widgets/tutorials/modelview/6_treeview/CMakeLists.txt
index 1759eef471..856d3354fc 100644
--- a/examples/widgets/tutorials/modelview/6_treeview/CMakeLists.txt
+++ b/examples/widgets/tutorials/modelview/6_treeview/CMakeLists.txt
@@ -1,32 +1,26 @@
-# Generated from 6_treeview.pro.
-
cmake_minimum_required(VERSION 3.16)
project(mv_tree LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/tutorials/modelview/6_treeview")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(mv_tree
main.cpp
mainwindow.cpp mainwindow.h
)
+
set_target_properties(mv_tree PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(mv_tree PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/tutorials/modelview/7_selections/CMakeLists.txt b/examples/widgets/tutorials/modelview/7_selections/CMakeLists.txt
index 35c30f3efc..1c3910be40 100644
--- a/examples/widgets/tutorials/modelview/7_selections/CMakeLists.txt
+++ b/examples/widgets/tutorials/modelview/7_selections/CMakeLists.txt
@@ -1,32 +1,26 @@
-# Generated from 7_selections.pro.
-
cmake_minimum_required(VERSION 3.16)
project(mv_selections LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/tutorials/modelview/7_selections")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(mv_selections
main.cpp
mainwindow.cpp mainwindow.h
)
+
set_target_properties(mv_selections PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(mv_selections PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/tutorials/modelview/CMakeLists.txt b/examples/widgets/tutorials/modelview/CMakeLists.txt
index 49ca672e48..889b07b8da 100644
--- a/examples/widgets/tutorials/modelview/CMakeLists.txt
+++ b/examples/widgets/tutorials/modelview/CMakeLists.txt
@@ -1,5 +1,3 @@
-# Generated from modelview.pro.
-
qt_internal_add_example(1_readonly)
qt_internal_add_example(2_formatting)
qt_internal_add_example(3_changingmodel)
diff --git a/examples/widgets/tutorials/notepad/.prev_CMakeLists.txt b/examples/widgets/tutorials/notepad/.prev_CMakeLists.txt
deleted file mode 100644
index 119ca9d6cf..0000000000
--- a/examples/widgets/tutorials/notepad/.prev_CMakeLists.txt
+++ /dev/null
@@ -1,76 +0,0 @@
-# Generated from notepad.pro.
-
-cmake_minimum_required(VERSION 3.14)
-project(notepad LANGUAGES CXX)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
-
-if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
-endif()
-
-set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/tutorials/notepad")
-
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
-
-qt_add_executable(notepad
- main.cpp
- notepad.cpp notepad.h notepad.ui
-)
-set_target_properties(notepad PROPERTIES
- WIN32_EXECUTABLE TRUE
- MACOSX_BUNDLE TRUE
-)
-target_link_libraries(notepad PUBLIC
- Qt::Core
- Qt::Gui
- Qt::Widgets
-)
-
-
-# Resources:
-set(notepad_resource_files
- "images/bold.png"
- "images/copy.png"
- "images/create.png"
- "images/cut.png"
- "images/edit_redo.png"
- "images/edit_undo.png"
- "images/exit.png"
- "images/font.png"
- "images/info.png"
- "images/italic.png"
- "images/new.png"
- "images/open.png"
- "images/paste.png"
- "images/pencil.png"
- "images/print.png"
- "images/save.png"
- "images/save_as.png"
- "images/underline.png"
-)
-
-qt6_add_resources(notepad "notepad"
- PREFIX
- "/"
- FILES
- ${notepad_resource_files}
-)
-
-if(TARGET Qt::PrintSupport)
- target_link_libraries(notepad PUBLIC
- Qt::PrintSupport
- )
-endif()
-
-install(TARGETS notepad
- RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
- BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
- LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
-)
diff --git a/examples/widgets/tutorials/notepad/CMakeLists.txt b/examples/widgets/tutorials/notepad/CMakeLists.txt
index 3c1fea3e6b..b4be0e1bb0 100644
--- a/examples/widgets/tutorials/notepad/CMakeLists.txt
+++ b/examples/widgets/tutorials/notepad/CMakeLists.txt
@@ -1,40 +1,36 @@
-# Generated from notepad.pro.
-
cmake_minimum_required(VERSION 3.16)
project(notepad LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/tutorials/notepad")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
-find_package(Qt6 COMPONENTS PrintSupport) # special case: add
+find_package(Qt6
+ REQUIRED COMPONENTS Core Gui Widgets
+ OPTIONAL_COMPONENTS PrintSupport
+)
qt_add_executable(notepad
main.cpp
notepad.cpp notepad.h notepad.ui
)
+
set_target_properties(notepad PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(notepad PUBLIC
Qt::Core
Qt::Gui
Qt::Widgets
)
-
# Resources:
set(notepad_resource_files
"images/bold.png"
@@ -57,7 +53,7 @@ set(notepad_resource_files
"images/underline.png"
)
-qt6_add_resources(notepad "notepad"
+qt_add_resources(notepad "notepad"
PREFIX
"/"
FILES
diff --git a/examples/widgets/tutorials/widgets/CMakeLists.txt b/examples/widgets/tutorials/widgets/CMakeLists.txt
index fcf0ed9ddd..2898f65da8 100644
--- a/examples/widgets/tutorials/widgets/CMakeLists.txt
+++ b/examples/widgets/tutorials/widgets/CMakeLists.txt
@@ -1,5 +1,3 @@
-# Generated from widgets.pro.
-
qt_internal_add_example(toplevel)
qt_internal_add_example(childwidget)
qt_internal_add_example(windowlayout)
diff --git a/examples/widgets/tutorials/widgets/childwidget/CMakeLists.txt b/examples/widgets/tutorials/widgets/childwidget/CMakeLists.txt
index f51514818b..95fcbb66f4 100644
--- a/examples/widgets/tutorials/widgets/childwidget/CMakeLists.txt
+++ b/examples/widgets/tutorials/widgets/childwidget/CMakeLists.txt
@@ -1,31 +1,25 @@
-# Generated from childwidget.pro.
-
cmake_minimum_required(VERSION 3.16)
project(childwidget LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/tutorials/widgets/childwidget")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(childwidget
main.cpp
)
+
set_target_properties(childwidget PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(childwidget PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/tutorials/widgets/nestedlayouts/CMakeLists.txt b/examples/widgets/tutorials/widgets/nestedlayouts/CMakeLists.txt
index 3bd5d52c51..ea2929de64 100644
--- a/examples/widgets/tutorials/widgets/nestedlayouts/CMakeLists.txt
+++ b/examples/widgets/tutorials/widgets/nestedlayouts/CMakeLists.txt
@@ -1,31 +1,25 @@
-# Generated from nestedlayouts.pro.
-
cmake_minimum_required(VERSION 3.16)
project(nestedlayouts LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/tutorials/widgets/nestedlayouts")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(nestedlayouts
main.cpp
)
+
set_target_properties(nestedlayouts PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(nestedlayouts PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/tutorials/widgets/toplevel/CMakeLists.txt b/examples/widgets/tutorials/widgets/toplevel/CMakeLists.txt
index 893c5c72ee..e694fb5dc5 100644
--- a/examples/widgets/tutorials/widgets/toplevel/CMakeLists.txt
+++ b/examples/widgets/tutorials/widgets/toplevel/CMakeLists.txt
@@ -1,31 +1,25 @@
-# Generated from toplevel.pro.
-
cmake_minimum_required(VERSION 3.16)
project(toplevel LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/tutorials/widgets/toplevel")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(toplevel
main.cpp
)
+
set_target_properties(toplevel PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(toplevel PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/tutorials/widgets/windowlayout/CMakeLists.txt b/examples/widgets/tutorials/widgets/windowlayout/CMakeLists.txt
index 95bf0f2f50..3fb804183d 100644
--- a/examples/widgets/tutorials/widgets/windowlayout/CMakeLists.txt
+++ b/examples/widgets/tutorials/widgets/windowlayout/CMakeLists.txt
@@ -1,31 +1,25 @@
-# Generated from windowlayout.pro.
-
cmake_minimum_required(VERSION 3.16)
project(windowlayout LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/tutorials/widgets/windowlayout")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(windowlayout
main.cpp
)
+
set_target_properties(windowlayout PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(windowlayout PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/widgets/CMakeLists.txt b/examples/widgets/widgets/CMakeLists.txt
index 34d3d28b67..25912d2ec0 100644
--- a/examples/widgets/widgets/CMakeLists.txt
+++ b/examples/widgets/widgets/CMakeLists.txt
@@ -1,5 +1,3 @@
-# Generated from widgets.pro.
-
qt_internal_add_example(analogclock)
qt_internal_add_example(calculator)
qt_internal_add_example(calendarwidget)
diff --git a/examples/widgets/widgets/analogclock/CMakeLists.txt b/examples/widgets/widgets/analogclock/CMakeLists.txt
index 624b041c32..f09dd791ae 100644
--- a/examples/widgets/widgets/analogclock/CMakeLists.txt
+++ b/examples/widgets/widgets/analogclock/CMakeLists.txt
@@ -1,32 +1,26 @@
-# Generated from analogclock.pro.
-
cmake_minimum_required(VERSION 3.16)
project(analogclock LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/widgets/analogclock")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(analogclock
analogclock.cpp analogclock.h
main.cpp
)
+
set_target_properties(analogclock PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(analogclock PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/widgets/calculator/CMakeLists.txt b/examples/widgets/widgets/calculator/CMakeLists.txt
index 8449ba5c57..e81065bbfd 100644
--- a/examples/widgets/widgets/calculator/CMakeLists.txt
+++ b/examples/widgets/widgets/calculator/CMakeLists.txt
@@ -1,33 +1,27 @@
-# Generated from calculator.pro.
-
cmake_minimum_required(VERSION 3.16)
project(calculator LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/widgets/calculator")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(calculator
button.cpp button.h
calculator.cpp calculator.h
main.cpp
)
+
set_target_properties(calculator PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(calculator PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/widgets/calendarwidget/CMakeLists.txt b/examples/widgets/widgets/calendarwidget/CMakeLists.txt
index f43b1590d0..553c70dab7 100644
--- a/examples/widgets/widgets/calendarwidget/CMakeLists.txt
+++ b/examples/widgets/widgets/calendarwidget/CMakeLists.txt
@@ -1,32 +1,26 @@
-# Generated from calendarwidget.pro.
-
cmake_minimum_required(VERSION 3.16)
project(calendarwidget LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/widgets/calendarwidget")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(calendarwidget
main.cpp
window.cpp window.h
)
+
set_target_properties(calendarwidget PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(calendarwidget PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/widgets/charactermap/CMakeLists.txt b/examples/widgets/widgets/charactermap/CMakeLists.txt
index 33980ce3b5..e33229e0e4 100644
--- a/examples/widgets/widgets/charactermap/CMakeLists.txt
+++ b/examples/widgets/widgets/charactermap/CMakeLists.txt
@@ -1,33 +1,27 @@
-# Generated from charactermap.pro.
-
cmake_minimum_required(VERSION 3.16)
project(charactermap LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/widgets/charactermap")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(charactermap
characterwidget.cpp characterwidget.h
main.cpp
mainwindow.cpp mainwindow.h
)
+
set_target_properties(charactermap PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(charactermap PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/widgets/codeeditor/CMakeLists.txt b/examples/widgets/widgets/codeeditor/CMakeLists.txt
index 9bed15f47b..d97cccdcc4 100644
--- a/examples/widgets/widgets/codeeditor/CMakeLists.txt
+++ b/examples/widgets/widgets/codeeditor/CMakeLists.txt
@@ -1,32 +1,26 @@
-# Generated from codeeditor.pro.
-
cmake_minimum_required(VERSION 3.16)
project(codeeditor LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/widgets/codeeditor")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(codeeditor
codeeditor.cpp codeeditor.h
main.cpp
)
+
set_target_properties(codeeditor PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(codeeditor PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/widgets/digitalclock/CMakeLists.txt b/examples/widgets/widgets/digitalclock/CMakeLists.txt
index 8a71a18b9e..53ca7d6b0a 100644
--- a/examples/widgets/widgets/digitalclock/CMakeLists.txt
+++ b/examples/widgets/widgets/digitalclock/CMakeLists.txt
@@ -1,32 +1,26 @@
-# Generated from digitalclock.pro.
-
cmake_minimum_required(VERSION 3.16)
project(digitalclock LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/widgets/digitalclock")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(digitalclock
digitalclock.cpp digitalclock.h
main.cpp
)
+
set_target_properties(digitalclock PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(digitalclock PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/widgets/elidedlabel/CMakeLists.txt b/examples/widgets/widgets/elidedlabel/CMakeLists.txt
index cca1e68c88..b2c3642879 100644
--- a/examples/widgets/widgets/elidedlabel/CMakeLists.txt
+++ b/examples/widgets/widgets/elidedlabel/CMakeLists.txt
@@ -1,33 +1,27 @@
-# Generated from elidedlabel.pro.
-
cmake_minimum_required(VERSION 3.16)
project(elidedlabel LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/widgets/elidedlabel")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(elidedlabel
elidedlabel.cpp elidedlabel.h
main.cpp
testwidget.cpp testwidget.h
)
+
set_target_properties(elidedlabel PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(elidedlabel PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/widgets/groupbox/CMakeLists.txt b/examples/widgets/widgets/groupbox/CMakeLists.txt
index 48d9395b67..99dd3e4b06 100644
--- a/examples/widgets/widgets/groupbox/CMakeLists.txt
+++ b/examples/widgets/widgets/groupbox/CMakeLists.txt
@@ -1,32 +1,26 @@
-# Generated from groupbox.pro.
-
cmake_minimum_required(VERSION 3.16)
project(groupbox LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/widgets/groupbox")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(groupbox
main.cpp
window.cpp window.h
)
+
set_target_properties(groupbox PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(groupbox PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/widgets/icons/.prev_CMakeLists.txt b/examples/widgets/widgets/icons/.prev_CMakeLists.txt
deleted file mode 100644
index ff25b3eaef..0000000000
--- a/examples/widgets/widgets/icons/.prev_CMakeLists.txt
+++ /dev/null
@@ -1,47 +0,0 @@
-# Generated from icons.pro.
-
-cmake_minimum_required(VERSION 3.14)
-project(icons LANGUAGES CXX)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
-
-if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
-endif()
-
-set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/widgets/icons")
-
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
-
-qt_add_executable(icons
- iconpreviewarea.cpp iconpreviewarea.h
- iconsizespinbox.cpp iconsizespinbox.h
- imagedelegate.cpp imagedelegate.h
- main.cpp
- mainwindow.cpp mainwindow.h
-)
-set_target_properties(icons PROPERTIES
- WIN32_EXECUTABLE TRUE
- MACOSX_BUNDLE TRUE
-)
-target_compile_definitions(icons PUBLIC
- SRCDIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/\\\"
-)
-
-target_link_libraries(icons PUBLIC
- Qt::Core
- Qt::Gui
- Qt::Widgets
-)
-
-install(TARGETS icons
- RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
- BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
- LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
-)
diff --git a/examples/widgets/widgets/icons/CMakeLists.txt b/examples/widgets/widgets/icons/CMakeLists.txt
index 9edba2b6c7..d6facb8d71 100644
--- a/examples/widgets/widgets/icons/CMakeLists.txt
+++ b/examples/widgets/widgets/icons/CMakeLists.txt
@@ -1,23 +1,15 @@
-# Generated from icons.pro.
-
cmake_minimum_required(VERSION 3.16)
project(icons LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/widgets/icons")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(icons
iconpreviewarea.cpp iconpreviewarea.h
@@ -26,12 +18,14 @@ qt_add_executable(icons
main.cpp
mainwindow.cpp mainwindow.h
)
+
set_target_properties(icons PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_compile_definitions(icons PUBLIC
- SRCDIR="${CMAKE_CURRENT_SOURCE_DIR}" # special case
+ SRCDIR="${CMAKE_CURRENT_SOURCE_DIR}"
)
target_link_libraries(icons PUBLIC
diff --git a/examples/widgets/widgets/imageviewer/.prev_CMakeLists.txt b/examples/widgets/widgets/imageviewer/.prev_CMakeLists.txt
deleted file mode 100644
index 9603f8dcbd..0000000000
--- a/examples/widgets/widgets/imageviewer/.prev_CMakeLists.txt
+++ /dev/null
@@ -1,46 +0,0 @@
-# Generated from imageviewer.pro.
-
-cmake_minimum_required(VERSION 3.14)
-project(imageviewer LANGUAGES CXX)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
-
-if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
-endif()
-
-set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/widgets/imageviewer")
-
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
-
-qt_add_executable(imageviewer
- imageviewer.cpp imageviewer.h
- main.cpp
-)
-set_target_properties(imageviewer PROPERTIES
- WIN32_EXECUTABLE TRUE
- MACOSX_BUNDLE TRUE
-)
-target_link_libraries(imageviewer PUBLIC
- Qt::Core
- Qt::Gui
- Qt::Widgets
-)
-
-if(TARGET Qt::PrintSupport)
- target_link_libraries(imageviewer PUBLIC
- Qt::PrintSupport
- )
-endif()
-
-install(TARGETS imageviewer
- RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
- BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
- LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
-)
diff --git a/examples/widgets/widgets/imageviewer/CMakeLists.txt b/examples/widgets/widgets/imageviewer/CMakeLists.txt
index bc3877f506..7f415f2d43 100644
--- a/examples/widgets/widgets/imageviewer/CMakeLists.txt
+++ b/examples/widgets/widgets/imageviewer/CMakeLists.txt
@@ -1,43 +1,38 @@
-# Generated from imageviewer.pro.
-
cmake_minimum_required(VERSION 3.16)
project(imageviewer LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/widgets/imageviewer")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
-find_package(Qt6 COMPONENTS PrintSupport) # special case
+find_package(Qt6
+ REQUIRED COMPONENTS Core Gui Widgets
+ OPTIONAL_COMPONENTS PrintSupport
+)
qt_add_executable(imageviewer
imageviewer.cpp imageviewer.h
main.cpp
)
+
set_target_properties(imageviewer PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(imageviewer PUBLIC
Qt::Core
Qt::Gui
Qt::Widgets
)
-# special case begin
+
if (TARGET Qt::PrintSupport)
target_link_libraries(imageviewer PUBLIC Qt::PrintSupport)
endif()
-# special case end
if(TARGET Qt::PrintSupport)
target_link_libraries(imageviewer PUBLIC
diff --git a/examples/widgets/widgets/lineedits/CMakeLists.txt b/examples/widgets/widgets/lineedits/CMakeLists.txt
index 4831f106a2..e991cc25d8 100644
--- a/examples/widgets/widgets/lineedits/CMakeLists.txt
+++ b/examples/widgets/widgets/lineedits/CMakeLists.txt
@@ -1,32 +1,26 @@
-# Generated from lineedits.pro.
-
cmake_minimum_required(VERSION 3.16)
project(lineedits LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/widgets/lineedits")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(lineedits
main.cpp
window.cpp window.h
)
+
set_target_properties(lineedits PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(lineedits PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/widgets/mousebuttons/CMakeLists.txt b/examples/widgets/widgets/mousebuttons/CMakeLists.txt
index d12c2be7a1..d3e704caf6 100644
--- a/examples/widgets/widgets/mousebuttons/CMakeLists.txt
+++ b/examples/widgets/widgets/mousebuttons/CMakeLists.txt
@@ -1,32 +1,26 @@
-# Generated from mousebuttons.pro.
-
cmake_minimum_required(VERSION 3.16)
project(mousebuttons LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/widgets/mousebuttons")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(mousebuttons
buttontester.cpp buttontester.h
main.cpp
)
+
set_target_properties(mousebuttons PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(mousebuttons PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/widgets/movie/CMakeLists.txt b/examples/widgets/widgets/movie/CMakeLists.txt
index 9acc336a82..2496c95e49 100644
--- a/examples/widgets/widgets/movie/CMakeLists.txt
+++ b/examples/widgets/widgets/movie/CMakeLists.txt
@@ -1,32 +1,26 @@
-# Generated from movie.pro.
-
cmake_minimum_required(VERSION 3.16)
project(movie LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/widgets/movie")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(movie
main.cpp
movieplayer.cpp movieplayer.h
)
+
set_target_properties(movie PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(movie PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/widgets/scribble/.prev_CMakeLists.txt b/examples/widgets/widgets/scribble/.prev_CMakeLists.txt
deleted file mode 100644
index 2ce40dc8cb..0000000000
--- a/examples/widgets/widgets/scribble/.prev_CMakeLists.txt
+++ /dev/null
@@ -1,47 +0,0 @@
-# Generated from scribble.pro.
-
-cmake_minimum_required(VERSION 3.14)
-project(scribble LANGUAGES CXX)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
-
-if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
-endif()
-
-set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/widgets/scribble")
-
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
-
-qt_add_executable(scribble
- main.cpp
- mainwindow.cpp mainwindow.h
- scribblearea.cpp scribblearea.h
-)
-set_target_properties(scribble PROPERTIES
- WIN32_EXECUTABLE TRUE
- MACOSX_BUNDLE TRUE
-)
-target_link_libraries(scribble PUBLIC
- Qt::Core
- Qt::Gui
- Qt::Widgets
-)
-
-if(TARGET Qt::PrintSupport)
- target_link_libraries(scribble PUBLIC
- Qt::PrintSupport
- )
-endif()
-
-install(TARGETS scribble
- RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
- BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
- LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
-)
diff --git a/examples/widgets/widgets/scribble/CMakeLists.txt b/examples/widgets/widgets/scribble/CMakeLists.txt
index b70e7063ec..c7238f06ea 100644
--- a/examples/widgets/widgets/scribble/CMakeLists.txt
+++ b/examples/widgets/widgets/scribble/CMakeLists.txt
@@ -1,44 +1,39 @@
-# Generated from scribble.pro.
-
cmake_minimum_required(VERSION 3.16)
project(scribble LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/widgets/scribble")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
-find_package(Qt6 COMPONENTS PrintSupport) # special case
+find_package(Qt6
+ REQUIRED COMPONENTS Core Gui Widgets
+ OPTIONAL_COMPONENTS PrintSupport
+)
qt_add_executable(scribble
main.cpp
mainwindow.cpp mainwindow.h
scribblearea.cpp scribblearea.h
)
+
set_target_properties(scribble PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(scribble PUBLIC
Qt::Core
Qt::Gui
Qt::Widgets
)
-# special case begin
+
if (TARGET Qt::PrintSupport)
target_link_libraries(scribble PUBLIC Qt::PrintSupport)
endif()
-# special case end
if(TARGET Qt::PrintSupport)
target_link_libraries(scribble PUBLIC
diff --git a/examples/widgets/widgets/shapedclock/CMakeLists.txt b/examples/widgets/widgets/shapedclock/CMakeLists.txt
index 4741642db6..ac2446b8fb 100644
--- a/examples/widgets/widgets/shapedclock/CMakeLists.txt
+++ b/examples/widgets/widgets/shapedclock/CMakeLists.txt
@@ -1,32 +1,26 @@
-# Generated from shapedclock.pro.
-
cmake_minimum_required(VERSION 3.16)
project(shapedclock LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/widgets/shapedclock")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(shapedclock
main.cpp
shapedclock.cpp shapedclock.h
)
+
set_target_properties(shapedclock PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(shapedclock PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/widgets/sliders/CMakeLists.txt b/examples/widgets/widgets/sliders/CMakeLists.txt
index 59b0de9c44..6827664deb 100644
--- a/examples/widgets/widgets/sliders/CMakeLists.txt
+++ b/examples/widgets/widgets/sliders/CMakeLists.txt
@@ -1,33 +1,27 @@
-# Generated from sliders.pro.
-
cmake_minimum_required(VERSION 3.16)
project(sliders LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/widgets/sliders")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(sliders
main.cpp
slidersgroup.cpp slidersgroup.h
window.cpp window.h
)
+
set_target_properties(sliders PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(sliders PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/widgets/spinboxes/CMakeLists.txt b/examples/widgets/widgets/spinboxes/CMakeLists.txt
index 3c7215f573..84ee93bb43 100644
--- a/examples/widgets/widgets/spinboxes/CMakeLists.txt
+++ b/examples/widgets/widgets/spinboxes/CMakeLists.txt
@@ -1,32 +1,26 @@
-# Generated from spinboxes.pro.
-
cmake_minimum_required(VERSION 3.16)
project(spinboxes LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/widgets/spinboxes")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(spinboxes
main.cpp
window.cpp window.h
)
+
set_target_properties(spinboxes PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(spinboxes PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/widgets/styles/CMakeLists.txt b/examples/widgets/widgets/styles/CMakeLists.txt
index 082104fc08..6fc70f2c63 100644
--- a/examples/widgets/widgets/styles/CMakeLists.txt
+++ b/examples/widgets/widgets/styles/CMakeLists.txt
@@ -1,47 +1,40 @@
-# Generated from styles.pro.
-
cmake_minimum_required(VERSION 3.16)
project(styles LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/widgets/styles")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(styles
main.cpp
norwegianwoodstyle.cpp norwegianwoodstyle.h
widgetgallery.cpp widgetgallery.h
)
+
set_target_properties(styles PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(styles PUBLIC
Qt::Core
Qt::Gui
Qt::Widgets
)
-
# Resources:
set(styles_resource_files
"images/woodbackground.png"
"images/woodbutton.png"
)
-qt6_add_resources(styles "styles"
+qt_add_resources(styles "styles"
PREFIX
"/"
FILES
diff --git a/examples/widgets/widgets/stylesheet/CMakeLists.txt b/examples/widgets/widgets/stylesheet/CMakeLists.txt
index c88c7a8c8c..9c21f9fdef 100644
--- a/examples/widgets/widgets/stylesheet/CMakeLists.txt
+++ b/examples/widgets/widgets/stylesheet/CMakeLists.txt
@@ -1,40 +1,34 @@
-# Generated from stylesheet.pro.
-
cmake_minimum_required(VERSION 3.16)
project(stylesheet LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/widgets/stylesheet")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(stylesheet
main.cpp
mainwindow.cpp mainwindow.h mainwindow.ui
stylesheeteditor.cpp stylesheeteditor.h stylesheeteditor.ui
)
+
set_target_properties(stylesheet PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(stylesheet PUBLIC
Qt::Core
Qt::Gui
Qt::Widgets
)
-
# Resources:
set(stylesheet_resource_files
"images/checkbox_checked.png"
@@ -74,7 +68,7 @@ set(stylesheet_resource_files
"qss/pagefold.qss"
)
-qt6_add_resources(stylesheet "stylesheet"
+qt_add_resources(stylesheet "stylesheet"
PREFIX
"/"
FILES
diff --git a/examples/widgets/widgets/tablet/CMakeLists.txt b/examples/widgets/widgets/tablet/CMakeLists.txt
index 04701f98d6..7011bab7e1 100644
--- a/examples/widgets/widgets/tablet/CMakeLists.txt
+++ b/examples/widgets/widgets/tablet/CMakeLists.txt
@@ -1,23 +1,15 @@
-# Generated from tablet.pro.
-
cmake_minimum_required(VERSION 3.16)
project(qttablet LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/widgets/tablet")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(qttablet
main.cpp
@@ -25,17 +17,18 @@ qt_add_executable(qttablet
tabletapplication.cpp tabletapplication.h
tabletcanvas.cpp tabletcanvas.h
)
+
set_target_properties(qttablet PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(qttablet PUBLIC
Qt::Core
Qt::Gui
Qt::Widgets
)
-
# Resources:
set(images_resource_files
"images/cursor-airbrush.png"
@@ -44,7 +37,7 @@ set(images_resource_files
"images/cursor-pencil.png"
)
-qt6_add_resources(qttablet "images"
+qt_add_resources(qttablet "images"
PREFIX
"/"
FILES
diff --git a/examples/widgets/widgets/tetrix/CMakeLists.txt b/examples/widgets/widgets/tetrix/CMakeLists.txt
index 85ec447334..f4bbbbf899 100644
--- a/examples/widgets/widgets/tetrix/CMakeLists.txt
+++ b/examples/widgets/widgets/tetrix/CMakeLists.txt
@@ -1,23 +1,15 @@
-# Generated from tetrix.pro.
-
cmake_minimum_required(VERSION 3.16)
project(tetrix LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/widgets/tetrix")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(tetrix
main.cpp
@@ -25,10 +17,12 @@ qt_add_executable(tetrix
tetrixpiece.cpp tetrixpiece.h
tetrixwindow.cpp tetrixwindow.h
)
+
set_target_properties(tetrix PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(tetrix PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/widgets/tooltips/CMakeLists.txt b/examples/widgets/widgets/tooltips/CMakeLists.txt
index f6885559f0..e0bd7e71fc 100644
--- a/examples/widgets/widgets/tooltips/CMakeLists.txt
+++ b/examples/widgets/widgets/tooltips/CMakeLists.txt
@@ -1,40 +1,33 @@
-# Generated from tooltips.pro.
-
cmake_minimum_required(VERSION 3.16)
project(tooltips LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/widgets/tooltips")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(tooltips
main.cpp
shapeitem.cpp shapeitem.h
sortingbox.cpp sortingbox.h
)
+
set_target_properties(tooltips PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(tooltips PUBLIC
Qt::Core
Qt::Gui
Qt::Widgets
)
-
# Resources:
set(tooltips_resource_files
"images/circle.png"
@@ -42,7 +35,7 @@ set(tooltips_resource_files
"images/triangle.png"
)
-qt6_add_resources(tooltips "tooltips"
+qt_add_resources(tooltips "tooltips"
PREFIX
"/"
FILES
diff --git a/examples/widgets/widgets/validators/CMakeLists.txt b/examples/widgets/widgets/validators/CMakeLists.txt
index 77ca8a4789..d78ff37c76 100644
--- a/examples/widgets/widgets/validators/CMakeLists.txt
+++ b/examples/widgets/widgets/validators/CMakeLists.txt
@@ -1,23 +1,18 @@
-# Generated from validators.pro.
-
cmake_minimum_required(VERSION 3.16)
project(validators LANGUAGES CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/widgets/validators")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(validators
ledwidget.cpp ledwidget.h
@@ -26,24 +21,25 @@ qt_add_executable(validators
validators.ui
validatorwidget.cpp validatorwidget.h
)
+
set_target_properties(validators PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(validators PUBLIC
Qt::Core
Qt::Gui
Qt::Widgets
)
-
# Resources:
set(validators_resource_files
"ledoff.png"
"ledon.png"
)
-qt6_add_resources(validators "validators"
+qt_add_resources(validators "validators"
PREFIX
"/"
FILES
diff --git a/examples/widgets/widgets/wiggly/CMakeLists.txt b/examples/widgets/widgets/wiggly/CMakeLists.txt
index 0013dae924..6cedce495a 100644
--- a/examples/widgets/widgets/wiggly/CMakeLists.txt
+++ b/examples/widgets/widgets/wiggly/CMakeLists.txt
@@ -1,33 +1,27 @@
-# Generated from wiggly.pro.
-
cmake_minimum_required(VERSION 3.16)
project(wiggly LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/widgets/wiggly")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(wiggly
dialog.cpp dialog.h
main.cpp
wigglywidget.cpp wigglywidget.h
)
+
set_target_properties(wiggly PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(wiggly PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/widgets/windowflags/CMakeLists.txt b/examples/widgets/widgets/windowflags/CMakeLists.txt
index 5eb9503cd9..e48608eee2 100644
--- a/examples/widgets/widgets/windowflags/CMakeLists.txt
+++ b/examples/widgets/widgets/windowflags/CMakeLists.txt
@@ -1,33 +1,27 @@
-# Generated from windowflags.pro.
-
cmake_minimum_required(VERSION 3.16)
project(windowflags LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/widgets/windowflags")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
qt_add_executable(windowflags
controllerwindow.cpp controllerwindow.h
main.cpp
previewwindow.cpp previewwindow.h
)
+
set_target_properties(windowflags PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_link_libraries(windowflags PUBLIC
Qt::Core
Qt::Gui
diff --git a/examples/widgets/windowcontainer/CMakeLists.txt b/examples/widgets/windowcontainer/CMakeLists.txt
index 9b85cadd72..2f6a93017a 100644
--- a/examples/widgets/windowcontainer/CMakeLists.txt
+++ b/examples/widgets/windowcontainer/CMakeLists.txt
@@ -1,33 +1,26 @@
-# Generated from windowcontainer.pro.
-
cmake_minimum_required(VERSION 3.16)
project(windowcontainer LANGUAGES CXX)
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-set(CMAKE_AUTOUIC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
+ set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/windowcontainer")
-find_package(Qt6 COMPONENTS Core)
-find_package(Qt6 COMPONENTS Gui)
-find_package(Qt6 COMPONENTS Widgets)
-find_package(Qt6 COMPONENTS OpenGL)
+find_package(Qt6 REQUIRED COMPONENTS Core Gui OpenGL Widgets)
qt_add_executable(windowcontainer
../../opengl/openglwindow/openglwindow.cpp ../../opengl/openglwindow/openglwindow.h
windowcontainer.cpp
)
+
set_target_properties(windowcontainer PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
+
target_include_directories(windowcontainer PUBLIC
../../opengl/openglwindow
)