diff options
Diffstat (limited to 'src/gui/kernel/qscreen.cpp')
-rw-r--r-- | src/gui/kernel/qscreen.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/gui/kernel/qscreen.cpp b/src/gui/kernel/qscreen.cpp index 7adf3db1b8..9de59f8c7e 100644 --- a/src/gui/kernel/qscreen.cpp +++ b/src/gui/kernel/qscreen.cpp @@ -71,7 +71,7 @@ QT_BEGIN_NAMESPACE */ QScreen::QScreen(QPlatformScreen *screen) - : QObject(*new QScreenPrivate(), 0) + : QObject(*new QScreenPrivate(), nullptr) { Q_D(QScreen); d->setPlatformScreen(screen); @@ -700,6 +700,25 @@ void QScreenPrivate::updatePrimaryOrientation() } /*! + Returns the screen at \a point within the set of \l QScreen::virtualSiblings(), + or \c nullptr if outside of any screen. + + The \a point is in relation to the virtualGeometry() of each set of virtual + siblings. + + \since 5.15 +*/ +QScreen *QScreen::virtualSiblingAt(const QPoint &point) +{ + const auto &siblings = virtualSiblings(); + for (QScreen *sibling : siblings) { + if (sibling->geometry().contains(point)) + return sibling; + } + return nullptr; +} + +/*! Creates and returns a pixmap constructed by grabbing the contents of the given \a window restricted by QRect(\a x, \a y, \a width, \a height). |