[vlc-devel] [PATCH 17/27] qt: add setCursor and restoreCursor functions to main_interface

Fatih Uzunoglu fuzun54 at outlook.com
Fri Dec 4 00:01:52 CET 2020


These functions allow controlling the mouse cursor globally.
---
 modules/gui/qt/maininterface/main_interface.hpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/modules/gui/qt/maininterface/main_interface.hpp b/modules/gui/qt/maininterface/main_interface.hpp
index 4ec9c3a04e..5a0d4e893d 100644
--- a/modules/gui/qt/maininterface/main_interface.hpp
+++ b/modules/gui/qt/maininterface/main_interface.hpp
@@ -202,6 +202,9 @@ public:
     VideoSurfaceProvider* getVideoSurfaceProvider() const;
     void setVideoSurfaceProvider(VideoSurfaceProvider* videoSurfaceProvider);;
 
+    Q_INVOKABLE static inline void setCursor(Qt::CursorShape cursor) { QApplication::setOverrideCursor(QCursor(cursor)); };
+    Q_INVOKABLE static inline void restoreCursor(void) { QApplication::restoreOverrideCursor(); };
+
 protected:
     void dropEventPlay( QDropEvent* event, bool b_play );
     void dropEvent( QDropEvent *) Q_DECL_OVERRIDE;
-- 
2.27.0



More information about the vlc-devel mailing list