Commit 615c62a7 authored by Christoph Cullmann's avatar Christoph Cullmann 🐮
Browse files

handle nullptr return of screenAt()

avoid crash if point is out of range

BUG: 439804
parent 7d83863a
Pipeline #70554 passed with stage
in 5 minutes and 51 seconds
......@@ -171,7 +171,13 @@ public:
void place(QPoint p)
{
QRect screen = QApplication::screenAt(p)->availableGeometry();
// try to get right screen, important: QApplication::screenAt(p) might return nullptr
// see crash in bug 439804
const QScreen *screenForTooltip = QApplication::screenAt(p);
if (!screenForTooltip) {
screenForTooltip = screen();
}
const QRect screen = screenForTooltip->availableGeometry();
const auto offset = QPoint(3, 21);
p += offset;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment