summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/kernel')
-rw-r--r--src/widgets/kernel/qwidget.cpp9
-rw-r--r--src/widgets/kernel/qwidget_p.h2
2 files changed, 7 insertions, 4 deletions
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index 2adbfeeb9b..8f927e8bee 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -2578,14 +2578,15 @@ void QWidgetPrivate::createWinId()
/*!
\internal
Ensures that the widget is set on the screen point is on. This is handy getting a correct
-size hint before a resize in e.g QMenu and QToolTip
+size hint before a resize in e.g QMenu and QToolTip.
+Returns if the screen was changed.
*/
-void QWidgetPrivate::setScreenForPoint(const QPoint &pos)
+bool QWidgetPrivate::setScreenForPoint(const QPoint &pos)
{
Q_Q(QWidget);
if (!q->isWindow())
- return;
+ return false;
// Find the screen for pos and make the widget undertand it is on that screen.
const QScreen *currentScreen = windowHandle() ? windowHandle()->screen() : nullptr;
QScreen *actualScreen = QGuiApplication::screenAt(pos);
@@ -2594,7 +2595,9 @@ void QWidgetPrivate::setScreenForPoint(const QPoint &pos)
createWinId();
if (windowHandle())
windowHandle()->setScreen(actualScreen);
+ return true;
}
+ return false;
}
/*!
diff --git a/src/widgets/kernel/qwidget_p.h b/src/widgets/kernel/qwidget_p.h
index 90c4c2a945..c073b8fb03 100644
--- a/src/widgets/kernel/qwidget_p.h
+++ b/src/widgets/kernel/qwidget_p.h
@@ -355,7 +355,7 @@ public:
void createRecursively();
void createWinId();
- void setScreenForPoint(const QPoint &pos);
+ bool setScreenForPoint(const QPoint &pos);
void createTLExtra();
void createExtra();