summaryrefslogtreecommitdiffstats
path: root/examples/widgets/painting/composition
diff options
context:
space:
mode:
Diffstat (limited to 'examples/widgets/painting/composition')
-rw-r--r--examples/widgets/painting/composition/composition.cpp12
-rw-r--r--examples/widgets/painting/composition/composition.h12
-rw-r--r--examples/widgets/painting/composition/composition.pro6
3 files changed, 15 insertions, 15 deletions
diff --git a/examples/widgets/painting/composition/composition.cpp b/examples/widgets/painting/composition/composition.cpp
index d89f9d5fb1..a591cafd06 100644
--- a/examples/widgets/painting/composition/composition.cpp
+++ b/examples/widgets/painting/composition/composition.cpp
@@ -127,7 +127,7 @@ CompositionWidget::CompositionWidget(QWidget *parent)
QPushButton *showSourceButton = new QPushButton(mainGroup);
showSourceButton->setText(tr("Show Source"));
-#if defined(QT_OPENGL_SUPPORT) && !defined(QT_OPENGL_ES)
+#if defined(USE_OPENGL) && !defined(QT_OPENGL_ES)
QPushButton *enableOpenGLButton = new QPushButton(mainGroup);
enableOpenGLButton->setText(tr("Use OpenGL"));
enableOpenGLButton->setCheckable(true);
@@ -157,7 +157,7 @@ CompositionWidget::CompositionWidget(QWidget *parent)
mainGroupLayout->addWidget(animateButton);
mainGroupLayout->addWidget(whatsThisButton);
mainGroupLayout->addWidget(showSourceButton);
-#if defined(QT_OPENGL_SUPPORT) && !defined(QT_OPENGL_ES)
+#if defined(USE_OPENGL) && !defined(QT_OPENGL_ES)
mainGroupLayout->addWidget(enableOpenGLButton);
#endif
@@ -201,7 +201,7 @@ CompositionWidget::CompositionWidget(QWidget *parent)
connect(whatsThisButton, SIGNAL(clicked(bool)), view, SLOT(setDescriptionEnabled(bool)));
connect(view, SIGNAL(descriptionEnabledChanged(bool)), whatsThisButton, SLOT(setChecked(bool)));
connect(showSourceButton, SIGNAL(clicked()), view, SLOT(showSource()));
-#if defined(QT_OPENGL_SUPPORT) && !defined(QT_OPENGL_ES)
+#if defined(USE_OPENGL) && !defined(QT_OPENGL_ES)
connect(enableOpenGLButton, SIGNAL(clicked(bool)), view, SLOT(enableOpenGL(bool)));
#endif
connect(animateButton, SIGNAL(toggled(bool)), view, SLOT(setAnimationEnabled(bool)));
@@ -249,7 +249,7 @@ CompositionRenderer::CompositionRenderer(QWidget *parent)
m_circle_pos = QPoint(200, 100);
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
-#ifdef QT_OPENGL_SUPPORT
+#ifdef USE_OPENGL
m_pbuffer = 0;
m_pbuffer_size = 1024;
#endif
@@ -341,7 +341,7 @@ void CompositionRenderer::drawSource(QPainter &p)
void CompositionRenderer::paint(QPainter *painter)
{
-#if defined(QT_OPENGL_SUPPORT) && !defined(QT_OPENGL_ES)
+#if defined(USE_OPENGL) && !defined(QT_OPENGL_ES)
if (usesOpenGL()) {
int new_pbuf_size = m_pbuffer_size;
@@ -511,7 +511,7 @@ void CompositionRenderer::setCirclePos(const QPointF &pos)
const QRect oldRect = rectangle_around(m_circle_pos).toAlignedRect();
m_circle_pos = pos;
const QRect newRect = rectangle_around(m_circle_pos).toAlignedRect();
-#if defined(QT_OPENGL_SUPPORT) && !defined(QT_OPENGL_ES)
+#if defined(USE_OPENGL) && !defined(QT_OPENGL_ES)
if (usesOpenGL()) {
update();
return;
diff --git a/examples/widgets/painting/composition/composition.h b/examples/widgets/painting/composition/composition.h
index b52cc51681..610017a5d8 100644
--- a/examples/widgets/painting/composition/composition.h
+++ b/examples/widgets/painting/composition/composition.h
@@ -109,21 +109,21 @@ class CompositionRenderer : public ArthurFrame
public:
CompositionRenderer(QWidget *parent);
- void paint(QPainter *);
+ void paint(QPainter *) Q_DECL_OVERRIDE;
void setCirclePos(const QPointF &pos);
- QSize sizeHint() const { return QSize(500, 400); }
+ QSize sizeHint() const Q_DECL_OVERRIDE { return QSize(500, 400); }
bool animationEnabled() const { return m_animation_enabled; }
int circleColor() const { return m_circle_hue; }
int circleAlpha() const { return m_circle_alpha; }
protected:
- void mousePressEvent(QMouseEvent *);
- void mouseMoveEvent(QMouseEvent *);
- void mouseReleaseEvent(QMouseEvent *);
- void timerEvent(QTimerEvent *);
+ void mousePressEvent(QMouseEvent *) Q_DECL_OVERRIDE;
+ void mouseMoveEvent(QMouseEvent *) Q_DECL_OVERRIDE;
+ void mouseReleaseEvent(QMouseEvent *) Q_DECL_OVERRIDE;
+ void timerEvent(QTimerEvent *) Q_DECL_OVERRIDE;
public slots:
void setClearMode() { m_composition_mode = QPainter::CompositionMode_Clear; update(); }
diff --git a/examples/widgets/painting/composition/composition.pro b/examples/widgets/painting/composition/composition.pro
index 0269945ac8..332291c2a4 100644
--- a/examples/widgets/painting/composition/composition.pro
+++ b/examples/widgets/painting/composition/composition.pro
@@ -6,9 +6,9 @@ SHARED_FOLDER = ../shared
include($$SHARED_FOLDER/shared.pri)
RESOURCES += composition.qrc
-qtHaveModule(opengl) {
- DEFINES += QT_OPENGL_SUPPORT
- QT += opengl
+qtHaveModule(opengl): !contains(QT_CONFIG,dynamicgl) {
+ DEFINES += USE_OPENGL
+ QT += opengl
}
QT += widgets