summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2017-11-13 12:34:48 +0100
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2017-11-17 21:17:20 +0000
commitf506e01665c9bf689887ccf057a03588829efeea (patch)
tree8d373690ecb239beafd98cd0250cc387ea06eaf6
parent3e179f48fc8f119ca3061442ade846168baf7dad (diff)
Remove a few more uses of deprecated QDesktopWidget APIs
Change-Id: I3834ba7ce8f9bd7026f3d59f15d268b4c03e364a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
-rw-r--r--src/widgets/kernel/qtooltip.cpp3
-rw-r--r--src/widgets/widgets/qmenu.cpp3
2 files changed, 4 insertions, 2 deletions
diff --git a/src/widgets/kernel/qtooltip.cpp b/src/widgets/kernel/qtooltip.cpp
index f30a83611d..69b62ff7d7 100644
--- a/src/widgets/kernel/qtooltip.cpp
+++ b/src/widgets/kernel/qtooltip.cpp
@@ -501,7 +501,10 @@ void QToolTip::showText(const QPoint &pos, const QString &text, QWidget *w, cons
#ifdef Q_OS_WIN32
// On windows, we can't use the widget as parent otherwise the window will be
// raised when the tooltip will be shown
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
new QTipLabel(text, QApplication::desktop()->screen(QTipLabel::getTipScreen(pos, w)), msecDisplayTime);
+QT_WARNING_POP
#else
new QTipLabel(text, w, msecDisplayTime); // sets QTipLabel::instance to itself
#endif
diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp
index e26742f75e..cf6167bace 100644
--- a/src/widgets/widgets/qmenu.cpp
+++ b/src/widgets/widgets/qmenu.cpp
@@ -862,8 +862,7 @@ void QMenuPrivate::adjustMenuScreen(const QPoint &p)
// so a wrong screen would often cause wrong sizes (on high DPI)
const QScreen *primaryScreen = QApplication::primaryScreen();
const QScreen *currentScreen = q->windowHandle() ? q->windowHandle()->screen() : primaryScreen;
- const int screenNumberForPoint = QApplication::desktop()->screenNumber(p);
- QScreen *actualScreen = QGuiApplication::screens().at(screenNumberForPoint);
+ QScreen *actualScreen = QGuiApplication::screenAt(p);
if (actualScreen && currentScreen != actualScreen) {
if (!q->windowHandle()) // Try to create a window handle if not created.
createWinId();