Don't use deprecated QMatrix class anymore
Task-number: QTBUG-46653 Change-Id: I3570c84014788b7b66d9cb54b77f9964ae15af6d Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This commit is contained in:
parent
c6899f1638
commit
e5f7c5f271
|
@ -60,6 +60,7 @@
|
||||||
#include <QtCore/qloggingcategory.h>
|
#include <QtCore/qloggingcategory.h>
|
||||||
|
|
||||||
#include <qtextformat.h>
|
#include <qtextformat.h>
|
||||||
|
#include <qtransform.h>
|
||||||
#include <qdatetime.h>
|
#include <qdatetime.h>
|
||||||
#include <qbuffer.h>
|
#include <qbuffer.h>
|
||||||
#include <qguiapplication.h>
|
#include <qguiapplication.h>
|
||||||
|
@ -718,12 +719,12 @@ void QQuickTextControl::selectAll()
|
||||||
|
|
||||||
void QQuickTextControl::processEvent(QEvent *e, const QPointF &coordinateOffset)
|
void QQuickTextControl::processEvent(QEvent *e, const QPointF &coordinateOffset)
|
||||||
{
|
{
|
||||||
QMatrix m;
|
QTransform t;
|
||||||
m.translate(coordinateOffset.x(), coordinateOffset.y());
|
t.translate(coordinateOffset.x(), coordinateOffset.y());
|
||||||
processEvent(e, m);
|
processEvent(e, t);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QQuickTextControl::processEvent(QEvent *e, const QMatrix &matrix)
|
void QQuickTextControl::processEvent(QEvent *e, const QTransform &transform)
|
||||||
{
|
{
|
||||||
Q_D(QQuickTextControl);
|
Q_D(QQuickTextControl);
|
||||||
if (d->interactionFlags == Qt::NoTextInteraction) {
|
if (d->interactionFlags == Qt::NoTextInteraction) {
|
||||||
|
@ -740,25 +741,25 @@ void QQuickTextControl::processEvent(QEvent *e, const QMatrix &matrix)
|
||||||
break;
|
break;
|
||||||
case QEvent::MouseButtonPress: {
|
case QEvent::MouseButtonPress: {
|
||||||
QMouseEvent *ev = static_cast<QMouseEvent *>(e);
|
QMouseEvent *ev = static_cast<QMouseEvent *>(e);
|
||||||
d->mousePressEvent(ev, matrix.map(ev->localPos()));
|
d->mousePressEvent(ev, transform.map(ev->localPos()));
|
||||||
break; }
|
break; }
|
||||||
case QEvent::MouseMove: {
|
case QEvent::MouseMove: {
|
||||||
QMouseEvent *ev = static_cast<QMouseEvent *>(e);
|
QMouseEvent *ev = static_cast<QMouseEvent *>(e);
|
||||||
d->mouseMoveEvent(ev, matrix.map(ev->localPos()));
|
d->mouseMoveEvent(ev, transform.map(ev->localPos()));
|
||||||
break; }
|
break; }
|
||||||
case QEvent::MouseButtonRelease: {
|
case QEvent::MouseButtonRelease: {
|
||||||
QMouseEvent *ev = static_cast<QMouseEvent *>(e);
|
QMouseEvent *ev = static_cast<QMouseEvent *>(e);
|
||||||
d->mouseReleaseEvent(ev, matrix.map(ev->localPos()));
|
d->mouseReleaseEvent(ev, transform.map(ev->localPos()));
|
||||||
break; }
|
break; }
|
||||||
case QEvent::MouseButtonDblClick: {
|
case QEvent::MouseButtonDblClick: {
|
||||||
QMouseEvent *ev = static_cast<QMouseEvent *>(e);
|
QMouseEvent *ev = static_cast<QMouseEvent *>(e);
|
||||||
d->mouseDoubleClickEvent(ev, matrix.map(ev->localPos()));
|
d->mouseDoubleClickEvent(ev, transform.map(ev->localPos()));
|
||||||
break; }
|
break; }
|
||||||
case QEvent::HoverEnter:
|
case QEvent::HoverEnter:
|
||||||
case QEvent::HoverMove:
|
case QEvent::HoverMove:
|
||||||
case QEvent::HoverLeave: {
|
case QEvent::HoverLeave: {
|
||||||
QHoverEvent *ev = static_cast<QHoverEvent *>(e);
|
QHoverEvent *ev = static_cast<QHoverEvent *>(e);
|
||||||
d->hoverEvent(ev, matrix.map(ev->posF()));
|
d->hoverEvent(ev, transform.map(ev->posF()));
|
||||||
break; }
|
break; }
|
||||||
#if QT_CONFIG(im)
|
#if QT_CONFIG(im)
|
||||||
case QEvent::InputMethod:
|
case QEvent::InputMethod:
|
||||||
|
|
|
@ -71,6 +71,7 @@ class QQuickTextControlPrivate;
|
||||||
class QAbstractScrollArea;
|
class QAbstractScrollArea;
|
||||||
class QEvent;
|
class QEvent;
|
||||||
class QTimerEvent;
|
class QTimerEvent;
|
||||||
|
class QTransform;
|
||||||
|
|
||||||
class Q_AUTOTEST_EXPORT QQuickTextControl : public QInputControl
|
class Q_AUTOTEST_EXPORT QQuickTextControl : public QInputControl
|
||||||
{
|
{
|
||||||
|
@ -169,7 +170,7 @@ Q_SIGNALS:
|
||||||
void markerHovered(bool marker);
|
void markerHovered(bool marker);
|
||||||
|
|
||||||
public:
|
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());
|
void processEvent(QEvent *e, const QPointF &coordinateOffset = QPointF());
|
||||||
|
|
||||||
#if QT_CONFIG(im)
|
#if QT_CONFIG(im)
|
||||||
|
|
|
@ -36,7 +36,6 @@
|
||||||
#include <QtCore/qregularexpression.h>
|
#include <QtCore/qregularexpression.h>
|
||||||
#include <QtQml/qqmllist.h>
|
#include <QtQml/qqmllist.h>
|
||||||
#include <QtCore/qrect.h>
|
#include <QtCore/qrect.h>
|
||||||
#include <QtGui/qmatrix.h>
|
|
||||||
#include <QtGui/qcolor.h>
|
#include <QtGui/qcolor.h>
|
||||||
#include <QtGui/qvector3d.h>
|
#include <QtGui/qvector3d.h>
|
||||||
#include <QtGui/QFont>
|
#include <QtGui/QFont>
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
3:13:Invalid property assignment: unsupported type "QMatrix"
|
3:16:Invalid property assignment: unsupported type "QTransform"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import Test 1.0
|
import Test 1.0
|
||||||
MyQmlObject {
|
MyQmlObject {
|
||||||
matrix: "1,0,0,0,1,0,0,0,1"
|
transform: "1,0,0,0,1,0,0,0,1"
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
#include <QtCore/qobject.h>
|
#include <QtCore/qobject.h>
|
||||||
#include <QtCore/qrect.h>
|
#include <QtCore/qrect.h>
|
||||||
#include <QtCore/qdatetime.h>
|
#include <QtCore/qdatetime.h>
|
||||||
#include <QtGui/qmatrix.h>
|
#include <QtGui/qtransform.h>
|
||||||
#include <QtGui/qcolor.h>
|
#include <QtGui/qcolor.h>
|
||||||
#include <QtGui/qvector2d.h>
|
#include <QtGui/qvector2d.h>
|
||||||
#include <QtGui/qvector3d.h>
|
#include <QtGui/qvector3d.h>
|
||||||
|
@ -104,7 +104,7 @@ class MyQmlObject : public QObject, public MyInterface
|
||||||
Q_PROPERTY(QString readOnlyString READ readOnlyString)
|
Q_PROPERTY(QString readOnlyString READ readOnlyString)
|
||||||
Q_PROPERTY(bool enabled READ enabled WRITE setEnabled)
|
Q_PROPERTY(bool enabled READ enabled WRITE setEnabled)
|
||||||
Q_PROPERTY(QRect rect READ rect WRITE setRect)
|
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(MyInterface *interfaceProperty READ interface WRITE setInterface)
|
||||||
Q_PROPERTY(int onLiteralSignal READ onLiteralSignal WRITE setOnLiteralSignal)
|
Q_PROPERTY(int onLiteralSignal READ onLiteralSignal WRITE setOnLiteralSignal)
|
||||||
Q_PROPERTY(MyCustomVariantType customType READ customType WRITE setCustomType)
|
Q_PROPERTY(MyCustomVariantType customType READ customType WRITE setCustomType)
|
||||||
|
@ -129,8 +129,8 @@ public:
|
||||||
QRect rect() const { return QRect(); }
|
QRect rect() const { return QRect(); }
|
||||||
void setRect(const QRect&) {}
|
void setRect(const QRect&) {}
|
||||||
|
|
||||||
QMatrix matrix() const { return QMatrix(); }
|
QTransform transform() const { return QTransform(); }
|
||||||
void setMatrix(const QMatrix&) {}
|
void setTransform(const QTransform &) {}
|
||||||
|
|
||||||
MyInterface *interface() const { return m_interface; }
|
MyInterface *interface() const { return m_interface; }
|
||||||
void setInterface(MyInterface *iface) { m_interface = iface; }
|
void setInterface(MyInterface *iface) { m_interface = iface; }
|
||||||
|
|
|
@ -36,7 +36,6 @@
|
||||||
#include <QtQml/qqmllist.h>
|
#include <QtQml/qqmllist.h>
|
||||||
#include <QtCore/qrandom.h>
|
#include <QtCore/qrandom.h>
|
||||||
#include <QtCore/qrect.h>
|
#include <QtCore/qrect.h>
|
||||||
#include <QtGui/qmatrix.h>
|
|
||||||
#include <QtGui/qcolor.h>
|
#include <QtGui/qcolor.h>
|
||||||
#include <QtGui/qpixmap.h>
|
#include <QtGui/qpixmap.h>
|
||||||
#include <QtGui/qvector3d.h>
|
#include <QtGui/qvector3d.h>
|
||||||
|
|
Loading…
Reference in New Issue