[vlc-commits] [Git][videolan/vlc][master] 2 commits: qt: add `setCursor(QQuickItem*, Qt::CursorShape)` and `unsetCursor(QQuickItem*)` to MainCtx
Steve Lhomme (@robUx4)
gitlab at videolan.org
Mon Jul 29 14:44:16 UTC 2024
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
9e322707 by Fatih Uzunoglu at 2024-07-29T14:30:01+00:00
qt: add `setCursor(QQuickItem*, Qt::CursorShape)` and `unsetCursor(QQuickItem*)` to MainCtx
These are not exposed to QML at the moment.
- - - - -
f20e1c2c by Fatih Uzunoglu at 2024-07-29T14:30:01+00:00
qml: set playlist view's cursor to busy cursor when it is busy
- - - - -
3 changed files:
- modules/gui/qt/maininterface/mainctx.hpp
- modules/gui/qt/medialibrary/qml/PlaylistMediaDisplay.qml
- modules/gui/qt/medialibrary/qml/PlaylistMediaList.qml
Changes:
=====================================
modules/gui/qt/maininterface/mainctx.hpp
=====================================
@@ -246,6 +246,9 @@ public:
Q_INVOKABLE static inline void setCursor(Qt::CursorShape cursor) { QApplication::setOverrideCursor(QCursor(cursor)); }
Q_INVOKABLE static inline void restoreCursor(void) { QApplication::restoreOverrideCursor(); }
+ Q_INVOKABLE static inline void setCursor(QQuickItem* item, Qt::CursorShape cursor) { assert(item); item->setCursor(cursor); }
+ Q_INVOKABLE static inline void unsetCursor(QQuickItem* item) { assert(item); item->unsetCursor(); };
+
Q_INVOKABLE static /*constexpr*/ inline unsigned int qtVersion() { return QT_VERSION; }
Q_INVOKABLE static /*constexpr*/ inline unsigned int qtVersionCheck(unsigned char major,
unsigned char minor,
=====================================
modules/gui/qt/medialibrary/qml/PlaylistMediaDisplay.qml
=====================================
@@ -151,6 +151,13 @@ FocusScope {
text: qsTr("Processing...")
+ onVisibleChanged: {
+ if (visible)
+ MainCtx.setCursor(root, Qt.BusyCursor)
+ else
+ MainCtx.unsetCursor(root)
+ }
+
Timer {
id: visibilityTimer
=====================================
modules/gui/qt/medialibrary/qml/PlaylistMediaList.qml
=====================================
@@ -202,6 +202,13 @@ MainViewLoader {
text: qsTr("Processing...")
+ onVisibleChanged: {
+ if (visible)
+ MainCtx.setCursor(root, Qt.BusyCursor)
+ else
+ MainCtx.unsetCursor(root)
+ }
+
Timer {
id: visibilityTimer
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/8d64f43f0e6eb4747cc18dade44e00c33a0ab951...f20e1c2c879ded12ecca9f89ea210a2c711eb613
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/8d64f43f0e6eb4747cc18dade44e00c33a0ab951...f20e1c2c879ded12ecca9f89ea210a2c711eb613
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list