summaryrefslogtreecommitdiffstats
path: root/examples/widgets/painting/affine
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2018-07-11 15:12:56 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2018-10-17 09:16:01 +0000
commit0ead3b7142e47b89059af689de4ede47075375be (patch)
treede3c43993ccbc1d65ad304ef82eb3f430a0dd587 /examples/widgets/painting/affine
parent16ebc78ef3280bf284da9a49bdd3fc1fabad347f (diff)
Move arthurwidget based examples to new QOpenGL classes
Several of the examples were not even working besides using deprecated classes. Change-Id: I352e0629d490593edcc5868d2ec5a8ff222eaeab Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'examples/widgets/painting/affine')
-rw-r--r--examples/widgets/painting/affine/affine.pro4
-rw-r--r--examples/widgets/painting/affine/xform.cpp8
2 files changed, 3 insertions, 9 deletions
diff --git a/examples/widgets/painting/affine/affine.pro b/examples/widgets/painting/affine/affine.pro
index 0ad869183c..0af18b82ca 100644
--- a/examples/widgets/painting/affine/affine.pro
+++ b/examples/widgets/painting/affine/affine.pro
@@ -1,10 +1,6 @@
SOURCES += main.cpp xform.cpp
HEADERS += xform.h
-qtHaveModule(opengl) {
- DEFINES += QT_OPENGL_SUPPORT
- QT += opengl
-}
QT += widgets
SHARED_FOLDER = ../shared
diff --git a/examples/widgets/painting/affine/xform.cpp b/examples/widgets/painting/affine/xform.cpp
index 20f6eb3c6d..dc01acf453 100644
--- a/examples/widgets/painting/affine/xform.cpp
+++ b/examples/widgets/painting/affine/xform.cpp
@@ -830,13 +830,11 @@ XFormWidget::XFormWidget(QWidget *parent)
QPushButton *showSourceButton = new QPushButton(mainGroup);
showSourceButton->setText(tr("Show Source"));
-#ifdef QT_OPENGL_SUPPORT
+#if QT_CONFIG(opengl)
QPushButton *enableOpenGLButton = new QPushButton(mainGroup);
enableOpenGLButton->setText(tr("Use OpenGL"));
enableOpenGLButton->setCheckable(true);
enableOpenGLButton->setChecked(view->usesOpenGL());
- if (!QGLFormat::hasOpenGL())
- enableOpenGLButton->hide();
#endif
QPushButton *whatsThisButton = new QPushButton(mainGroup);
whatsThisButton->setText(tr("What's This?"));
@@ -871,7 +869,7 @@ XFormWidget::XFormWidget(QWidget *parent)
mainGroupLayout->addWidget(resetButton);
mainGroupLayout->addWidget(animateButton);
mainGroupLayout->addWidget(showSourceButton);
-#ifdef QT_OPENGL_SUPPORT
+#if QT_CONFIG(opengl)
mainGroupLayout->addWidget(enableOpenGLButton);
#endif
mainGroupLayout->addWidget(whatsThisButton);
@@ -897,7 +895,7 @@ 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);
-#ifdef QT_OPENGL_SUPPORT
+#if QT_CONFIG(opengl)
connect(enableOpenGLButton, &QPushButton::clicked, view, &XFormView::enableOpenGL);
#endif
view->loadSourceFile(":res/affine/xform.cpp");