diff options
Diffstat (limited to 'examples/widgets/painting/shared')
6 files changed, 15 insertions, 14 deletions
diff --git a/examples/widgets/painting/shared/arthurstyle.cpp b/examples/widgets/painting/shared/arthurstyle.cpp index 3fc461bbd2..31be899357 100644 --- a/examples/widgets/painting/shared/arthurstyle.cpp +++ b/examples/widgets/painting/shared/arthurstyle.cpp @@ -457,7 +457,7 @@ void ArthurStyle::polish(QWidget *widget) QPalette pal = widget->palette(); if (widget->isWindow()) { - pal.setColor(QPalette::Background, QColor(241, 241, 241)); + pal.setColor(QPalette::Window, QColor(241, 241, 241)); widget->setPalette(pal); } @@ -474,7 +474,7 @@ void ArthurStyle::unpolish(QWidget *widget) void ArthurStyle::polish(QPalette &palette) { - palette.setColor(QPalette::Background, QColor(241, 241, 241)); + palette.setColor(QPalette::Window, QColor(241, 241, 241)); } QRect ArthurStyle::subElementRect(SubElement element, const QStyleOption *option, const QWidget *widget) const diff --git a/examples/widgets/painting/shared/arthurstyle.h b/examples/widgets/painting/shared/arthurstyle.h index 8ea8354bab..64c888b636 100644 --- a/examples/widgets/painting/shared/arthurstyle.h +++ b/examples/widgets/painting/shared/arthurstyle.h @@ -63,7 +63,7 @@ public: void drawHoverRect(QPainter *painter, const QRect &rect) const; void drawPrimitive(PrimitiveElement element, const QStyleOption *option, - QPainter *painter, const QWidget *widget = 0) const override; + QPainter *painter, const QWidget *widget = nullptr) const override; void drawControl(ControlElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget) const override; void drawComplexControl(ComplexControl control, const QStyleOptionComplex *option, diff --git a/examples/widgets/painting/shared/arthurwidgets.cpp b/examples/widgets/painting/shared/arthurwidgets.cpp index bdac5de13c..40d712c9e3 100644 --- a/examples/widgets/painting/shared/arthurwidgets.cpp +++ b/examples/widgets/painting/shared/arthurwidgets.cpp @@ -136,7 +136,7 @@ void ArthurFrame::createGlWindow() void ArthurFrame::paintEvent(QPaintEvent *e) { - static QImage *static_image = 0; + static QImage *static_image = nullptr; QPainter painter; @@ -153,7 +153,7 @@ void ArthurFrame::paintEvent(QPaintEvent *e) int o = 10; - QBrush bg = palette().brush(QPalette::Background); + QBrush bg = palette().brush(QPalette::Window); painter.fillRect(0, 0, o, o, bg); painter.fillRect(width() - o, 0, o, o, bg); painter.fillRect(0, height() - o, o, o, bg); @@ -376,7 +376,7 @@ void ArthurFrame::showSource() const QString html = QStringLiteral("<html><pre>") + contents + QStringLiteral("</pre></html>"); - QTextBrowser *sourceViewer = new QTextBrowser(0); + QTextBrowser *sourceViewer = new QTextBrowser; sourceViewer->setWindowTitle(tr("Source: %1").arg(m_sourceFileName.midRef(5))); sourceViewer->setParent(this, Qt::Dialog); sourceViewer->setAttribute(Qt::WA_DeleteOnClose); diff --git a/examples/widgets/painting/shared/fbopaintdevice.cpp b/examples/widgets/painting/shared/fbopaintdevice.cpp index 8207090cc8..9368293218 100644 --- a/examples/widgets/painting/shared/fbopaintdevice.cpp +++ b/examples/widgets/painting/shared/fbopaintdevice.cpp @@ -53,7 +53,7 @@ #include <QOffscreenSurface> #include <QOpenGLFunctions> -QFboPaintDevice::QFboPaintDevice(const QSize& size, bool flipped, bool clearOnInit, +QFboPaintDevice::QFboPaintDevice(const QSize &size, bool flipped, bool clearOnInit, QOpenGLFramebufferObject::Attachment attachment) : QOpenGLPaintDevice(size) { @@ -97,8 +97,8 @@ GLuint QFboPaintDevice::takeTexture() QImage QFboPaintDevice::toImage() const { - QOpenGLContext* currentContext = QOpenGLContext::currentContext(); - QSurface* currentSurface = currentContext ? currentContext->surface() : 0; + QOpenGLContext *currentContext = QOpenGLContext::currentContext(); + QSurface *currentSurface = currentContext ? currentContext->surface() : nullptr; context()->makeCurrent(m_surface); diff --git a/examples/widgets/painting/shared/fbopaintdevice.h b/examples/widgets/painting/shared/fbopaintdevice.h index 78451af895..a42bcc756d 100644 --- a/examples/widgets/painting/shared/fbopaintdevice.h +++ b/examples/widgets/painting/shared/fbopaintdevice.h @@ -60,7 +60,7 @@ class QFboPaintDevice : public QOpenGLPaintDevice { public: - QFboPaintDevice(const QSize&, bool flipped = false, bool clearOnInit = true, + QFboPaintDevice(const QSize &size, bool flipped = false, bool clearOnInit = true, QOpenGLFramebufferObject::Attachment = QOpenGLFramebufferObject::CombinedDepthStencil); ~QFboPaintDevice(); @@ -83,7 +83,7 @@ public: private: QOpenGLFramebufferObject *m_framebufferObject; - QSurface* m_surface; + QSurface *m_surface; }; #endif // QT_NO_OPENGL diff --git a/examples/widgets/painting/shared/hoverpoints.cpp b/examples/widgets/painting/shared/hoverpoints.cpp index 74c78088ad..2bf3963e9e 100644 --- a/examples/widgets/painting/shared/hoverpoints.cpp +++ b/examples/widgets/painting/shared/hoverpoints.cpp @@ -180,7 +180,8 @@ bool HoverPoints::eventFilter(QObject *object, QEvent *event) case Qt::TouchPointPressed: { // find the point, move it - QSet<int> activePoints = QSet<int>::fromList(m_fingerPointMapping.values()); + const auto mappedPoints = m_fingerPointMapping.values(); + QSet<int> activePoints = QSet<int>(mappedPoints.begin(), mappedPoints.end()); int activePoint = -1; qreal distance = -1; const int pointsCount = m_points.size(); @@ -261,8 +262,8 @@ bool HoverPoints::eventFilter(QObject *object, QEvent *event) case QEvent::Paint: { QWidget *that_widget = m_widget; - m_widget = 0; - QApplication::sendEvent(object, event); + m_widget = nullptr; + QCoreApplication::sendEvent(object, event); m_widget = that_widget; paintPoints(); return true; |