From 73d1476fb1397948a4d806bd921fce372bd8d63b Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Mon, 2 Dec 2019 17:54:48 +0100 Subject: Replace most use of QVariant::type and occurrences of QVariant::Type I made a clazy automated check that replaced the use of QVariant::Type by the equivalent in QMetaType. This has been deprecated since Qt 5.0, but many uses were not yet removed. In addition, there was some manual changes to fix the compilation errors. Adapted the Private API of QDateTimeParser and QMimeDataPrivate and adjust QDateTimeEdit and QSpinBox. QVariant(QVariant::Invalid) in qstylesheet made no sense. But note that in QVariant::save, we actually wanted to use the non-user type. In the SQL module, many changes were actually reverted because the API still expects QVarient::Type. Change-Id: I98c368490e4ee465ed3a3b63bda8b8eaa50ea67e Reviewed-by: Lars Knoll --- src/widgets/graphicsview/qgraphicsproxywidget.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/widgets/graphicsview/qgraphicsproxywidget.cpp') diff --git a/src/widgets/graphicsview/qgraphicsproxywidget.cpp b/src/widgets/graphicsview/qgraphicsproxywidget.cpp index 4d4958c674..eb8acf1f27 100644 --- a/src/widgets/graphicsview/qgraphicsproxywidget.cpp +++ b/src/widgets/graphicsview/qgraphicsproxywidget.cpp @@ -1441,17 +1441,17 @@ QVariant QGraphicsProxyWidget::inputMethodQuery(Qt::InputMethodQuery query) cons focusWidget = d->widget; QVariant v = focusWidget->inputMethodQuery(query); QPointF focusWidgetPos = subWidgetRect(focusWidget).topLeft(); - switch (v.type()) { - case QVariant::RectF: + switch (v.userType()) { + case QMetaType::QRectF: v = v.toRectF().translated(focusWidgetPos); break; - case QVariant::PointF: + case QMetaType::QPointF: v = v.toPointF() + focusWidgetPos; break; - case QVariant::Rect: + case QMetaType::QRect: v = v.toRect().translated(focusWidgetPos.toPoint()); break; - case QVariant::Point: + case QMetaType::QPoint: v = v.toPoint() + focusWidgetPos.toPoint(); break; default: -- cgit v1.2.3 From aec4e05e9e8ad9109d7db15dd0fea477e4574c20 Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Sat, 25 Jan 2020 20:12:12 +0100 Subject: Doc/QtWidgets: replace some 0 with \nullptr MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace some 'is 0' or 'are 0' where 0 referes to a nullptr with 'is \nullptr' and 'are \nullptr' Change-Id: I5ff46185b570bdfc7d20d18a47fd9174771ad8e5 Reviewed-by: André Hartmann Reviewed-by: Sze Howe Koh --- src/widgets/graphicsview/qgraphicsproxywidget.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/widgets/graphicsview/qgraphicsproxywidget.cpp') diff --git a/src/widgets/graphicsview/qgraphicsproxywidget.cpp b/src/widgets/graphicsview/qgraphicsproxywidget.cpp index eb8acf1f27..a9a57c57fa 100644 --- a/src/widgets/graphicsview/qgraphicsproxywidget.cpp +++ b/src/widgets/graphicsview/qgraphicsproxywidget.cpp @@ -570,8 +570,8 @@ QGraphicsProxyWidget::~QGraphicsProxyWidget() After this function returns, QGraphicsProxyWidget will keep its state synchronized with that of \a widget whenever possible. - If a widget is already embedded by this proxy when this function is - called, that widget will first be automatically unembedded. Passing 0 for + If a widget is already embedded by this proxy when this function is called, + that widget will first be automatically unembedded. Passing \nullptr for the \a widget argument will only unembed the widget, and the ownership of the currently embedded widget will be passed on to the caller. Every child widget that are embedded will also be embedded and their proxy -- cgit v1.2.3