summaryrefslogtreecommitdiffstats
path: root/examples/widgets/painting/affine
diff options
context:
space:
mode:
Diffstat (limited to 'examples/widgets/painting/affine')
-rw-r--r--examples/widgets/painting/affine/CMakeLists.txt50
-rw-r--r--examples/widgets/painting/affine/main.cpp4
-rw-r--r--examples/widgets/painting/affine/xform.cpp12
3 files changed, 16 insertions, 50 deletions
diff --git a/examples/widgets/painting/affine/CMakeLists.txt b/examples/widgets/painting/affine/CMakeLists.txt
index c0f52d1c1c..dd39086620 100644
--- a/examples/widgets/painting/affine/CMakeLists.txt
+++ b/examples/widgets/painting/affine/CMakeLists.txt
@@ -4,21 +4,11 @@
cmake_minimum_required(VERSION 3.16)
project(affine LANGUAGES CXX)
-set(CMAKE_AUTOMOC ON)
-
-if(NOT DEFINED INSTALL_EXAMPLESDIR)
- set(INSTALL_EXAMPLESDIR "examples")
-endif()
-
-set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/widgets/painting/affine")
-
find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
+qt_standard_project_setup()
+
qt_add_executable(affine
- # remove files from ../shared
- #../shared/arthurstyle.cpp ../shared/arthurstyle.h
- #../shared/arthurwidgets.cpp ../shared/arthurwidgets.h
- #../shared/hoverpoints.cpp ../shared/hoverpoints.h
main.cpp
xform.cpp xform.h
)
@@ -28,18 +18,14 @@ set_target_properties(affine PROPERTIES
MACOSX_BUNDLE TRUE
)
-target_include_directories(affine PUBLIC
- ../shared
-)
-
if(NOT TARGET painting_shared::painting_shared)
include(../shared/use_lib.cmake)
endif()
-target_link_libraries(affine PUBLIC
- Qt::Core
- Qt::Gui
- Qt::Widgets
+target_link_libraries(affine PRIVATE
+ Qt6::Core
+ Qt6::Gui
+ Qt6::Widgets
painting_shared::painting_shared
)
@@ -104,19 +90,15 @@ qt_add_resources(affine "affine"
${affine_resource_files}
)
-# remove files from ../shared
-#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}"
+ BUNDLE DESTINATION .
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+)
+
+qt_generate_deploy_app_script(
+ TARGET affine
+ OUTPUT_SCRIPT deploy_script
+ NO_UNSUPPORTED_PLATFORM_ERROR
)
+install(SCRIPT ${deploy_script})
diff --git a/examples/widgets/painting/affine/main.cpp b/examples/widgets/painting/affine/main.cpp
index a0ded9bfe3..1f9c2399c9 100644
--- a/examples/widgets/painting/affine/main.cpp
+++ b/examples/widgets/painting/affine/main.cpp
@@ -7,10 +7,6 @@
int main(int argc, char **argv)
{
- Q_INIT_RESOURCE(affine);
-#ifdef Q_OS_ANDROID
- qputenv("QT_SCALE_FACTOR", "2");
-#endif
QApplication app(argc, argv);
XFormWidget xformWidget(nullptr);
diff --git a/examples/widgets/painting/affine/xform.cpp b/examples/widgets/painting/affine/xform.cpp
index 87d653acd3..5754490eed 100644
--- a/examples/widgets/painting/affine/xform.cpp
+++ b/examples/widgets/painting/affine/xform.cpp
@@ -777,12 +777,6 @@ XFormWidget::XFormWidget(QWidget *parent)
QPushButton *showSourceButton = new QPushButton(mainGroup);
showSourceButton->setText(tr("Show Source"));
-#if QT_CONFIG(opengl)
- QPushButton *enableOpenGLButton = new QPushButton(mainGroup);
- enableOpenGLButton->setText(tr("Use OpenGL"));
- enableOpenGLButton->setCheckable(true);
- enableOpenGLButton->setChecked(view->usesOpenGL());
-#endif
QPushButton *whatsThisButton = new QPushButton(mainGroup);
whatsThisButton->setText(tr("What's This?"));
whatsThisButton->setCheckable(true);
@@ -812,9 +806,6 @@ XFormWidget::XFormWidget(QWidget *parent)
mainGroupLayout->addWidget(resetButton);
mainGroupLayout->addWidget(animateButton);
mainGroupLayout->addWidget(showSourceButton);
-#if QT_CONFIG(opengl)
- mainGroupLayout->addWidget(enableOpenGLButton);
-#endif
mainGroupLayout->addWidget(whatsThisButton);
mainGroup->setLayout(mainGroupLayout);
@@ -852,9 +843,6 @@ XFormWidget::XFormWidget(QWidget *parent)
connect(view, &XFormView::descriptionEnabledChanged, view->hoverPoints(), &HoverPoints::setDisabled);
connect(view, &XFormView::descriptionEnabledChanged, whatsThisButton, &QPushButton::setChecked);
connect(showSourceButton, &QPushButton::clicked, view, &XFormView::showSource);
-#if QT_CONFIG(opengl)
- connect(enableOpenGLButton, &QPushButton::clicked, view, &XFormView::enableOpenGL);
-#endif
view->loadSourceFile(":res/affine/xform.cpp");
view->loadDescription(":res/affine/xform.html");