[VLC 3.0.x] QT gui customization
Posted: 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:
Thank you very much in advance.
See the following try of extending PlaylistWidget:
Modified class Code:
_____________________
playlist_mod.hpp
playlist_mod.cpp
Original class Code:
_____________________
playlist.hpp
playlist.cpp
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 )
^
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;
};
...
Code: Select all
...
PlaylistWidgetMod::PlaylistWidgetMod( intf_thread_t *_p_i, QWidget *_par )
: QWidget( _par ), p_intf ( _p_i )
{
...
_____________________
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 * );
...
Code: Select all
...
PlaylistWidget::PlaylistWidget( intf_thread_t *_p_i, QWidget *_par )
: QWidget( _par ), p_intf ( _p_i )
{
...