summaryrefslogtreecommitdiffstats
path: root/examples/widgets/tools/completer
diff options
context:
space:
mode:
Diffstat (limited to 'examples/widgets/tools/completer')
-rw-r--r--examples/widgets/tools/completer/CMakeLists.txt21
-rw-r--r--examples/widgets/tools/completer/mainwindow.cpp8
2 files changed, 23 insertions, 6 deletions
diff --git a/examples/widgets/tools/completer/CMakeLists.txt b/examples/widgets/tools/completer/CMakeLists.txt
index f5df74ffc8..b60d38cfdc 100644
--- a/examples/widgets/tools/completer/CMakeLists.txt
+++ b/examples/widgets/tools/completer/CMakeLists.txt
@@ -9,20 +9,37 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
-set(INSTALL_EXAMPLEDIR "examples")
+set(INSTALL_EXAMPLEDIR "examples/widgets/tools/completer")
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
find_package(Qt6 COMPONENTS Widgets)
add_qt_gui_executable(completer
- completer.qrc
fsmodel.cpp fsmodel.h
main.cpp
mainwindow.cpp mainwindow.h
)
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"
+ PREFIX
+ "/"
+ FILES
+ ${completer_resource_files}
+)
+
install(TARGETS completer
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
diff --git a/examples/widgets/tools/completer/mainwindow.cpp b/examples/widgets/tools/completer/mainwindow.cpp
index b50e0a5456..8e9c0e0615 100644
--- a/examples/widgets/tools/completer/mainwindow.cpp
+++ b/examples/widgets/tools/completer/mainwindow.cpp
@@ -117,13 +117,13 @@ MainWindow::MainWindow(QWidget *parent)
contentsLabel = new QLabel;
contentsLabel->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
- connect(modelCombo, QOverload<int>::of(&QComboBox::activated),
+ connect(modelCombo, &QComboBox::activated,
this, &MainWindow::changeModel);
- connect(modeCombo, QOverload<int>::of(&QComboBox::activated),
+ connect(modeCombo, &QComboBox::activated,
this, &MainWindow::changeMode);
- connect(caseCombo, QOverload<int>::of(&QComboBox::activated),
+ connect(caseCombo, &QComboBox::activated,
this, &MainWindow::changeCase);
- connect(maxVisibleSpinBox, QOverload<int>::of(&QSpinBox::valueChanged),
+ connect(maxVisibleSpinBox, &QSpinBox::valueChanged,
this, &MainWindow::changeMaxVisible);
//! [2]