[vlc-devel] [PATCH v2 12/16] qt: allow passing QMainWindow window flags when creating MainInterface

Pierre Lamot pierre at videolabs.io
Fri Aug 14 18:43:46 CEST 2020


---
 modules/gui/qt/maininterface/main_interface.cpp       | 4 ++--
 modules/gui/qt/maininterface/main_interface.hpp       | 2 +-
 modules/gui/qt/maininterface/main_interface_win32.cpp | 4 ++--
 modules/gui/qt/maininterface/main_interface_win32.hpp | 2 +-
 modules/gui/qt/widgets/native/qvlcframe.hpp           | 6 +++++-
 5 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/modules/gui/qt/maininterface/main_interface.cpp b/modules/gui/qt/maininterface/main_interface.cpp
index f382a11c2f..64c4fd9ffc 100644
--- a/modules/gui/qt/maininterface/main_interface.cpp
+++ b/modules/gui/qt/maininterface/main_interface.cpp
@@ -98,8 +98,8 @@ static int IntfRaiseMainCB( vlc_object_t *p_this, const char *psz_variable,
 const QEvent::Type MainInterface::ToolbarsNeedRebuild =
         (QEvent::Type)QEvent::registerEventType();
 
-MainInterface::MainInterface( intf_thread_t *_p_intf )
-    : QVLCMW( _p_intf )
+MainInterface::MainInterface(intf_thread_t *_p_intf , QWidget* parent, Qt::WindowFlags flags)
+    : QVLCMW( _p_intf, parent, flags )
 {
     /* Variables initialisation */
     lastWinScreen        = NULL;
diff --git a/modules/gui/qt/maininterface/main_interface.hpp b/modules/gui/qt/maininterface/main_interface.hpp
index da930ba7b3..5b05f78f2c 100644
--- a/modules/gui/qt/maininterface/main_interface.hpp
+++ b/modules/gui/qt/maininterface/main_interface.hpp
@@ -74,7 +74,7 @@ class MainInterface : public QVLCMW
 
 public:
     /* tors */
-    MainInterface( intf_thread_t *);
+    MainInterface( intf_thread_t *, QWidget *parent = nullptr, Qt::WindowFlags flags = Qt::WindowFlags());
     virtual ~MainInterface();
 
     static const QEvent::Type ToolbarsNeedRebuild;
diff --git a/modules/gui/qt/maininterface/main_interface_win32.cpp b/modules/gui/qt/maininterface/main_interface_win32.cpp
index 2310814184..7b450a334d 100644
--- a/modules/gui/qt/maininterface/main_interface_win32.cpp
+++ b/modules/gui/qt/maininterface/main_interface_win32.cpp
@@ -80,8 +80,8 @@
 #define GET_FLAGS_LPARAM(lParam)      (LOWORD(lParam))
 #define GET_KEYSTATE_LPARAM(lParam)   GET_FLAGS_LPARAM(lParam)
 
-MainInterfaceWin32::MainInterfaceWin32( intf_thread_t *_p_intf )
-    : MainInterface( _p_intf )
+MainInterfaceWin32::MainInterfaceWin32(intf_thread_t *_p_intf , QWidget* parent, Qt::WindowFlags flags)
+    : MainInterface( _p_intf, parent, flags )
     , himl( NULL )
     , p_taskbl( NULL )
 {
diff --git a/modules/gui/qt/maininterface/main_interface_win32.hpp b/modules/gui/qt/maininterface/main_interface_win32.hpp
index 8efeef2c37..ae738c51b7 100644
--- a/modules/gui/qt/maininterface/main_interface_win32.hpp
+++ b/modules/gui/qt/maininterface/main_interface_win32.hpp
@@ -31,7 +31,7 @@ class MainInterfaceWin32 : public MainInterface
     Q_OBJECT
 
 public:
-    MainInterfaceWin32( intf_thread_t *p_intf );
+    MainInterfaceWin32( intf_thread_t *p_intf, QWidget *parent = nullptr, Qt::WindowFlags flags = Qt::WindowFlags() );
     virtual ~MainInterfaceWin32();
 
 private:
diff --git a/modules/gui/qt/widgets/native/qvlcframe.hpp b/modules/gui/qt/widgets/native/qvlcframe.hpp
index 5ddd024813..3f44d082a1 100644
--- a/modules/gui/qt/widgets/native/qvlcframe.hpp
+++ b/modules/gui/qt/widgets/native/qvlcframe.hpp
@@ -137,7 +137,11 @@ protected:
 class QVLCMW : public QMainWindow
 {
 public:
-    QVLCMW( intf_thread_t *_p_intf ) : QMainWindow( NULL ), p_intf( _p_intf ){}
+    QVLCMW( intf_thread_t *_p_intf,QWidget *parent = nullptr, Qt::WindowFlags flags = Qt::WindowFlags() )
+        : QMainWindow( parent, flags )
+        , p_intf( _p_intf )
+    {}
+
     void toggleVisible()
     {
         if( isVisible() ) hide();
-- 
2.25.1



More information about the vlc-devel mailing list