QXcbCursor: Replace deprecated QCursor API

Align with e79a625381 in qtbase.

Task-number: QTBUG-48701
Change-Id: Ia3ca2de6bbf4e9c1738f77193351dd95a14dd2dc
Reviewed-by: Liang Qi <liang.qi@qt.io>
This commit is contained in:
Sze Howe Koh 2020-01-31 19:54:03 +08:00 committed by Liang Qi
parent 34fe5f75bc
commit 6a972f44f3

View File

@ -289,10 +289,10 @@ QXcbCursorCacheKey::QXcbCursorCacheKey(const QCursor &c)
if (pixmapCacheKey) {
bitmapCacheKey = pixmapCacheKey;
} else {
Q_ASSERT(c.bitmap());
Q_ASSERT(c.mask());
bitmapCacheKey = c.bitmap()->cacheKey();
maskCacheKey = c.mask()->cacheKey();
Q_ASSERT(!c.bitmap(Qt::ReturnByValue).isNull());
Q_ASSERT(!c.mask(Qt::ReturnByValue).isNull());
bitmapCacheKey = c.bitmap(Qt::ReturnByValue).cacheKey();
maskCacheKey = c.mask(Qt::ReturnByValue).cacheKey();
}
}
}
@ -613,8 +613,8 @@ xcb_cursor_t QXcbCursor::createBitmapCursor(QCursor *cursor)
qCWarning(lcQpaXcb, "xrender >= 0.5 required to create pixmap cursors");
} else {
xcb_connection_t *conn = xcb_connection();
xcb_pixmap_t cp = qt_xcb_XPixmapFromBitmap(m_screen, cursor->bitmap()->toImage());
xcb_pixmap_t mp = qt_xcb_XPixmapFromBitmap(m_screen, cursor->mask()->toImage());
xcb_pixmap_t cp = qt_xcb_XPixmapFromBitmap(m_screen, cursor->bitmap(Qt::ReturnByValue).toImage());
xcb_pixmap_t mp = qt_xcb_XPixmapFromBitmap(m_screen, cursor->mask(Qt::ReturnByValue).toImage());
c = xcb_generate_id(conn);
xcb_create_cursor(conn, c, cp, mp, 0, 0, 0, 0xFFFF, 0xFFFF, 0xFFFF,
spot.x(), spot.y());