diff options
author | Lars Knoll <lars.knoll@qt.io> | 2019-05-06 14:00:53 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2019-05-07 14:15:44 +0000 |
commit | 92f984273262531f909ede17a324f546fe502b5c (patch) | |
tree | ac4d4cb8796d9838607084629cf127e1641c28c0 /examples | |
parent | d510e1e7f919e01a3b875ff5a575b818e5ee03e8 (diff) |
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 <simon.hausmann@qt.io>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/opengl/contextinfo/widget.cpp | 2 | ||||
-rw-r--r-- | examples/widgets/painting/pathstroke/pathstroke.cpp | 3 | ||||
-rw-r--r-- | examples/widgets/painting/shared/hoverpoints.cpp | 3 |
3 files changed, 5 insertions, 3 deletions
diff --git a/examples/opengl/contextinfo/widget.cpp b/examples/opengl/contextinfo/widget.cpp index b1b7076503..0762c91662 100644 --- a/examples/opengl/contextinfo/widget.cpp +++ b/examples/opengl/contextinfo/widget.cpp @@ -384,7 +384,7 @@ void Widget::renderWindowReady() m_output->append(tr("Qt OpenGL library handle: %1") .arg(QString::number(qintptr(QOpenGLContext::openGLModuleHandle()), 16))); - QList<QByteArray> extensionList = context->extensions().toList(); + QList<QByteArray> extensionList = context->extensions().values(); std::sort(extensionList.begin(), extensionList.end()); m_extensions->append(tr("Found %1 extensions:").arg(extensionList.count())); for (const QByteArray &ext : qAsConst(extensionList)) 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<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(); 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<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(); |