summaryrefslogtreecommitdiffstats
path: root/examples/widgets/painting
diff options
context:
space:
mode:
Diffstat (limited to 'examples/widgets/painting')
-rw-r--r--examples/widgets/painting/affine/xform.h12
-rw-r--r--examples/widgets/painting/basicdrawing/renderarea.h6
-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
-rw-r--r--examples/widgets/painting/concentriccircles/circlewidget.h6
-rw-r--r--examples/widgets/painting/deform/pathdeform.h12
-rw-r--r--examples/widgets/painting/gradients/gradients.h10
-rw-r--r--examples/widgets/painting/painterpaths/renderarea.h6
-rw-r--r--examples/widgets/painting/pathstroke/pathstroke.h16
-rw-r--r--examples/widgets/painting/shared/arthurstyle.h20
-rw-r--r--examples/widgets/painting/shared/arthurwidgets.h8
-rw-r--r--examples/widgets/painting/shared/hoverpoints.h2
-rw-r--r--examples/widgets/painting/transformations/renderarea.h6
14 files changed, 67 insertions, 67 deletions
diff --git a/examples/widgets/painting/affine/xform.h b/examples/widgets/painting/affine/xform.h
index 67ebf43689..46038b29fd 100644
--- a/examples/widgets/painting/affine/xform.h
+++ b/examples/widgets/painting/affine/xform.h
@@ -71,14 +71,14 @@ public:
enum XFormType { VectorType, PixmapType, TextType };
XFormView(QWidget *parent);
- void paint(QPainter *);
+ void paint(QPainter *) Q_DECL_OVERRIDE;
void drawVectorType(QPainter *painter);
void drawPixmapType(QPainter *painter);
void drawTextType(QPainter *painter);
- QSize sizeHint() const { return QSize(500, 500); }
+ QSize sizeHint() const Q_DECL_OVERRIDE { return QSize(500, 500); }
- void mousePressEvent(QMouseEvent *e);
- void resizeEvent(QResizeEvent *e);
+ void mousePressEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
+ void resizeEvent(QResizeEvent *e) Q_DECL_OVERRIDE;
HoverPoints *hoverPoints() { return pts; }
bool animation() const { return timer.isActive(); }
@@ -115,9 +115,9 @@ signals:
void shearChanged(int shear);
protected:
- void timerEvent(QTimerEvent *e);
+ void timerEvent(QTimerEvent *e) Q_DECL_OVERRIDE;
#ifndef QT_NO_WHEELEVENT
- void wheelEvent(QWheelEvent *);
+ void wheelEvent(QWheelEvent *) Q_DECL_OVERRIDE;
#endif
private:
diff --git a/examples/widgets/painting/basicdrawing/renderarea.h b/examples/widgets/painting/basicdrawing/renderarea.h
index 3975ddbbe3..e39db21d32 100644
--- a/examples/widgets/painting/basicdrawing/renderarea.h
+++ b/examples/widgets/painting/basicdrawing/renderarea.h
@@ -57,8 +57,8 @@ public:
RenderArea(QWidget *parent = 0);
- QSize minimumSizeHint() const;
- QSize sizeHint() const;
+ QSize minimumSizeHint() const Q_DECL_OVERRIDE;
+ QSize sizeHint() const Q_DECL_OVERRIDE;
public slots:
void setShape(Shape shape);
@@ -68,7 +68,7 @@ public slots:
void setTransformed(bool transformed);
protected:
- void paintEvent(QPaintEvent *event);
+ void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
private:
Shape shape;
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
diff --git a/examples/widgets/painting/concentriccircles/circlewidget.h b/examples/widgets/painting/concentriccircles/circlewidget.h
index a1ca3dfe43..f09ab10a48 100644
--- a/examples/widgets/painting/concentriccircles/circlewidget.h
+++ b/examples/widgets/painting/concentriccircles/circlewidget.h
@@ -54,14 +54,14 @@ public:
void setFloatBased(bool floatBased);
void setAntialiased(bool antialiased);
- QSize minimumSizeHint() const;
- QSize sizeHint() const;
+ QSize minimumSizeHint() const Q_DECL_OVERRIDE;
+ QSize sizeHint() const Q_DECL_OVERRIDE;
public slots:
void nextAnimationFrame();
protected:
- void paintEvent(QPaintEvent *event);
+ void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
private:
bool floatBased;
diff --git a/examples/widgets/painting/deform/pathdeform.h b/examples/widgets/painting/deform/pathdeform.h
index c5c86d1017..f89c5a2c86 100644
--- a/examples/widgets/painting/deform/pathdeform.h
+++ b/examples/widgets/painting/deform/pathdeform.h
@@ -60,14 +60,14 @@ class PathDeformRenderer : public ArthurFrame
public:
explicit PathDeformRenderer(QWidget *widget, bool smallScreen = false);
- void paint(QPainter *painter);
+ void paint(QPainter *painter) Q_DECL_OVERRIDE;
- void mousePressEvent(QMouseEvent *e);
- void mouseReleaseEvent(QMouseEvent *e);
- void mouseMoveEvent(QMouseEvent *e);
- void timerEvent(QTimerEvent *e);
+ void mousePressEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
+ void mouseReleaseEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
+ void mouseMoveEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
+ void timerEvent(QTimerEvent *e) Q_DECL_OVERRIDE;
- QSize sizeHint() const { return QSize(600, 500); }
+ QSize sizeHint() const Q_DECL_OVERRIDE { return QSize(600, 500); }
bool animated() const { return m_animated; }
int radius() const { return int(m_radius); }
diff --git a/examples/widgets/painting/gradients/gradients.h b/examples/widgets/painting/gradients/gradients.h
index ee719bb3c2..7d9aa9c1e6 100644
--- a/examples/widgets/painting/gradients/gradients.h
+++ b/examples/widgets/painting/gradients/gradients.h
@@ -67,9 +67,9 @@ public:
void setGradientStops(const QGradientStops &stops);
- void paintEvent(QPaintEvent *e);
+ void paintEvent(QPaintEvent *e) Q_DECL_OVERRIDE;
- QSize sizeHint() const { return QSize(150, 40); }
+ QSize sizeHint() const Q_DECL_OVERRIDE { return QSize(150, 40); }
QPolygonF points() const;
HoverPoints *hoverPoints() const { return m_hoverPoints; }
@@ -116,12 +116,12 @@ class GradientRenderer : public ArthurFrame
public:
GradientRenderer(QWidget *parent);
- void paint(QPainter *p);
+ void paint(QPainter *p) Q_DECL_OVERRIDE;
- QSize sizeHint() const { return QSize(400, 400); }
+ QSize sizeHint() const Q_DECL_OVERRIDE { return QSize(400, 400); }
HoverPoints *hoverPoints() const { return m_hoverPoints; }
- void mousePressEvent(QMouseEvent *e);
+ void mousePressEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
public slots:
void setGradientStops(const QGradientStops &stops);
diff --git a/examples/widgets/painting/painterpaths/renderarea.h b/examples/widgets/painting/painterpaths/renderarea.h
index 02d0adb1ec..be5de5952d 100644
--- a/examples/widgets/painting/painterpaths/renderarea.h
+++ b/examples/widgets/painting/painterpaths/renderarea.h
@@ -52,8 +52,8 @@ class RenderArea : public QWidget
public:
explicit RenderArea(const QPainterPath &path, QWidget *parent = 0);
- QSize minimumSizeHint() const;
- QSize sizeHint() const;
+ QSize minimumSizeHint() const Q_DECL_OVERRIDE;
+ QSize sizeHint() const Q_DECL_OVERRIDE;
public slots:
void setFillRule(Qt::FillRule rule);
@@ -63,7 +63,7 @@ public slots:
void setRotationAngle(int degrees);
protected:
- void paintEvent(QPaintEvent *event);
+ void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
//! [0]
//! [1]
diff --git a/examples/widgets/painting/pathstroke/pathstroke.h b/examples/widgets/painting/pathstroke/pathstroke.h
index a697101448..d801b05b08 100644
--- a/examples/widgets/painting/pathstroke/pathstroke.h
+++ b/examples/widgets/painting/pathstroke/pathstroke.h
@@ -56,14 +56,14 @@ public:
explicit PathStrokeRenderer(QWidget *parent, bool smallScreen = false);
- void paint(QPainter *);
- void mousePressEvent(QMouseEvent *e);
- void mouseMoveEvent(QMouseEvent *e);
- void mouseReleaseEvent(QMouseEvent *e);
- void timerEvent(QTimerEvent *e);
- bool event(QEvent *e);
-
- QSize sizeHint() const { return QSize(500, 500); }
+ void paint(QPainter *) Q_DECL_OVERRIDE;
+ void mousePressEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
+ void mouseMoveEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
+ void mouseReleaseEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
+ void timerEvent(QTimerEvent *e) Q_DECL_OVERRIDE;
+ bool event(QEvent *e) Q_DECL_OVERRIDE;
+
+ QSize sizeHint() const Q_DECL_OVERRIDE { return QSize(500, 500); }
bool animation() const { return m_timer.isActive(); }
diff --git a/examples/widgets/painting/shared/arthurstyle.h b/examples/widgets/painting/shared/arthurstyle.h
index ede7fe860b..8b78aa14de 100644
--- a/examples/widgets/painting/shared/arthurstyle.h
+++ b/examples/widgets/painting/shared/arthurstyle.h
@@ -54,23 +54,23 @@ public:
void drawHoverRect(QPainter *painter, const QRect &rect) const;
void drawPrimitive(PrimitiveElement element, const QStyleOption *option,
- QPainter *painter, const QWidget *widget = 0) const;
+ QPainter *painter, const QWidget *widget = 0) const Q_DECL_OVERRIDE;
void drawControl(ControlElement element, const QStyleOption *option,
- QPainter *painter, const QWidget *widget) const;
+ QPainter *painter, const QWidget *widget) const Q_DECL_OVERRIDE;
void drawComplexControl(ComplexControl control, const QStyleOptionComplex *option,
- QPainter *painter, const QWidget *widget) const;
+ QPainter *painter, const QWidget *widget) const Q_DECL_OVERRIDE;
QSize sizeFromContents(ContentsType type, const QStyleOption *option,
- const QSize &size, const QWidget *widget) const;
+ const QSize &size, const QWidget *widget) const Q_DECL_OVERRIDE;
- QRect subElementRect(SubElement element, const QStyleOption *option, const QWidget *widget) const;
+ QRect subElementRect(SubElement element, const QStyleOption *option, const QWidget *widget) const Q_DECL_OVERRIDE;
QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *opt,
- SubControl sc, const QWidget *widget) const;
+ SubControl sc, const QWidget *widget) const Q_DECL_OVERRIDE;
- int pixelMetric(PixelMetric metric, const QStyleOption *option, const QWidget *widget) const;
+ int pixelMetric(PixelMetric metric, const QStyleOption *option, const QWidget *widget) const Q_DECL_OVERRIDE;
- void polish(QPalette &palette);
- void polish(QWidget *widget);
- void unpolish(QWidget *widget);
+ void polish(QPalette &palette) Q_DECL_OVERRIDE;
+ void polish(QWidget *widget) Q_DECL_OVERRIDE;
+ void unpolish(QWidget *widget) Q_DECL_OVERRIDE;
};
#endif
diff --git a/examples/widgets/painting/shared/arthurwidgets.h b/examples/widgets/painting/shared/arthurwidgets.h
index 2d96ed63d4..02d0a56656 100644
--- a/examples/widgets/painting/shared/arthurwidgets.h
+++ b/examples/widgets/painting/shared/arthurwidgets.h
@@ -59,9 +59,9 @@ public:
setAttribute(Qt::WA_AcceptTouchEvents);
}
void disableAutoBufferSwap() { setAutoBufferSwap(false); }
- void paintEvent(QPaintEvent *) { parentWidget()->update(); }
+ void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE { parentWidget()->update(); }
protected:
- bool event(QEvent *event)
+ bool event(QEvent *event) Q_DECL_OVERRIDE
{
switch (event->type()) {
case QEvent::TouchBegin:
@@ -117,8 +117,8 @@ signals:
void descriptionEnabledChanged(bool);
protected:
- void paintEvent(QPaintEvent *);
- void resizeEvent(QResizeEvent *);
+ void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
+ void resizeEvent(QResizeEvent *) Q_DECL_OVERRIDE;
#if defined(QT_OPENGL_SUPPORT)
GLWidget *glw;
diff --git a/examples/widgets/painting/shared/hoverpoints.h b/examples/widgets/painting/shared/hoverpoints.h
index adc920de30..7fa28c79ed 100644
--- a/examples/widgets/painting/shared/hoverpoints.h
+++ b/examples/widgets/painting/shared/hoverpoints.h
@@ -76,7 +76,7 @@ public:
HoverPoints(QWidget *widget, PointShape shape);
- bool eventFilter(QObject *object, QEvent *event);
+ bool eventFilter(QObject *object, QEvent *event) Q_DECL_OVERRIDE;
void paintPoints();
diff --git a/examples/widgets/painting/transformations/renderarea.h b/examples/widgets/painting/transformations/renderarea.h
index 214c3803d0..fb814d580c 100644
--- a/examples/widgets/painting/transformations/renderarea.h
+++ b/examples/widgets/painting/transformations/renderarea.h
@@ -65,11 +65,11 @@ public:
void setOperations(const QList<Operation> &operations);
void setShape(const QPainterPath &shape);
- QSize minimumSizeHint() const;
- QSize sizeHint() const;
+ QSize minimumSizeHint() const Q_DECL_OVERRIDE;
+ QSize sizeHint() const Q_DECL_OVERRIDE;
protected:
- void paintEvent(QPaintEvent *event);
+ void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
//! [1]
//! [2]