From 92f984273262531f909ede17a324f546fe502b5c Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Mon, 6 May 2019 14:00:53 +0200 Subject: Deprecate conversion functions between QList and QSet Users should use range constructors instead to do the conversion. Keep conversion methods between QList and QVector as these will turn into a no-op in Qt 6, whereas forcing people to use range constructors would lead to deep copies of the data. Change-Id: Id9fc9e4d007044e019826da523e8418857c91283 Reviewed-by: Simon Hausmann --- examples/widgets/painting/pathstroke/pathstroke.cpp | 3 ++- examples/widgets/painting/shared/hoverpoints.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'examples/widgets/painting') diff --git a/examples/widgets/painting/pathstroke/pathstroke.cpp b/examples/widgets/painting/pathstroke/pathstroke.cpp index 03e55bb2a2..e4009f0b1a 100644 --- a/examples/widgets/painting/pathstroke/pathstroke.cpp +++ b/examples/widgets/painting/pathstroke/pathstroke.cpp @@ -611,7 +611,8 @@ bool PathStrokeRenderer::event(QEvent *e) case Qt::TouchPointPressed: { // find the point, move it - QSet activePoints = QSet::fromList(m_fingerPointMapping.values()); + const auto mappedPoints = m_fingerPointMapping.values(); + QSet activePoints = QSet(mappedPoints.begin(), mappedPoints.end()); int activePoint = -1; qreal distance = -1; const int pointsCount = m_points.size(); diff --git a/examples/widgets/painting/shared/hoverpoints.cpp b/examples/widgets/painting/shared/hoverpoints.cpp index 74c78088ad..2032fb5a2c 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 activePoints = QSet::fromList(m_fingerPointMapping.values()); + const auto mappedPoints = m_fingerPointMapping.values(); + QSet activePoints = QSet(mappedPoints.begin(), mappedPoints.end()); int activePoint = -1; qreal distance = -1; const int pointsCount = m_points.size(); -- cgit v1.2.3 From 4f6eb43898aa14fef5f3a54966b340188271d85e Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Sun, 12 May 2019 21:30:10 +0200 Subject: QtCore: mark obsolete enumerations as deprecated The following enumerations were obsolete for a log time but not marked as deprecated: - WA_NoBackground - WA_MacNoClickThrough - WA_MacBrushedMetal - WA_MacMetalStyle - WA_MSWindowsUseDirect3D - WA_MacFrameworkScaled - AA_MSWindowsUseDirect3DByDefault - AA_X11InitThreads - ImMicroFocus mark them as deprecated and remove the usage inside QtBase so they can be removed with Qt6 Change-Id: Ia087a7e1d0ff1945286895be6425a6cceaa483fb Reviewed-by: Friedemann Kleint Reviewed-by: Richard Moe Gustavsen --- examples/widgets/painting/gradients/gradients.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'examples/widgets/painting') diff --git a/examples/widgets/painting/gradients/gradients.cpp b/examples/widgets/painting/gradients/gradients.cpp index 8df45be8d9..a4528ce06f 100644 --- a/examples/widgets/painting/gradients/gradients.cpp +++ b/examples/widgets/painting/gradients/gradients.cpp @@ -72,7 +72,7 @@ ShadeWidget::ShadeWidget(ShadeType type, QWidget *parent) setPalette(pal); } else { - setAttribute(Qt::WA_NoBackground); + setAttribute(Qt::WA_OpaquePaintEvent); } QPolygonF points; -- cgit v1.2.3 From b4a1336bb0482298602f47a77f6a44aac513a92a Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Thu, 23 May 2019 15:40:37 +0200 Subject: Fix memory leak with arthur style ASAN reports a leak here, so let's delete the style after the widgets using them have been destroyed. Change-Id: I0e8603fc5d2d0c13deca35a1c0020646c65eaf49 Reviewed-by: Allan Sandfeld Jensen --- examples/widgets/painting/composition/main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'examples/widgets/painting') diff --git a/examples/widgets/painting/composition/main.cpp b/examples/widgets/painting/composition/main.cpp index 2eaeaba2c5..1ffa29dddc 100644 --- a/examples/widgets/painting/composition/main.cpp +++ b/examples/widgets/painting/composition/main.cpp @@ -56,13 +56,13 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); + QScopedPointer arthurStyle(new ArthurStyle()); CompositionWidget compWidget(nullptr); - QStyle *arthurStyle = new ArthurStyle(); - compWidget.setStyle(arthurStyle); + compWidget.setStyle(arthurStyle.data()); const QList widgets = compWidget.findChildren(); for (QWidget *w : widgets) - w->setStyle(arthurStyle); + w->setStyle(arthurStyle.data()); compWidget.show(); return app.exec(); -- cgit v1.2.3