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>
bb10
Tor Arne Vestbø 2017-11-13 12:34:48 +01:00
parent 3e179f48fc
commit f506e01665
2 changed files with 4 additions and 2 deletions

View File

@ -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

View File

@ -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();