Do not crash if QPA plugin does not support cursors
This was the case on Android, and caused a crash Fixes: QTBUG-83916 Pick-to: 5.15 Change-Id: Iabc17237498091d815241730a2b14ece5a45d0b9 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>bb10
parent
05685708b7
commit
2a5afb88db
|
|
@ -389,7 +389,10 @@ void QTipLabel::placeTip(const QPoint &pos, QWidget *w)
|
|||
const QScreen *screen = getTipScreen(pos, w);
|
||||
// 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
|
||||
|
|
|
|||
Loading…
Reference in New Issue