[VLC 3.0.x] QT gui customization

This forum is about all development around libVLC.
reggieesp
New Cone
New Cone
Posts: 1
Joined: 21 Jun 2020 07:54

[VLC 3.0.x] QT gui customization

Postby reggieesp » 21 Jun 2020 08:51

I've created a customized version of the VLC QT playlist GUI.
As of the moment I've applied my changes in the source directly.

In order to maintain it I thought of inheriting the from the classes and do minimal modifications.


When I tried my inheritance approach I faced some issues:

Code: Select all

../../extras/package/win32/../../../modules/gui/qt/components/playlist/playlist_mod.cpp: In constructor 'PlaylistWidgetMod::PlaylistWidgetMod(intf_thread_t*, QWidget*)': ../../extras/package/win32/../../../modules/gui/qt/components/playlist/playlist_mod.cpp:52:18: error: type 'QWidget' is not a direct base of 'PlaylistWidgetMod' : QWidget( _par ), p_intf ( _p_i ) ^~~~~~~ ../../extras/package/win32/../../../modules/gui/qt/components/playlist/playlist_mod.cpp:52:49: error: no matching function for call to 'PlaylistWidget::PlaylistWidget()' : QWidget( _par ), p_intf ( _p_i ) ^
Thank you very much in advance.

See the following try of extending PlaylistWidget:

Modified class Code:
_____________________
playlist_mod.hpp

Code: Select all

... class PlaylistWidgetMod : public PlaylistWidget { Q_OBJECT public: virtual ~PlaylistWidgetMod(); void forceHide(); void forceShow(); void setSearchFieldFocus(); QStackedWidget *artContainer; StandardPLPanel *mainView; private: QSplitter *leftSplitter; QSplitter *split; PLSelector *selector; LocationBar *locationBar; SearchLineEdit *searchEdit; intf_thread_t *p_intf; protected: PlaylistWidgetMod( intf_thread_t *_p_i, QWidget * ); void dropEvent( QDropEvent *) Q_DECL_OVERRIDE; void dragEnterEvent( QDragEnterEvent * ) Q_DECL_OVERRIDE; void closeEvent( QCloseEvent * ) Q_DECL_OVERRIDE; private slots: void changeView( const QModelIndex& index ); friend class PlaylistDialog; }; ...
playlist_mod.cpp

Code: Select all

... PlaylistWidgetMod::PlaylistWidgetMod( intf_thread_t *_p_i, QWidget *_par ) : QWidget( _par ), p_intf ( _p_i ) { ...
Original class Code:
_____________________
playlist.hpp

Code: Select all

... class PlaylistWidget : public QWidget { Q_OBJECT public: virtual ~PlaylistWidget(); void forceHide(); void forceShow(); void setSearchFieldFocus(); QStackedWidget *artContainer; StandardPLPanel *mainView; private: QSplitter *leftSplitter; QSplitter *split; PLSelector *selector; LocationBar *locationBar; SearchLineEdit *searchEdit; intf_thread_t *p_intf; protected: PlaylistWidget( intf_thread_t *_p_i, QWidget * ); ...
playlist.cpp

Code: Select all

... PlaylistWidget::PlaylistWidget( intf_thread_t *_p_i, QWidget *_par ) : QWidget( _par ), p_intf ( _p_i ) { ...

chubinou
Developer
Developer
Posts: 521
Joined: 23 Jul 2015 15:19

Re: [VLC 3.0.x] QT gui customization

Postby chubinou » 22 Jun 2020 10:01

Hi,
you have PlaylistWidgetMod inheriting PlaylistWidget

Code: Select all

class PlaylistWidgetMod : public PlaylistWidget

So in your PlaylistWidgetMod constructor you should call the PlaylistWidget constructor

Code: Select all

PlaylistWidgetMod::PlaylistWidgetMod( intf_thread_t *_p_i, QWidget *_par ) : PlaylistWidget( _par ), p_intf ( _p_i ) //<----


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 7 guests