summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel/qtooltip.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/kernel/qtooltip.cpp')
-rw-r--r--src/widgets/kernel/qtooltip.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/widgets/kernel/qtooltip.cpp b/src/widgets/kernel/qtooltip.cpp
index 661568dcad..0f7bc97c1f 100644
--- a/src/widgets/kernel/qtooltip.cpp
+++ b/src/widgets/kernel/qtooltip.cpp
@@ -334,7 +334,7 @@ bool QTipLabel::eventFilter(QObject *o, QEvent *e)
break;
-#if defined (Q_OS_QNX) // On QNX the window activate and focus events are delayed and will appear
+#if defined (Q_OS_QNX) || defined (Q_OS_WASM) // On QNX the window activate and focus events are delayed and will appear
// after the window is shown.
case QEvent::WindowActivate:
case QEvent::FocusIn:
@@ -406,7 +406,10 @@ void QTipLabel::placeTip(const QPoint &pos, QWidget *w)
QGuiApplication::primaryScreen());
// a QScreen's handle *should* never be null, so this is a bit paranoid
if (const QPlatformScreen *platformScreen = screen ? screen->handle() : nullptr) {
- const QSize cursorSize = QHighDpi::fromNativePixels(platformScreen->cursor()->size(),
+ QPlatformCursor *cursor = platformScreen->cursor();
+ // default implementation of QPlatformCursor::size() returns QSize(16, 16)
+ const QSize nativeSize = cursor ? cursor->size() : QSize(16, 16);
+ const QSize cursorSize = QHighDpi::fromNativePixels(nativeSize,
platformScreen);
QPoint offset(2, cursorSize.height());
// assuming an arrow shape, we can just move to the side for very large cursors