diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-07-01 15:23:14 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-07-02 07:34:48 +0200 |
commit | 3234188dd3745f75fdd97cb5f28b1d662d44fe60 (patch) | |
tree | 466e76718ef5e32452c52c55567ddce365f2a65d | |
parent | 09a5510001ba92744b7fa8879579d15dc1763863 (diff) |
Fix deprecation warnings about mouse event positions
Fix:
qaxserverbase.cpp:4360:27: warning: 'int QMouseEvent::x() const' is deprecated: Use position() [-Wdeprecated-declarations]
qaxserverbase.cpp:4361:27: warning: 'int QMouseEvent::y() const' is deprecated: Use position() [-Wdeprecated-declarations] ^
qaxserverbase.cpp:4377:27: warning: 'int QMouseEvent::x() const' is deprecated: Use position() [-Wdeprecated-declarations]
qaxserverbase.cpp:4378:27: warning: 'int QMouseEvent::y() const' is deprecated: Use position() [-Wdeprecated-declarations] ^
qaxserverbase.cpp:4403:27: warning: 'int QMouseEvent::x() const' is deprecated: Use position() [-Wdeprecated-declarations]
qaxserverbase.cpp:4404:27: warning: 'int QMouseEvent::y() const' is deprecated: Use position() [-Wdeprecated-declarations]
Change-Id: I8a0c4f6d83c33bd02bc8b4909332a31c281af695
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
-rw-r--r-- | src/activeqt/control/qaxserverbase.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/activeqt/control/qaxserverbase.cpp b/src/activeqt/control/qaxserverbase.cpp index 3aefc23..a4c10f9 100644 --- a/src/activeqt/control/qaxserverbase.cpp +++ b/src/activeqt/control/qaxserverbase.cpp @@ -4357,8 +4357,9 @@ bool QAxServerBase::eventFilter(QObject *o, QEvent *e) const QMouseEvent *me = static_cast<const QMouseEvent *>(e); int button = me->buttons() & Qt::MouseButtonMask; int state = mapModifiers(me->modifiers()); - int x = me->x(); - int y = me->y(); + const auto pos = me->position().toPoint(); + int x = pos.x(); + int y = pos.y(); void *argv[] = { nullptr, &button, @@ -4374,8 +4375,9 @@ bool QAxServerBase::eventFilter(QObject *o, QEvent *e) const QMouseEvent *me = static_cast<const QMouseEvent *>(e); int button = me->button(); int state = mapModifiers(me->modifiers()); - int x = me->x(); - int y = me->y(); + const auto pos = me->position().toPoint(); + int x = pos.x(); + int y = pos.y(); void *argv[] = { nullptr, &button, @@ -4400,8 +4402,9 @@ bool QAxServerBase::eventFilter(QObject *o, QEvent *e) const QMouseEvent *me = static_cast<const QMouseEvent *>(e); int button = me->button(); int state = mapModifiers(me->modifiers()); - int x = me->x(); - int y = me->y(); + const auto pos = me->position().toPoint(); + int x = pos.x(); + int y = pos.y(); void *argv[] = { nullptr, &button, |