From e18bb1006a4686896a09268827c1c85b50555280 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Thu, 27 Jun 2013 09:45:58 +0200 Subject: [PATCH] Make mapping between Qt::CursorShape and theme name public It's of general interest as Wayland cursor uses the same theme name. --- cursor.cpp | 2 +- cursor.h | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/cursor.cpp b/cursor.cpp index 9e4796d007..efe016c6db 100644 --- a/cursor.cpp +++ b/cursor.cpp @@ -300,7 +300,7 @@ xcb_cursor_t X11Cursor::createCursor(Qt::CursorShape shape) return cursor; } -QByteArray X11Cursor::cursorName(Qt::CursorShape shape) const +QByteArray Cursor::cursorName(Qt::CursorShape shape) const { switch (shape) { case Qt::ArrowCursor: diff --git a/cursor.h b/cursor.h index f255ca596d..ab5cd9a26a 100644 --- a/cursor.h +++ b/cursor.h @@ -99,6 +99,13 @@ public: * @return int */ int themeSize() const; + /** + * @brief The name of a cursor shape in the theme. + * + * @param shape The cursor for which the name needs to be known. + * @return QByteArray + */ + QByteArray cursorName(Qt::CursorShape shape) const; /** * Returns the current cursor position. This method does an update of the mouse position if @@ -219,7 +226,6 @@ private Q_SLOTS: private: X11Cursor(QObject *parent); xcb_cursor_t createCursor(Qt::CursorShape shape); - QByteArray cursorName(Qt::CursorShape shape) const; QHash m_cursors; xcb_timestamp_t m_timeStamp; uint16_t m_buttonMask;