aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJarek Kobus <jaroslaw.kobus@qt.io>2020-01-10 11:35:17 +0100
committerJarek Kobus <jaroslaw.kobus@qt.io>2020-01-17 11:35:38 +0100
commite5f7c5f2712957d0e1753c629e4cce86a0e6bdbc (patch)
treebcf701df26f9546035d8492ed8cd2938f2ee8093
parentc6899f16389458766904d8d913054f09076e06dd (diff)
Don't use deprecated QMatrix class anymore
Task-number: QTBUG-46653 Change-Id: I3570c84014788b7b66d9cb54b77f9964ae15af6d Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
-rw-r--r--src/quick/items/qquicktextcontrol.cpp19
-rw-r--r--src/quick/items/qquicktextcontrol_p.h3
-rw-r--r--tests/auto/qml/qqmlecmascript/testtypes.h1
-rw-r--r--tests/auto/qml/qqmllanguage/data/unsupportedProperty.errors.txt2
-rw-r--r--tests/auto/qml/qqmllanguage/data/unsupportedProperty.qml2
-rw-r--r--tests/auto/qml/qqmllanguage/testtypes.h8
-rw-r--r--tests/benchmarks/qml/holistic/testtypes.h1
7 files changed, 18 insertions, 18 deletions
diff --git a/src/quick/items/qquicktextcontrol.cpp b/src/quick/items/qquicktextcontrol.cpp
index 3c392be751..4c741f67e3 100644
--- a/src/quick/items/qquicktextcontrol.cpp
+++ b/src/quick/items/qquicktextcontrol.cpp
@@ -60,6 +60,7 @@
#include <QtCore/qloggingcategory.h>
#include <qtextformat.h>
+#include <qtransform.h>
#include <qdatetime.h>
#include <qbuffer.h>
#include <qguiapplication.h>
@@ -718,12 +719,12 @@ void QQuickTextControl::selectAll()
void QQuickTextControl::processEvent(QEvent *e, const QPointF &coordinateOffset)
{
- QMatrix m;
- m.translate(coordinateOffset.x(), coordinateOffset.y());
- processEvent(e, m);
+ QTransform t;
+ t.translate(coordinateOffset.x(), coordinateOffset.y());
+ processEvent(e, t);
}
-void QQuickTextControl::processEvent(QEvent *e, const QMatrix &matrix)
+void QQuickTextControl::processEvent(QEvent *e, const QTransform &transform)
{
Q_D(QQuickTextControl);
if (d->interactionFlags == Qt::NoTextInteraction) {
@@ -740,25 +741,25 @@ void QQuickTextControl::processEvent(QEvent *e, const QMatrix &matrix)
break;
case QEvent::MouseButtonPress: {
QMouseEvent *ev = static_cast<QMouseEvent *>(e);
- d->mousePressEvent(ev, matrix.map(ev->localPos()));
+ d->mousePressEvent(ev, transform.map(ev->localPos()));
break; }
case QEvent::MouseMove: {
QMouseEvent *ev = static_cast<QMouseEvent *>(e);
- d->mouseMoveEvent(ev, matrix.map(ev->localPos()));
+ d->mouseMoveEvent(ev, transform.map(ev->localPos()));
break; }
case QEvent::MouseButtonRelease: {
QMouseEvent *ev = static_cast<QMouseEvent *>(e);
- d->mouseReleaseEvent(ev, matrix.map(ev->localPos()));
+ d->mouseReleaseEvent(ev, transform.map(ev->localPos()));
break; }
case QEvent::MouseButtonDblClick: {
QMouseEvent *ev = static_cast<QMouseEvent *>(e);
- d->mouseDoubleClickEvent(ev, matrix.map(ev->localPos()));
+ d->mouseDoubleClickEvent(ev, transform.map(ev->localPos()));
break; }
case QEvent::HoverEnter:
case QEvent::HoverMove:
case QEvent::HoverLeave: {
QHoverEvent *ev = static_cast<QHoverEvent *>(e);
- d->hoverEvent(ev, matrix.map(ev->posF()));
+ d->hoverEvent(ev, transform.map(ev->posF()));
break; }
#if QT_CONFIG(im)
case QEvent::InputMethod:
diff --git a/src/quick/items/qquicktextcontrol_p.h b/src/quick/items/qquicktextcontrol_p.h
index 41b8ed7821..eb5cd27994 100644
--- a/src/quick/items/qquicktextcontrol_p.h
+++ b/src/quick/items/qquicktextcontrol_p.h
@@ -71,6 +71,7 @@ class QQuickTextControlPrivate;
class QAbstractScrollArea;
class QEvent;
class QTimerEvent;
+class QTransform;
class Q_AUTOTEST_EXPORT QQuickTextControl : public QInputControl
{
@@ -169,7 +170,7 @@ Q_SIGNALS:
void markerHovered(bool marker);
public:
- virtual void processEvent(QEvent *e, const QMatrix &matrix);
+ virtual void processEvent(QEvent *e, const QTransform &transform);
void processEvent(QEvent *e, const QPointF &coordinateOffset = QPointF());
#if QT_CONFIG(im)
diff --git a/tests/auto/qml/qqmlecmascript/testtypes.h b/tests/auto/qml/qqmlecmascript/testtypes.h
index 3233e7f105..03e3262e7b 100644
--- a/tests/auto/qml/qqmlecmascript/testtypes.h
+++ b/tests/auto/qml/qqmlecmascript/testtypes.h
@@ -36,7 +36,6 @@
#include <QtCore/qregularexpression.h>
#include <QtQml/qqmllist.h>
#include <QtCore/qrect.h>
-#include <QtGui/qmatrix.h>
#include <QtGui/qcolor.h>
#include <QtGui/qvector3d.h>
#include <QtGui/QFont>
diff --git a/tests/auto/qml/qqmllanguage/data/unsupportedProperty.errors.txt b/tests/auto/qml/qqmllanguage/data/unsupportedProperty.errors.txt
index 3cd626de86..b45c320c20 100644
--- a/tests/auto/qml/qqmllanguage/data/unsupportedProperty.errors.txt
+++ b/tests/auto/qml/qqmllanguage/data/unsupportedProperty.errors.txt
@@ -1 +1 @@
-3:13:Invalid property assignment: unsupported type "QMatrix"
+3:16:Invalid property assignment: unsupported type "QTransform"
diff --git a/tests/auto/qml/qqmllanguage/data/unsupportedProperty.qml b/tests/auto/qml/qqmllanguage/data/unsupportedProperty.qml
index 9f19680368..ec8171dd2c 100644
--- a/tests/auto/qml/qqmllanguage/data/unsupportedProperty.qml
+++ b/tests/auto/qml/qqmllanguage/data/unsupportedProperty.qml
@@ -1,4 +1,4 @@
import Test 1.0
MyQmlObject {
- matrix: "1,0,0,0,1,0,0,0,1"
+ transform: "1,0,0,0,1,0,0,0,1"
}
diff --git a/tests/auto/qml/qqmllanguage/testtypes.h b/tests/auto/qml/qqmllanguage/testtypes.h
index 2f16c072bd..39502372e6 100644
--- a/tests/auto/qml/qqmllanguage/testtypes.h
+++ b/tests/auto/qml/qqmllanguage/testtypes.h
@@ -31,7 +31,7 @@
#include <QtCore/qobject.h>
#include <QtCore/qrect.h>
#include <QtCore/qdatetime.h>
-#include <QtGui/qmatrix.h>
+#include <QtGui/qtransform.h>
#include <QtGui/qcolor.h>
#include <QtGui/qvector2d.h>
#include <QtGui/qvector3d.h>
@@ -104,7 +104,7 @@ class MyQmlObject : public QObject, public MyInterface
Q_PROPERTY(QString readOnlyString READ readOnlyString)
Q_PROPERTY(bool enabled READ enabled WRITE setEnabled)
Q_PROPERTY(QRect rect READ rect WRITE setRect)
- Q_PROPERTY(QMatrix matrix READ matrix WRITE setMatrix) //assumed to be unsupported by QML
+ Q_PROPERTY(QTransform transform READ transform WRITE setTransform) //assumed to be unsupported by QML
Q_PROPERTY(MyInterface *interfaceProperty READ interface WRITE setInterface)
Q_PROPERTY(int onLiteralSignal READ onLiteralSignal WRITE setOnLiteralSignal)
Q_PROPERTY(MyCustomVariantType customType READ customType WRITE setCustomType)
@@ -129,8 +129,8 @@ public:
QRect rect() const { return QRect(); }
void setRect(const QRect&) {}
- QMatrix matrix() const { return QMatrix(); }
- void setMatrix(const QMatrix&) {}
+ QTransform transform() const { return QTransform(); }
+ void setTransform(const QTransform &) {}
MyInterface *interface() const { return m_interface; }
void setInterface(MyInterface *iface) { m_interface = iface; }
diff --git a/tests/benchmarks/qml/holistic/testtypes.h b/tests/benchmarks/qml/holistic/testtypes.h
index 6ff64c645d..55f094ae7e 100644
--- a/tests/benchmarks/qml/holistic/testtypes.h
+++ b/tests/benchmarks/qml/holistic/testtypes.h
@@ -36,7 +36,6 @@
#include <QtQml/qqmllist.h>
#include <QtCore/qrandom.h>
#include <QtCore/qrect.h>
-#include <QtGui/qmatrix.h>
#include <QtGui/qcolor.h>
#include <QtGui/qpixmap.h>
#include <QtGui/qvector3d.h>