diff options
author | Peter Varga <pvarga@inf.u-szeged.hu> | 2018-01-02 16:24:05 +0100 |
---|---|---|
committer | Peter Varga <pvarga@inf.u-szeged.hu> | 2018-01-08 07:52:31 +0000 |
commit | 56fd6e23f4900bb712bf3139232eadac5b6b7223 (patch) | |
tree | aa2b12697705231ed0fab7a6fc527ebe1ec4a69b /src/webengine/ui_delegates_manager.cpp | |
parent | 9ef3a8263098c6a32db8b824aabf85587d1f1140 (diff) |
Fix backward compatibility
- Guard QTemporaryDir::filePath (5.9) usage in the drag and drop implementation.
- Guard QQuickItem::mapToGlobal (5.7) usage in the Quick context menu
implementation.
Change-Id: If383fa55fbbd1b2a3fe4abd57373598a1703786c
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/webengine/ui_delegates_manager.cpp')
-rw-r--r-- | src/webengine/ui_delegates_manager.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/webengine/ui_delegates_manager.cpp b/src/webengine/ui_delegates_manager.cpp index c9c013d52..24861fd35 100644 --- a/src/webengine/ui_delegates_manager.cpp +++ b/src/webengine/ui_delegates_manager.cpp @@ -504,7 +504,12 @@ public: if (pos.isNull() || !item->contains(pos)) return; const QPoint oldPos = QCursor::pos(); +#if (QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)) const QPoint globalPos = item->mapToGlobal(QPointF(pos)).toPoint(); +#else + const QPoint posInWindow = item->mapToItem(item->window()->contentItem(), QPointF(pos)).toPoint(); + const QPoint globalPos = item->window()->mapToGlobal(posInWindow); +#endif if (oldPos == globalPos) return; m_oldCursorPos = oldPos; |