summaryrefslogtreecommitdiffstats
path: root/examples/widgets/itemviews
diff options
context:
space:
mode:
Diffstat (limited to 'examples/widgets/itemviews')
-rw-r--r--examples/widgets/itemviews/CMakeLists.txt2
-rw-r--r--examples/widgets/itemviews/addressbook/CMakeLists.txt10
-rw-r--r--examples/widgets/itemviews/addressbook/addresswidget.cpp2
-rw-r--r--examples/widgets/itemviews/basicsortfiltermodel/CMakeLists.txt10
-rw-r--r--examples/widgets/itemviews/chart/CMakeLists.txt10
-rw-r--r--examples/widgets/itemviews/coloreditorfactory/CMakeLists.txt10
-rw-r--r--examples/widgets/itemviews/combowidgetmapper/CMakeLists.txt10
-rw-r--r--examples/widgets/itemviews/customsortfiltermodel/CMakeLists.txt10
-rw-r--r--examples/widgets/itemviews/dirview/CMakeLists.txt10
-rw-r--r--examples/widgets/itemviews/editabletreemodel/CMakeLists.txt11
-rw-r--r--examples/widgets/itemviews/editabletreemodel/treeitem.cpp4
-rw-r--r--examples/widgets/itemviews/fetchmore/CMakeLists.txt10
-rw-r--r--examples/widgets/itemviews/flattreeview/CMakeLists.txt10
-rw-r--r--examples/widgets/itemviews/frozencolumn/CMakeLists.txt10
-rw-r--r--examples/widgets/itemviews/interview/CMakeLists.txt10
-rw-r--r--examples/widgets/itemviews/pixelator/CMakeLists.txt14
-rw-r--r--examples/widgets/itemviews/puzzle/CMakeLists.txt10
-rw-r--r--examples/widgets/itemviews/simpledommodel/CMakeLists.txt12
-rw-r--r--examples/widgets/itemviews/simpletreemodel/CMakeLists.txt10
-rw-r--r--examples/widgets/itemviews/simplewidgetmapper/CMakeLists.txt10
-rw-r--r--examples/widgets/itemviews/spinboxdelegate/CMakeLists.txt10
-rw-r--r--examples/widgets/itemviews/spreadsheet/CMakeLists.txt18
-rw-r--r--examples/widgets/itemviews/stardelegate/CMakeLists.txt10
-rw-r--r--examples/widgets/itemviews/storageview/CMakeLists.txt10
24 files changed, 116 insertions, 117 deletions
diff --git a/examples/widgets/itemviews/CMakeLists.txt b/examples/widgets/itemviews/CMakeLists.txt
index 04b50251e5..96af14b567 100644
--- a/examples/widgets/itemviews/CMakeLists.txt
+++ b/examples/widgets/itemviews/CMakeLists.txt
@@ -23,6 +23,6 @@ qt_internal_add_example(storageview)
if(QT_FEATURE_draganddrop)
qt_internal_add_example(puzzle)
endif()
-if(TARGET Qt::Xml)
+if(TARGET Qt6::Xml)
qt_internal_add_example(simpledommodel)
endif()
diff --git a/examples/widgets/itemviews/addressbook/CMakeLists.txt b/examples/widgets/itemviews/addressbook/CMakeLists.txt
index 3667570531..00e48aba1b 100644
--- a/examples/widgets/itemviews/addressbook/CMakeLists.txt
+++ b/examples/widgets/itemviews/addressbook/CMakeLists.txt
@@ -4,8 +4,6 @@
cmake_minimum_required(VERSION 3.16)
project(addressbook LANGUAGES CXX)
-set(CMAKE_AUTOMOC ON)
-
if(NOT DEFINED INSTALL_EXAMPLESDIR)
set(INSTALL_EXAMPLESDIR "examples")
endif()
@@ -14,6 +12,8 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/itemviews/addressbook")
find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
+qt_standard_project_setup()
+
qt_add_executable(addressbook
adddialog.cpp adddialog.h
addresswidget.cpp addresswidget.h
@@ -29,9 +29,9 @@ set_target_properties(addressbook PROPERTIES
)
target_link_libraries(addressbook PUBLIC
- Qt::Core
- Qt::Gui
- Qt::Widgets
+ Qt6::Core
+ Qt6::Gui
+ Qt6::Widgets
)
install(TARGETS addressbook
diff --git a/examples/widgets/itemviews/addressbook/addresswidget.cpp b/examples/widgets/itemviews/addressbook/addresswidget.cpp
index 955a766750..6be8867a94 100644
--- a/examples/widgets/itemviews/addressbook/addresswidget.cpp
+++ b/examples/widgets/itemviews/addressbook/addresswidget.cpp
@@ -164,7 +164,7 @@ void AddressWidget::readFromFile(const QString &fileName)
QMessageBox::information(this, tr("No contacts in file"),
tr("The file you are attempting to open contains no contacts."));
} else {
- for (const auto &contact: qAsConst(contacts))
+ for (const auto &contact: std::as_const(contacts))
addEntry(contact.name, contact.address);
}
}
diff --git a/examples/widgets/itemviews/basicsortfiltermodel/CMakeLists.txt b/examples/widgets/itemviews/basicsortfiltermodel/CMakeLists.txt
index de80b7b471..ffc3717435 100644
--- a/examples/widgets/itemviews/basicsortfiltermodel/CMakeLists.txt
+++ b/examples/widgets/itemviews/basicsortfiltermodel/CMakeLists.txt
@@ -4,8 +4,6 @@
cmake_minimum_required(VERSION 3.16)
project(basicsortfiltermodel LANGUAGES CXX)
-set(CMAKE_AUTOMOC ON)
-
if(NOT DEFINED INSTALL_EXAMPLESDIR)
set(INSTALL_EXAMPLESDIR "examples")
endif()
@@ -14,6 +12,8 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/itemviews/basicsortfilter
find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
+qt_standard_project_setup()
+
qt_add_executable(basicsortfiltermodel
main.cpp
window.cpp window.h
@@ -25,9 +25,9 @@ set_target_properties(basicsortfiltermodel PROPERTIES
)
target_link_libraries(basicsortfiltermodel PUBLIC
- Qt::Core
- Qt::Gui
- Qt::Widgets
+ Qt6::Core
+ Qt6::Gui
+ Qt6::Widgets
)
install(TARGETS basicsortfiltermodel
diff --git a/examples/widgets/itemviews/chart/CMakeLists.txt b/examples/widgets/itemviews/chart/CMakeLists.txt
index c52929b696..0c639c5b15 100644
--- a/examples/widgets/itemviews/chart/CMakeLists.txt
+++ b/examples/widgets/itemviews/chart/CMakeLists.txt
@@ -4,8 +4,6 @@
cmake_minimum_required(VERSION 3.16)
project(chart LANGUAGES CXX)
-set(CMAKE_AUTOMOC ON)
-
if(NOT DEFINED INSTALL_EXAMPLESDIR)
set(INSTALL_EXAMPLESDIR "examples")
endif()
@@ -14,6 +12,8 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/itemviews/chart")
find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
+qt_standard_project_setup()
+
qt_add_executable(chart
main.cpp
mainwindow.cpp mainwindow.h
@@ -26,9 +26,9 @@ set_target_properties(chart PROPERTIES
)
target_link_libraries(chart PUBLIC
- Qt::Core
- Qt::Gui
- Qt::Widgets
+ Qt6::Core
+ Qt6::Gui
+ Qt6::Widgets
)
# Resources:
diff --git a/examples/widgets/itemviews/coloreditorfactory/CMakeLists.txt b/examples/widgets/itemviews/coloreditorfactory/CMakeLists.txt
index 6df6bc51fb..93ed47b958 100644
--- a/examples/widgets/itemviews/coloreditorfactory/CMakeLists.txt
+++ b/examples/widgets/itemviews/coloreditorfactory/CMakeLists.txt
@@ -4,8 +4,6 @@
cmake_minimum_required(VERSION 3.16)
project(coloreditorfactory LANGUAGES CXX)
-set(CMAKE_AUTOMOC ON)
-
if(NOT DEFINED INSTALL_EXAMPLESDIR)
set(INSTALL_EXAMPLESDIR "examples")
endif()
@@ -14,6 +12,8 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/itemviews/coloreditorfact
find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
+qt_standard_project_setup()
+
qt_add_executable(coloreditorfactory
colorlisteditor.cpp colorlisteditor.h
main.cpp
@@ -26,9 +26,9 @@ set_target_properties(coloreditorfactory PROPERTIES
)
target_link_libraries(coloreditorfactory PUBLIC
- Qt::Core
- Qt::Gui
- Qt::Widgets
+ Qt6::Core
+ Qt6::Gui
+ Qt6::Widgets
)
install(TARGETS coloreditorfactory
diff --git a/examples/widgets/itemviews/combowidgetmapper/CMakeLists.txt b/examples/widgets/itemviews/combowidgetmapper/CMakeLists.txt
index a6c352d568..83aa298ec1 100644
--- a/examples/widgets/itemviews/combowidgetmapper/CMakeLists.txt
+++ b/examples/widgets/itemviews/combowidgetmapper/CMakeLists.txt
@@ -4,8 +4,6 @@
cmake_minimum_required(VERSION 3.16)
project(combowidgetmapper LANGUAGES CXX)
-set(CMAKE_AUTOMOC ON)
-
if(NOT DEFINED INSTALL_EXAMPLESDIR)
set(INSTALL_EXAMPLESDIR "examples")
endif()
@@ -14,6 +12,8 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/itemviews/combowidgetmapp
find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
+qt_standard_project_setup()
+
qt_add_executable(combowidgetmapper
main.cpp
window.cpp window.h
@@ -25,9 +25,9 @@ set_target_properties(combowidgetmapper PROPERTIES
)
target_link_libraries(combowidgetmapper PUBLIC
- Qt::Core
- Qt::Gui
- Qt::Widgets
+ Qt6::Core
+ Qt6::Gui
+ Qt6::Widgets
)
install(TARGETS combowidgetmapper
diff --git a/examples/widgets/itemviews/customsortfiltermodel/CMakeLists.txt b/examples/widgets/itemviews/customsortfiltermodel/CMakeLists.txt
index f9aa2a1bbf..00643f1608 100644
--- a/examples/widgets/itemviews/customsortfiltermodel/CMakeLists.txt
+++ b/examples/widgets/itemviews/customsortfiltermodel/CMakeLists.txt
@@ -4,8 +4,6 @@
cmake_minimum_required(VERSION 3.16)
project(customsortfiltermodel LANGUAGES CXX)
-set(CMAKE_AUTOMOC ON)
-
if(NOT DEFINED INSTALL_EXAMPLESDIR)
set(INSTALL_EXAMPLESDIR "examples")
endif()
@@ -14,6 +12,8 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/itemviews/customsortfilte
find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
+qt_standard_project_setup()
+
qt_add_executable(customsortfiltermodel
filterwidget.cpp filterwidget.h
main.cpp
@@ -27,9 +27,9 @@ set_target_properties(customsortfiltermodel PROPERTIES
)
target_link_libraries(customsortfiltermodel PUBLIC
- Qt::Core
- Qt::Gui
- Qt::Widgets
+ Qt6::Core
+ Qt6::Gui
+ Qt6::Widgets
)
# Resources:
diff --git a/examples/widgets/itemviews/dirview/CMakeLists.txt b/examples/widgets/itemviews/dirview/CMakeLists.txt
index 9754bff9a4..6719b2e03d 100644
--- a/examples/widgets/itemviews/dirview/CMakeLists.txt
+++ b/examples/widgets/itemviews/dirview/CMakeLists.txt
@@ -4,8 +4,6 @@
cmake_minimum_required(VERSION 3.16)
project(dirview LANGUAGES CXX)
-set(CMAKE_AUTOMOC ON)
-
if(NOT DEFINED INSTALL_EXAMPLESDIR)
set(INSTALL_EXAMPLESDIR "examples")
endif()
@@ -14,6 +12,8 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/itemviews/dirview")
find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
+qt_standard_project_setup()
+
qt_add_executable(dirview
main.cpp
)
@@ -24,9 +24,9 @@ set_target_properties(dirview PROPERTIES
)
target_link_libraries(dirview PUBLIC
- Qt::Core
- Qt::Gui
- Qt::Widgets
+ Qt6::Core
+ Qt6::Gui
+ Qt6::Widgets
)
install(TARGETS dirview
diff --git a/examples/widgets/itemviews/editabletreemodel/CMakeLists.txt b/examples/widgets/itemviews/editabletreemodel/CMakeLists.txt
index 8d372dbe73..f94ee6e681 100644
--- a/examples/widgets/itemviews/editabletreemodel/CMakeLists.txt
+++ b/examples/widgets/itemviews/editabletreemodel/CMakeLists.txt
@@ -4,9 +4,6 @@
cmake_minimum_required(VERSION 3.16)
project(editabletreemodel LANGUAGES CXX)
-set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTOUIC ON)
-
if(NOT DEFINED INSTALL_EXAMPLESDIR)
set(INSTALL_EXAMPLESDIR "examples")
endif()
@@ -15,6 +12,8 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/itemviews/editabletreemod
find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
+qt_standard_project_setup()
+
qt_add_executable(editabletreemodel
main.cpp
mainwindow.cpp mainwindow.h mainwindow.ui
@@ -28,9 +27,9 @@ set_target_properties(editabletreemodel PROPERTIES
)
target_link_libraries(editabletreemodel PUBLIC
- Qt::Core
- Qt::Gui
- Qt::Widgets
+ Qt6::Core
+ Qt6::Gui
+ Qt6::Widgets
)
# Resources:
diff --git a/examples/widgets/itemviews/editabletreemodel/treeitem.cpp b/examples/widgets/itemviews/editabletreemodel/treeitem.cpp
index 5784202b93..942ba277a3 100644
--- a/examples/widgets/itemviews/editabletreemodel/treeitem.cpp
+++ b/examples/widgets/itemviews/editabletreemodel/treeitem.cpp
@@ -88,7 +88,7 @@ bool TreeItem::insertColumns(int position, int columns)
for (int column = 0; column < columns; ++column)
itemData.insert(position, QVariant());
- for (TreeItem *child : qAsConst(childItems))
+ for (TreeItem *child : std::as_const(childItems))
child->insertColumns(position, columns);
return true;
@@ -123,7 +123,7 @@ bool TreeItem::removeColumns(int position, int columns)
for (int column = 0; column < columns; ++column)
itemData.remove(position);
- for (TreeItem *child : qAsConst(childItems))
+ for (TreeItem *child : std::as_const(childItems))
child->removeColumns(position, columns);
return true;
diff --git a/examples/widgets/itemviews/fetchmore/CMakeLists.txt b/examples/widgets/itemviews/fetchmore/CMakeLists.txt
index 2abc71fc1e..d930c6b730 100644
--- a/examples/widgets/itemviews/fetchmore/CMakeLists.txt
+++ b/examples/widgets/itemviews/fetchmore/CMakeLists.txt
@@ -4,8 +4,6 @@
cmake_minimum_required(VERSION 3.16)
project(fetchmore LANGUAGES CXX)
-set(CMAKE_AUTOMOC ON)
-
if(NOT DEFINED INSTALL_EXAMPLESDIR)
set(INSTALL_EXAMPLESDIR "examples")
endif()
@@ -14,6 +12,8 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/itemviews/fetchmore")
find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
+qt_standard_project_setup()
+
qt_add_executable(fetchmore
filelistmodel.cpp filelistmodel.h
main.cpp
@@ -26,9 +26,9 @@ set_target_properties(fetchmore PROPERTIES
)
target_link_libraries(fetchmore PUBLIC
- Qt::Core
- Qt::Gui
- Qt::Widgets
+ Qt6::Core
+ Qt6::Gui
+ Qt6::Widgets
)
install(TARGETS fetchmore
diff --git a/examples/widgets/itemviews/flattreeview/CMakeLists.txt b/examples/widgets/itemviews/flattreeview/CMakeLists.txt
index 23ce2882d2..8191889790 100644
--- a/examples/widgets/itemviews/flattreeview/CMakeLists.txt
+++ b/examples/widgets/itemviews/flattreeview/CMakeLists.txt
@@ -4,8 +4,6 @@
cmake_minimum_required(VERSION 3.16)
project(flattreeview LANGUAGES CXX)
-set(CMAKE_AUTOMOC ON)
-
if(NOT DEFINED INSTALL_EXAMPLESDIR)
set(INSTALL_EXAMPLESDIR "examples")
endif()
@@ -14,6 +12,8 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/itemviews/flattreeview")
find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
+qt_standard_project_setup()
+
qt_add_executable(flattreeview
main.cpp
)
@@ -24,9 +24,9 @@ set_target_properties(flattreeview PROPERTIES
)
target_link_libraries(flattreeview PUBLIC
- Qt::Core
- Qt::Gui
- Qt::Widgets
+ Qt6::Core
+ Qt6::Gui
+ Qt6::Widgets
)
install(TARGETS flattreeview
diff --git a/examples/widgets/itemviews/frozencolumn/CMakeLists.txt b/examples/widgets/itemviews/frozencolumn/CMakeLists.txt
index 88b2de98e4..60dfc4cb86 100644
--- a/examples/widgets/itemviews/frozencolumn/CMakeLists.txt
+++ b/examples/widgets/itemviews/frozencolumn/CMakeLists.txt
@@ -4,8 +4,6 @@
cmake_minimum_required(VERSION 3.16)
project(frozencolumn LANGUAGES CXX)
-set(CMAKE_AUTOMOC ON)
-
if(NOT DEFINED INSTALL_EXAMPLESDIR)
set(INSTALL_EXAMPLESDIR "examples")
endif()
@@ -14,6 +12,8 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/itemviews/frozencolumn")
find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
+qt_standard_project_setup()
+
qt_add_executable(frozencolumn
freezetablewidget.cpp freezetablewidget.h
main.cpp
@@ -25,9 +25,9 @@ set_target_properties(frozencolumn PROPERTIES
)
target_link_libraries(frozencolumn PUBLIC
- Qt::Core
- Qt::Gui
- Qt::Widgets
+ Qt6::Core
+ Qt6::Gui
+ Qt6::Widgets
)
# Resources:
diff --git a/examples/widgets/itemviews/interview/CMakeLists.txt b/examples/widgets/itemviews/interview/CMakeLists.txt
index 0bff4991c8..2a9afc3aa5 100644
--- a/examples/widgets/itemviews/interview/CMakeLists.txt
+++ b/examples/widgets/itemviews/interview/CMakeLists.txt
@@ -4,8 +4,6 @@
cmake_minimum_required(VERSION 3.16)
project(interview LANGUAGES CXX)
-set(CMAKE_AUTOMOC ON)
-
if(NOT DEFINED INSTALL_EXAMPLESDIR)
set(INSTALL_EXAMPLESDIR "examples")
endif()
@@ -14,6 +12,8 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/itemviews/interview")
find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
+qt_standard_project_setup()
+
qt_add_executable(interview
main.cpp
model.cpp model.h
@@ -25,9 +25,9 @@ set_target_properties(interview PROPERTIES
)
target_link_libraries(interview PUBLIC
- Qt::Core
- Qt::Gui
- Qt::Widgets
+ Qt6::Core
+ Qt6::Gui
+ Qt6::Widgets
)
# Resources:
diff --git a/examples/widgets/itemviews/pixelator/CMakeLists.txt b/examples/widgets/itemviews/pixelator/CMakeLists.txt
index 6db3d92c93..52dd6b74e5 100644
--- a/examples/widgets/itemviews/pixelator/CMakeLists.txt
+++ b/examples/widgets/itemviews/pixelator/CMakeLists.txt
@@ -4,8 +4,6 @@
cmake_minimum_required(VERSION 3.16)
project(pixelator LANGUAGES CXX)
-set(CMAKE_AUTOMOC ON)
-
if(NOT DEFINED INSTALL_EXAMPLESDIR)
set(INSTALL_EXAMPLESDIR "examples")
endif()
@@ -17,6 +15,8 @@ find_package(Qt6
OPTIONAL_COMPONENTS PrintSupport
)
+qt_standard_project_setup()
+
qt_add_executable(pixelator
imagemodel.cpp imagemodel.h
main.cpp
@@ -30,9 +30,9 @@ set_target_properties(pixelator PROPERTIES
)
target_link_libraries(pixelator PUBLIC
- Qt::Core
- Qt::Gui
- Qt::Widgets
+ Qt6::Core
+ Qt6::Gui
+ Qt6::Widgets
)
# Resources:
@@ -47,9 +47,9 @@ qt_add_resources(pixelator "images"
${images_resource_files}
)
-if(TARGET Qt::PrintSupport)
+if(TARGET Qt6::PrintSupport)
target_link_libraries(pixelator PUBLIC
- Qt::PrintSupport
+ Qt6::PrintSupport
)
endif()
diff --git a/examples/widgets/itemviews/puzzle/CMakeLists.txt b/examples/widgets/itemviews/puzzle/CMakeLists.txt
index dc0b9d8322..7d341d3ce7 100644
--- a/examples/widgets/itemviews/puzzle/CMakeLists.txt
+++ b/examples/widgets/itemviews/puzzle/CMakeLists.txt
@@ -4,8 +4,6 @@
cmake_minimum_required(VERSION 3.16)
project(puzzle LANGUAGES CXX)
-set(CMAKE_AUTOMOC ON)
-
if(NOT DEFINED INSTALL_EXAMPLESDIR)
set(INSTALL_EXAMPLESDIR "examples")
endif()
@@ -14,6 +12,8 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/itemviews/puzzle")
find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
+qt_standard_project_setup()
+
qt_add_executable(itemviews_puzzle
main.cpp
mainwindow.cpp mainwindow.h
@@ -27,9 +27,9 @@ set_target_properties(itemviews_puzzle PROPERTIES
)
target_link_libraries(itemviews_puzzle PUBLIC
- Qt::Core
- Qt::Gui
- Qt::Widgets
+ Qt6::Core
+ Qt6::Gui
+ Qt6::Widgets
)
# Resources:
diff --git a/examples/widgets/itemviews/simpledommodel/CMakeLists.txt b/examples/widgets/itemviews/simpledommodel/CMakeLists.txt
index 1d63e36847..5c732870e8 100644
--- a/examples/widgets/itemviews/simpledommodel/CMakeLists.txt
+++ b/examples/widgets/itemviews/simpledommodel/CMakeLists.txt
@@ -4,8 +4,6 @@
cmake_minimum_required(VERSION 3.16)
project(simpledommodel LANGUAGES CXX)
-set(CMAKE_AUTOMOC ON)
-
if(NOT DEFINED INSTALL_EXAMPLESDIR)
set(INSTALL_EXAMPLESDIR "examples")
endif()
@@ -14,6 +12,8 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/itemviews/simpledommodel"
find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets Xml)
+qt_standard_project_setup()
+
qt_add_executable(simpledommodel
domitem.cpp domitem.h
dommodel.cpp dommodel.h
@@ -27,10 +27,10 @@ set_target_properties(simpledommodel PROPERTIES
)
target_link_libraries(simpledommodel PUBLIC
- Qt::Core
- Qt::Gui
- Qt::Widgets
- Qt::Xml
+ Qt6::Core
+ Qt6::Gui
+ Qt6::Widgets
+ Qt6::Xml
)
install(TARGETS simpledommodel
diff --git a/examples/widgets/itemviews/simpletreemodel/CMakeLists.txt b/examples/widgets/itemviews/simpletreemodel/CMakeLists.txt
index f2ea8ae785..c4c7a14199 100644
--- a/examples/widgets/itemviews/simpletreemodel/CMakeLists.txt
+++ b/examples/widgets/itemviews/simpletreemodel/CMakeLists.txt
@@ -4,8 +4,6 @@
cmake_minimum_required(VERSION 3.16)
project(simpletreemodel LANGUAGES CXX)
-set(CMAKE_AUTOMOC ON)
-
if(NOT DEFINED INSTALL_EXAMPLESDIR)
set(INSTALL_EXAMPLESDIR "examples")
endif()
@@ -14,6 +12,8 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/itemviews/simpletreemodel
find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
+qt_standard_project_setup()
+
qt_add_executable(simpletreemodel
main.cpp
treeitem.cpp treeitem.h
@@ -26,9 +26,9 @@ set_target_properties(simpletreemodel PROPERTIES
)
target_link_libraries(simpletreemodel PUBLIC
- Qt::Core
- Qt::Gui
- Qt::Widgets
+ Qt6::Core
+ Qt6::Gui
+ Qt6::Widgets
)
# Resources:
diff --git a/examples/widgets/itemviews/simplewidgetmapper/CMakeLists.txt b/examples/widgets/itemviews/simplewidgetmapper/CMakeLists.txt
index 1564d8d3a1..eb8d3ee480 100644
--- a/examples/widgets/itemviews/simplewidgetmapper/CMakeLists.txt
+++ b/examples/widgets/itemviews/simplewidgetmapper/CMakeLists.txt
@@ -4,8 +4,6 @@
cmake_minimum_required(VERSION 3.16)
project(simplewidgetmapper LANGUAGES CXX)
-set(CMAKE_AUTOMOC ON)
-
if(NOT DEFINED INSTALL_EXAMPLESDIR)
set(INSTALL_EXAMPLESDIR "examples")
endif()
@@ -14,6 +12,8 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/itemviews/simplewidgetmap
find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
+qt_standard_project_setup()
+
qt_add_executable(simplewidgetmapper
main.cpp
window.cpp window.h
@@ -25,9 +25,9 @@ set_target_properties(simplewidgetmapper PROPERTIES
)
target_link_libraries(simplewidgetmapper PUBLIC
- Qt::Core
- Qt::Gui
- Qt::Widgets
+ Qt6::Core
+ Qt6::Gui
+ Qt6::Widgets
)
install(TARGETS simplewidgetmapper
diff --git a/examples/widgets/itemviews/spinboxdelegate/CMakeLists.txt b/examples/widgets/itemviews/spinboxdelegate/CMakeLists.txt
index 0c64cb378a..f42feac10a 100644
--- a/examples/widgets/itemviews/spinboxdelegate/CMakeLists.txt
+++ b/examples/widgets/itemviews/spinboxdelegate/CMakeLists.txt
@@ -4,8 +4,6 @@
cmake_minimum_required(VERSION 3.16)
project(spinboxdelegate LANGUAGES CXX)
-set(CMAKE_AUTOMOC ON)
-
if(NOT DEFINED INSTALL_EXAMPLESDIR)
set(INSTALL_EXAMPLESDIR "examples")
endif()
@@ -14,6 +12,8 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/itemviews/spinboxdelegate
find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
+qt_standard_project_setup()
+
qt_add_executable(spinboxdelegate
delegate.cpp delegate.h
main.cpp
@@ -25,9 +25,9 @@ set_target_properties(spinboxdelegate PROPERTIES
)
target_link_libraries(spinboxdelegate PUBLIC
- Qt::Core
- Qt::Gui
- Qt::Widgets
+ Qt6::Core
+ Qt6::Gui
+ Qt6::Widgets
)
install(TARGETS spinboxdelegate
diff --git a/examples/widgets/itemviews/spreadsheet/CMakeLists.txt b/examples/widgets/itemviews/spreadsheet/CMakeLists.txt
index b931ba4bd0..1481533dca 100644
--- a/examples/widgets/itemviews/spreadsheet/CMakeLists.txt
+++ b/examples/widgets/itemviews/spreadsheet/CMakeLists.txt
@@ -4,8 +4,6 @@
cmake_minimum_required(VERSION 3.16)
project(spreadsheet LANGUAGES CXX)
-set(CMAKE_AUTOMOC ON)
-
if(NOT DEFINED INSTALL_EXAMPLESDIR)
set(INSTALL_EXAMPLESDIR "examples")
endif()
@@ -17,6 +15,8 @@ find_package(Qt6
OPTIONAL_COMPONENTS PrintSupport
)
+qt_standard_project_setup()
+
qt_add_executable(spreadsheet
main.cpp
printview.cpp printview.h
@@ -31,13 +31,13 @@ set_target_properties(spreadsheet PROPERTIES
)
target_link_libraries(spreadsheet PUBLIC
- Qt::Core
- Qt::Gui
- Qt::Widgets
+ Qt6::Core
+ Qt6::Gui
+ Qt6::Widgets
)
-if (TARGET Qt::PrintSupport)
- target_link_libraries(spreadsheet PUBLIC Qt::PrintSupport)
+if (TARGET Qt6::PrintSupport)
+ target_link_libraries(spreadsheet PUBLIC Qt6::PrintSupport)
endif()
# Resources:
@@ -52,9 +52,9 @@ qt_add_resources(spreadsheet "spreadsheet"
${spreadsheet_resource_files}
)
-if(TARGET Qt::PrintSupport)
+if(TARGET Qt6::PrintSupport)
target_link_libraries(spreadsheet PUBLIC
- Qt::PrintSupport
+ Qt6::PrintSupport
)
endif()
diff --git a/examples/widgets/itemviews/stardelegate/CMakeLists.txt b/examples/widgets/itemviews/stardelegate/CMakeLists.txt
index 265b0186d5..717ac29733 100644
--- a/examples/widgets/itemviews/stardelegate/CMakeLists.txt
+++ b/examples/widgets/itemviews/stardelegate/CMakeLists.txt
@@ -4,8 +4,6 @@
cmake_minimum_required(VERSION 3.16)
project(stardelegate LANGUAGES CXX)
-set(CMAKE_AUTOMOC ON)
-
if(NOT DEFINED INSTALL_EXAMPLESDIR)
set(INSTALL_EXAMPLESDIR "examples")
endif()
@@ -14,6 +12,8 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/itemviews/stardelegate")
find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
+qt_standard_project_setup()
+
qt_add_executable(stardelegate
main.cpp
stardelegate.cpp stardelegate.h
@@ -27,9 +27,9 @@ set_target_properties(stardelegate PROPERTIES
)
target_link_libraries(stardelegate PUBLIC
- Qt::Core
- Qt::Gui
- Qt::Widgets
+ Qt6::Core
+ Qt6::Gui
+ Qt6::Widgets
)
install(TARGETS stardelegate
diff --git a/examples/widgets/itemviews/storageview/CMakeLists.txt b/examples/widgets/itemviews/storageview/CMakeLists.txt
index b393b5b20f..6cf427e068 100644
--- a/examples/widgets/itemviews/storageview/CMakeLists.txt
+++ b/examples/widgets/itemviews/storageview/CMakeLists.txt
@@ -4,8 +4,6 @@
cmake_minimum_required(VERSION 3.16)
project(storageview LANGUAGES CXX)
-set(CMAKE_AUTOMOC ON)
-
if(NOT DEFINED INSTALL_EXAMPLESDIR)
set(INSTALL_EXAMPLESDIR "examples")
endif()
@@ -14,6 +12,8 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/itemviews/storageview")
find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
+qt_standard_project_setup()
+
qt_add_executable(storageview
main.cpp
storagemodel.cpp storagemodel.h
@@ -25,9 +25,9 @@ set_target_properties(storageview PROPERTIES
)
target_link_libraries(storageview PUBLIC
- Qt::Core
- Qt::Gui
- Qt::Widgets
+ Qt6::Core
+ Qt6::Gui
+ Qt6::Widgets
)
install(TARGETS storageview