summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qscreen.h
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2019-06-17 17:47:30 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2019-09-19 17:40:56 +0200
commitecc83677006dc7dffcd2417b1e3cff88b0615756 (patch)
treeedc31425327ff88169efdba57504ae24ab5596f1 /src/gui/kernel/qscreen.h
parente0cad1aab53119a0e47467f2236f019ce8d6da2a (diff)
Add QScreen::virtualSiblingAt() and use it in QMenubarPrivate::popupAction
QGuiApplication::screenAt() is documented "If the point maps to more than one set of virtual siblings, the first match is returned." But in many cases it's possible to start from a known screen and consider only its siblings, as when deciding where to open a QMenu from a QMenuBar: the QMenuBar is already shown on some screen(s), so the QMenu must be shown on a sibling from that set. This function should be useful in other such cases too, hence it might as well be public API. Task-number: QTBUG-76162 Change-Id: I83c74b40eb53f56fb285a6074a3dc2c0ea9c570b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/gui/kernel/qscreen.h')
-rw-r--r--src/gui/kernel/qscreen.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/gui/kernel/qscreen.h b/src/gui/kernel/qscreen.h
index 14392d3036..88925ab731 100644
--- a/src/gui/kernel/qscreen.h
+++ b/src/gui/kernel/qscreen.h
@@ -125,6 +125,7 @@ public:
QRect availableGeometry() const;
QList<QScreen *> virtualSiblings() const;
+ QScreen *virtualSiblingAt(const QPoint &point);
QSize virtualSize() const;
QRect virtualGeometry() const;