From 15846818971846ab0780e4d667a1f8e4d9761cb7 Mon Sep 17 00:00:00 2001
From: Lyndon Brown <jnqnfe@gmail.com>
Date: Tue, 18 May 2021 02:42:30 +0100
Subject: [PATCH 01/33] qt: (hotkeys) fix non-bold wheel event name

in the 'selected' text, inconsistent with that done for keyboard events.

(cherry picked from commit 068f5d0d01eb75325d77f0717c057dadceb971e8) (edited)
edited:
- the file was moved in 4.0
- 4.0 uses an internal vlckey_tr variable
---
 modules/gui/qt/components/preferences_widgets.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/gui/qt/components/preferences_widgets.cpp b/modules/gui/qt/components/preferences_widgets.cpp
index ef15ee23503b..ad2f2309705d 100644
--- a/modules/gui/qt/components/preferences_widgets.cpp
+++ b/modules/gui/qt/components/preferences_widgets.cpp
@@ -1497,7 +1497,7 @@ void KeyInputDialog::keyPressEvent( QKeyEvent *e )
 void KeyInputDialog::wheelEvent( QWheelEvent *e )
 {
     int i_vlck = qtWheelEventToVLCKey( e );
-    selected->setText( qtr( "Key: " ) + VLCKeyToString( i_vlck, true ) );
+    selected->setText( qtr( "Key: " ) + QString("<b>%1</b>").arg( VLCKeyToString( i_vlck, true ) ) );
     checkForConflicts( i_vlck, QString() );
     keyValue = i_vlck;
 }
-- 
GitLab


From f587f532e77e67388b1321857e6af9e34c1aa592 Mon Sep 17 00:00:00 2001
From: Lyndon Brown <jnqnfe@gmail.com>
Date: Thu, 20 May 2021 19:07:59 +0100
Subject: [PATCH 02/33] qt: (hotkeys) improve translatability of strings

(cherry picked from commit 0289edadff52734c2509ee62364507a09205c492) (edited)
edited:
- the file was moved in 4.0
- 4.0 uses an internal vlckey_tr variable
- 4.0 had the .arg() already on the next line
---
 .../gui/qt/components/preferences_widgets.cpp  | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/modules/gui/qt/components/preferences_widgets.cpp b/modules/gui/qt/components/preferences_widgets.cpp
index ad2f2309705d..07eaf4cd661c 100644
--- a/modules/gui/qt/components/preferences_widgets.cpp
+++ b/modules/gui/qt/components/preferences_widgets.cpp
@@ -1404,13 +1404,13 @@ KeyInputDialog::KeyInputDialog( QTreeWidget *_table,
     existingkeys = NULL;
 
     table = _table;
-    setWindowTitle( ( b_global ? qtr( "Global" ) + QString(" ") : "" )
-                    + qtr( "Hotkey change" ) );
+    setWindowTitle( b_global ? qtr( "Global Hotkey change" )
+                             : qtr( "Hotkey change" ) );
     setWindowRole( "vlc-key-input" );
 
     QVBoxLayout *vLayout = new QVBoxLayout( this );
-    selected = new QLabel( qtr( "Press the new key or combination for " )
-                           + QString("<b>%1</b>").arg( keyToChange ) );
+    selected = new QLabel( qtr( "Press the new key or combination for <b>%1</b>" )
+                           .arg( keyToChange ) );
     vLayout->addWidget( selected , Qt::AlignCenter );
 
     warning = new QLabel;
@@ -1453,8 +1453,9 @@ void KeyInputDialog::checkForConflicts( int i_vlckey, const QString &sequence )
         !conflictList[0]->data( b_global ? 2 : 1, Qt::UserRole ).toString().isEmpty() &&
          conflictList[0]->data( b_global ? 2 : 1, Qt::UserRole ).toString() != "Unset" )
     {
-        warning->setText( qtr("Warning: this key or combination is already assigned to ") +
-                QString( "\"<b>%1</b>\"" ).arg( conflictList[0]->text( 0 ) ) );
+        warning->setText(
+                qtr("Warning: this key or combination is already assigned to \"<b>%1</b>\"")
+                .arg( conflictList[0]->text( 0 ) ) );
         warning->show();
         ok->show();
         unset->hide();
@@ -1488,8 +1489,7 @@ void KeyInputDialog::keyPressEvent( QKeyEvent *e )
         return;
     int i_vlck = qtEventToVLCKey( e );
     QKeySequence sequence( e->key() | e->modifiers() );
-    selected->setText( qtr( "Key or combination: " )
-                + QString("<b>%1</b>").arg( VLCKeyToString( i_vlck, true ) ) );
+    selected->setText( qtr( "Key or combination: <b>%1</b>" ).arg( VLCKeyToString( i_vlck, true ) ) );
     checkForConflicts( i_vlck, sequence.toString() );
     keyValue = i_vlck;
 }
@@ -1497,7 +1497,7 @@ void KeyInputDialog::keyPressEvent( QKeyEvent *e )
 void KeyInputDialog::wheelEvent( QWheelEvent *e )
 {
     int i_vlck = qtWheelEventToVLCKey( e );
-    selected->setText( qtr( "Key: " ) + QString("<b>%1</b>").arg( VLCKeyToString( i_vlck, true ) ) );
+    selected->setText( qtr( "Key: <b>%1</b>" ).arg( VLCKeyToString( i_vlck, true ) ) );
     checkForConflicts( i_vlck, QString() );
     keyValue = i_vlck;
 }
-- 
GitLab


From 0f393730a7044279395ff7091d2e0429f83e1d7f Mon Sep 17 00:00:00 2001
From: Steve Lhomme <robux4@ycbcr.xyz>
Date: Wed, 5 Feb 2025 13:01:28 +0100
Subject: [PATCH 03/33] qt: keep the module name as a QString

So we don't have to release it manually.

This should be backported as Qt5 with QT_USE_QSTRINGBUILDER
doesn't like the + in onUpdate().
For some reason Qt6 is OK with that.
---
 modules/gui/qt/components/preferences_widgets.cpp | 6 ++----
 modules/gui/qt/components/preferences_widgets.hpp | 2 +-
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/modules/gui/qt/components/preferences_widgets.cpp b/modules/gui/qt/components/preferences_widgets.cpp
index 07eaf4cd661c..08ca74c4cf2a 100644
--- a/modules/gui/qt/components/preferences_widgets.cpp
+++ b/modules/gui/qt/components/preferences_widgets.cpp
@@ -622,8 +622,6 @@ void ModuleListConfigControl::fillGrid( QGridLayout *l, int line )
 
 ModuleListConfigControl::~ModuleListConfigControl()
 {
-    foreach ( checkBoxListItem *it, modules )
-        free( it->psz_module );
     qDeleteAll( modules );
     modules.clear();
     delete groupBox;
@@ -653,10 +651,10 @@ void ModuleListConfigControl::checkbox_lists( QString label, QString help, const
         cb->setToolTip( formatTooltip( help ) );
     cbl->checkBox = cb;
 
-    cbl->psz_module = strdup( psz_module );
+    cbl->psz_module = qfu( psz_module );
     modules.append( cbl );
 
-    if( p_item->value.psz && strstr( p_item->value.psz, cbl->psz_module ) )
+    if( p_item->value.psz && strstr( p_item->value.psz, psz_module ) )
         cbl->checkBox->setChecked( true );
 }
 
diff --git a/modules/gui/qt/components/preferences_widgets.hpp b/modules/gui/qt/components/preferences_widgets.hpp
index aa27563b1bf3..a40825afbc74 100644
--- a/modules/gui/qt/components/preferences_widgets.hpp
+++ b/modules/gui/qt/components/preferences_widgets.hpp
@@ -407,7 +407,7 @@ private:
 
 struct checkBoxListItem {
     QCheckBox *checkBox;
-    char *psz_module;
+    QString   psz_module;
 };
 
 class ModuleListConfigControl : public VStringConfigControl
-- 
GitLab


From 9debc6f5d349f941dd6cf29824467018ca1ea124 Mon Sep 17 00:00:00 2001
From: Steve Lhomme <robux4@ycbcr.xyz>
Date: Wed, 5 Feb 2025 09:52:36 +0100
Subject: [PATCH 04/33] qt: use QString::fromWCharArray() to translate widows
 WCHAR strings

No need to translate to UTF-8 first (which is also not used as such later).
---
 modules/gui/qt/components/open_panels.cpp | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/modules/gui/qt/components/open_panels.cpp b/modules/gui/qt/components/open_panels.cpp
index 5463af507810..61d2359b52bc 100644
--- a/modules/gui/qt/components/open_panels.cpp
+++ b/modules/gui/qt/components/open_panels.cpp
@@ -39,9 +39,6 @@
 #include <vlc_intf_strings.h>
 #include <vlc_modules.h>
 #include <vlc_plugin.h>
-#ifdef _WIN32
-  #include <vlc_charset.h> /* FromWide for Win32 */
-#endif
 
 #include <QFileDialog>
 #include <QDialogButtonBox>
@@ -381,16 +378,14 @@ void DiscOpenPanel::onFocus()
                 wchar_t psz_name[512] = L"";
                 GetVolumeInformationW( drive, psz_name, 511, NULL, NULL, NULL, NULL, 0 );
 
-                char *psz_drive = FromWide( drive );
+                QString psz_drive = QString::fromWCharArray( drive );
                 QString displayName = psz_drive;
-                char *psz_title = FromWide( psz_name );
-                if( !EMPTY_STR(psz_title)) {
+                QString psz_title = QString::fromWCharArray( psz_name );
+                if( !psz_title.isEmpty()) {
                     displayName = displayName + " - "  + psz_title;
                 }
 
-                ui.deviceCombo->addItem( displayName, qfu(psz_drive) );
-                free( psz_drive );
-                free( psz_title );
+                ui.deviceCombo->addItem( displayName, psz_drive );
             }
 
             /* go to next drive */
-- 
GitLab


From 8e179cf17ffca4f003949aba964c1ed3229902a3 Mon Sep 17 00:00:00 2001
From: Marvin Scholz <epirat07@gmail.com>
Date: Fri, 26 Jul 2019 21:32:46 +0200
Subject: [PATCH 05/33] qt: add missing override specifier

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
(cherry picked from commit 52d261a014748f7aa404df0be437af31cda27bf5) (edited)
edited:
- 3.0 doesn't have setupVoutWindow() in components/voutwindow/qvoutwindowdummy.hpp
---
 modules/gui/qt/components/extended_panels.hpp | 2 +-
 modules/gui/qt/dialogs/plugins.hpp            | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/gui/qt/components/extended_panels.hpp b/modules/gui/qt/components/extended_panels.hpp
index 87cba5de39a5..c8d92381fe5c 100644
--- a/modules/gui/qt/components/extended_panels.hpp
+++ b/modules/gui/qt/components/extended_panels.hpp
@@ -165,7 +165,7 @@ protected:
     float initialValue() Q_DECL_OVERRIDE;
     int index;
     QStringList getBandsFromAout() const;
-    void writeToConfig();
+    void writeToConfig() override;
 
 public slots:
     void onValueChanged( int i ) Q_DECL_OVERRIDE;
diff --git a/modules/gui/qt/dialogs/plugins.hpp b/modules/gui/qt/dialogs/plugins.hpp
index a0da1073c04a..390152a9f4a3 100644
--- a/modules/gui/qt/dialogs/plugins.hpp
+++ b/modules/gui/qt/dialogs/plugins.hpp
@@ -143,7 +143,7 @@ private slots:
 private:
     AddonsTab( intf_thread_t *p_intf );
     virtual ~AddonsTab();
-    bool eventFilter ( QObject * watched, QEvent * event );
+    bool eventFilter ( QObject * watched, QEvent * event ) override;
 
     enum
     {
-- 
GitLab


From be555b59f1048238afcf87964b5c6d78390891fa Mon Sep 17 00:00:00 2001
From: Lyndon Brown <jnqnfe@gmail.com>
Date: Sun, 6 Mar 2022 05:57:28 +0000
Subject: [PATCH 06/33] qt: check cdda module exists before handling cdda
 specific option

Fixes #26492.

(cherry picked from commit fdf0eaa4fcbcda71017d0ef528b310774b35a2a2) (edited)
edited:
- the file was moved in 4.0
- 3.0 uses p_intf with config_GetPsz()
---
 .../gui/qt/components/simple_preferences.cpp  | 26 +++++++++++--------
 1 file changed, 15 insertions(+), 11 deletions(-)

diff --git a/modules/gui/qt/components/simple_preferences.cpp b/modules/gui/qt/components/simple_preferences.cpp
index 5e138c962824..3e96c8915fd1 100644
--- a/modules/gui/qt/components/simple_preferences.cpp
+++ b/modules/gui/qt/components/simple_preferences.cpp
@@ -642,18 +642,21 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
                          "for DVD, VCD, and CDDA are set.\n"
                          "You can define a unique one or configure them \n"
                          "individually in the advanced preferences." ) );
-                char *psz_dvddiscpath = config_GetPsz( p_intf, "dvd" );
-                char *psz_vcddiscpath = config_GetPsz( p_intf, "vcd" );
-                char *psz_cddadiscpath = config_GetPsz( p_intf, "cd-audio" );
-                if( psz_dvddiscpath && psz_vcddiscpath && psz_cddadiscpath )
-                if( !strcmp( psz_cddadiscpath, psz_dvddiscpath ) &&
-                    !strcmp( psz_dvddiscpath, psz_vcddiscpath ) )
+                bool have_cdda = module_exists( "cdda" );
+                char *dvd_discpath = config_GetPsz( p_intf, "dvd" );
+                char *vcd_discpath = config_GetPsz( p_intf, "vcd" );
+                char *cdda_discpath = have_cdda ? config_GetPsz( p_intf, "cd-audio" ) : nullptr;
+                if( dvd_discpath && vcd_discpath && ( !have_cdda || cdda_discpath ) )
                 {
-                    ui.DVDDeviceComboBox->setEditText( qfu( psz_dvddiscpath ) );
+                    if( !strcmp( dvd_discpath, vcd_discpath ) &&
+                        ( !have_cdda || !strcmp( cdda_discpath, dvd_discpath ) ) )
+                    {
+                        ui.DVDDeviceComboBox->setEditText( qfu( dvd_discpath ) );
+                    }
                 }
-                free( psz_cddadiscpath );
-                free( psz_dvddiscpath );
-                free( psz_vcddiscpath );
+                free( cdda_discpath );
+                free( dvd_discpath );
+                free( vcd_discpath );
             }
 #ifndef _WIN32
             QStringList DVDDeviceComboBoxStringList = QStringList();
@@ -1094,7 +1097,8 @@ void SPrefsPanel::apply()
         {
             config_PutPsz( p_intf, "dvd", devicepath );
             config_PutPsz( p_intf, "vcd", devicepath );
-            config_PutPsz( p_intf, "cd-audio", devicepath );
+            if( module_exists( "cdda" ) )
+                config_PutPsz( p_intf, "cd-audio", devicepath );
         }
 
 #define CaC( name, factor ) config_PutInt( p_intf, name, i_comboValue * factor )
-- 
GitLab


From 73c46850e898faa9fa19aabac83c161dc2054960 Mon Sep 17 00:00:00 2001
From: Johannes Kauffmann <johanneskauffmann@hotmail.com>
Date: Fri, 26 Aug 2022 21:56:23 +0000
Subject: [PATCH 07/33] qt: purge remaining use of Q_DECL_OVERRIDE

(cherry picked from commit 258921fd9eb54275a0b25806c800bf039f082002) (edited)
edited:
- many files were moved in 4.0
---
 modules/gui/qt/components/extended_panels.hpp | 8 ++++----
 modules/gui/qt/components/info_panels.hpp     | 2 +-
 modules/gui/qt/dialogs/extensions.hpp         | 4 ++--
 modules/gui/qt/dialogs/gototime.hpp           | 4 ++--
 modules/gui/qt/dialogs/mediainfo.hpp          | 2 +-
 modules/gui/qt/dialogs/openurl.hpp            | 4 ++--
 modules/gui/qt/dialogs/vlm.hpp                | 2 +-
 modules/gui/qt/util/validators.hpp            | 4 ++--
 8 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/modules/gui/qt/components/extended_panels.hpp b/modules/gui/qt/components/extended_panels.hpp
index c8d92381fe5c..34fb63952f26 100644
--- a/modules/gui/qt/components/extended_panels.hpp
+++ b/modules/gui/qt/components/extended_panels.hpp
@@ -74,7 +74,7 @@ class ExtV4l2 : public QWidget
 public:
     ExtV4l2( intf_thread_t *, QWidget * );
 
-    void showEvent( QShowEvent *event ) Q_DECL_OVERRIDE;
+    void showEvent( QShowEvent *event ) override;
 
 private:
     intf_thread_t *p_intf;
@@ -162,13 +162,13 @@ public:
                          const slider_data_t *p_data, int index );
 
 protected:
-    float initialValue() Q_DECL_OVERRIDE;
+    float initialValue() override;
     int index;
     QStringList getBandsFromAout() const;
     void writeToConfig() override;
 
 public slots:
-    void onValueChanged( int i ) Q_DECL_OVERRIDE;
+    void onValueChanged( int i ) override;
 };
 
 class Equalizer: public AudioFilterControlWidget
@@ -179,7 +179,7 @@ public:
     Equalizer( intf_thread_t *, QWidget * );
 
 protected:
-    void build() Q_DECL_OVERRIDE;
+    void build() override;
 
 private:
     FilterSliderData *preamp;
diff --git a/modules/gui/qt/components/info_panels.hpp b/modules/gui/qt/components/info_panels.hpp
index 1490425dd3b6..c5549f70c88f 100644
--- a/modules/gui/qt/components/info_panels.hpp
+++ b/modules/gui/qt/components/info_panels.hpp
@@ -113,7 +113,7 @@ class InputStatsPanel: public QWidget
 public:
     InputStatsPanel( QWidget * );
 protected:
-    void hideEvent( QHideEvent * ) Q_DECL_OVERRIDE;
+    void hideEvent( QHideEvent * ) override;
 private:
     QTreeWidget *StatsTree;
     QTreeWidgetItem *input;
diff --git a/modules/gui/qt/dialogs/extensions.hpp b/modules/gui/qt/dialogs/extensions.hpp
index 2894aa9ff8d5..05f2b7ab66c5 100644
--- a/modules/gui/qt/dialogs/extensions.hpp
+++ b/modules/gui/qt/dialogs/extensions.hpp
@@ -105,8 +105,8 @@ private:
     void DestroyWidget( extension_widget_t *p_widget, bool b_cond = true );
 
 protected:
-    void closeEvent( QCloseEvent* ) Q_DECL_OVERRIDE;
-    void keyPressEvent( QKeyEvent* ) Q_DECL_OVERRIDE;
+    void closeEvent( QCloseEvent* ) override;
+    void keyPressEvent( QKeyEvent* ) override;
 
 private slots:
     int TriggerClick( QObject *object );
diff --git a/modules/gui/qt/dialogs/gototime.hpp b/modules/gui/qt/dialogs/gototime.hpp
index 9f980b221a8a..79c55486efdd 100644
--- a/modules/gui/qt/dialogs/gototime.hpp
+++ b/modules/gui/qt/dialogs/gototime.hpp
@@ -37,8 +37,8 @@ private:
     virtual ~GotoTimeDialog();
     QTimeEdit *timeEdit;
 private slots:
-    void close() Q_DECL_OVERRIDE;
-    void cancel() Q_DECL_OVERRIDE;
+    void close() override;
+    void cancel() override;
     void reset();
 
     friend class    Singleton<GotoTimeDialog>;
diff --git a/modules/gui/qt/dialogs/mediainfo.hpp b/modules/gui/qt/dialogs/mediainfo.hpp
index 34a40c316b67..f2f266bb4f93 100644
--- a/modules/gui/qt/dialogs/mediainfo.hpp
+++ b/modules/gui/qt/dialogs/mediainfo.hpp
@@ -71,7 +71,7 @@ private slots:
     void updateAllTabs( input_item_t * );
     void clearAllTabs();
 
-    void close() Q_DECL_OVERRIDE;
+    void close() override;
 
     void saveMeta();
     void updateButtons( int i_tab );
diff --git a/modules/gui/qt/dialogs/openurl.hpp b/modules/gui/qt/dialogs/openurl.hpp
index d1d84b04f13c..baaaf26503ca 100644
--- a/modules/gui/qt/dialogs/openurl.hpp
+++ b/modules/gui/qt/dialogs/openurl.hpp
@@ -53,10 +53,10 @@ public:
 
     QString url() const;
     bool shouldEnqueue() const;
-    void showEvent( QShowEvent *ev ) Q_DECL_OVERRIDE;
+    void showEvent( QShowEvent *ev ) override;
 
 public slots:
-    void close() Q_DECL_OVERRIDE { play(); }
+    void close() override { play(); }
 
 };
 
diff --git a/modules/gui/qt/dialogs/vlm.hpp b/modules/gui/qt/dialogs/vlm.hpp
index 2983115c148b..a1cb42c07578 100644
--- a/modules/gui/qt/dialogs/vlm.hpp
+++ b/modules/gui/qt/dialogs/vlm.hpp
@@ -181,7 +181,7 @@ public:
     VLMBroadcast( VLMWrapper *, const QString& name, const QString& input,
                   const QString& inputOptions, const QString& output,
                   bool _enable, bool _loop, VLMDialog *parent );
-    void update() Q_DECL_OVERRIDE;
+    void update() override;
 private:
     bool b_looped;
     bool b_playing;
diff --git a/modules/gui/qt/util/validators.hpp b/modules/gui/qt/util/validators.hpp
index 3375ee8f9a82..b08262bfa216 100644
--- a/modules/gui/qt/util/validators.hpp
+++ b/modules/gui/qt/util/validators.hpp
@@ -30,8 +30,8 @@ class UrlValidator : public QValidator
    Q_OBJECT
 public:
    UrlValidator( QObject *parent ) : QValidator( parent ) { }
-   QValidator::State validate( QString&, int& ) const Q_DECL_OVERRIDE;
-   void fixup ( QString & input ) const Q_DECL_OVERRIDE;
+   QValidator::State validate( QString&, int& ) const override;
+   void fixup ( QString & input ) const override;
 };
 
 #endif // VALIDATORS_HPP
-- 
GitLab


From c84df57e5226c38eb31e593a90f0dc2b1fe11d52 Mon Sep 17 00:00:00 2001
From: Fatih Uzunoglu <fuzun54@outlook.com>
Date: Fri, 8 Sep 2023 15:46:52 +0300
Subject: [PATCH 08/33] qt: proper format handling for indeterministic integer
 type

(cherry picked from commit 283b2b483802a6369347477f51c68068268cce20) (edited)
edited:
- the file was moved in 4.0
---
 modules/gui/qt/dialogs/open.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/modules/gui/qt/dialogs/open.cpp b/modules/gui/qt/dialogs/open.cpp
index bbfce715bf86..4c0b7900927d 100644
--- a/modules/gui/qt/dialogs/open.cpp
+++ b/modules/gui/qt/dialogs/open.cpp
@@ -32,6 +32,8 @@
 #include <QRegularExpression>
 #include <QMenu>
 
+#include <cstddef>
+
 #ifndef NDEBUG
 # define DEBUG_QT 1
 #endif
@@ -411,7 +413,7 @@ void OpenDialog::stream( bool b_transcode_only )
     toggleVisible();
 
     /* Dbg and send :D */
-    msg_Dbg( p_intf, "MRL(s) passed to the Sout: %i", soutMRLS.length() );
+    msg_Dbg( p_intf, "MRL(s) passed to the Sout: %zu", static_cast<size_t>( soutMRLS.length() ) );
     for(int i = 0; i < soutMRLS.length(); i++)
     {
         msg_Dbg( p_intf, "MRL(s) passed to the Sout: %s", qtu( soutMRLS[i] ) );
-- 
GitLab


From 5978c61b79231f5a5e8974cc5872fd93efbfda8f Mon Sep 17 00:00:00 2001
From: Fatih Uzunoglu <fuzun54@outlook.com>
Date: Tue, 22 Oct 2024 17:22:50 +0300
Subject: [PATCH 09/33] qt: use QT_USE_QSTRINGBUILDER

(cherry picked from commit 0450706563e262c5728ff159241ec276fc359969) (edited)
edited:
- 3.0 doesn't have meson
- the CPP flags are different on 3.0
---
 modules/gui/qt/Makefile.am         | 1 +
 modules/gui/qt/dialogs/convert.cpp | 4 ++--
 modules/gui/qt/dialogs/help.cpp    | 2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/modules/gui/qt/Makefile.am b/modules/gui/qt/Makefile.am
index c67f4afc1387..8af171eee0fa 100644
--- a/modules/gui/qt/Makefile.am
+++ b/modules/gui/qt/Makefile.am
@@ -12,6 +12,7 @@
 SUFFIXES += .ui .h .hpp .moc.cpp
 
 libqt_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) \
+	-DQT_USE_QSTRINGBUILDER \
 	-I$(srcdir)/gui/qt -I$(builddir)/gui/qt
 libqt_plugin_la_CXXFLAGS = $(AM_CXXFLAGS) $(QT_CFLAGS) $(CXXFLAGS_qt)
 libqt_plugin_la_LIBADD = $(QT_LIBS) $(LIBS_qt) $(LIBM)
diff --git a/modules/gui/qt/dialogs/convert.cpp b/modules/gui/qt/dialogs/convert.cpp
index 8a87518fa942..20dd643cc42f 100644
--- a/modules/gui/qt/dialogs/convert.cpp
+++ b/modules/gui/qt/dialogs/convert.cpp
@@ -156,7 +156,7 @@ ConvertDialog::ConvertDialog( QWidget *parent, intf_thread_t *_p_intf,
 
 void ConvertDialog::fileBrowse()
 {
-    QString fileExtension = ( ! profile->isEnabled() ) ? ".*" : "." + profile->getMux();
+    QString fileExtension = ( ! profile->isEnabled() ) ? QStringLiteral(".*") : QStringLiteral(".") + profile->getMux();
 
     outgoingMRL = QFileDialog::getSaveFileUrl( this, qtr( "Save file..." ),
         p_intf->p_sys->filepath,
@@ -208,7 +208,7 @@ void ConvertDialog::close()
             // Multiple, use the convention.
             else
             {
-                QString fileExtension = ( ! profile->isEnabled() ) ? ".*" : "." + profile->getMux();
+                QString fileExtension = ( ! profile->isEnabled() ) ? QStringLiteral(".*") : QStringLiteral(".") + profile->getMux();
 
                 newFileName = incomingMRLs->at(i);
 
diff --git a/modules/gui/qt/dialogs/help.cpp b/modules/gui/qt/dialogs/help.cpp
index 5a78d1a71b0a..6244e3bd1fea 100644
--- a/modules/gui/qt/dialogs/help.cpp
+++ b/modules/gui/qt/dialogs/help.cpp
@@ -306,7 +306,7 @@ void UpdateDialog::updateNotify( bool b_result )
                 .arg( QString::number( p_release->i_major ) )
                 .arg( QString::number( p_release->i_minor ) )
                 .arg( QString::number( p_release->i_revision ) )
-                .arg( p_release->i_extra == 0 ? "" : "." + QString::number( p_release->i_extra ) );
+                .arg( p_release->i_extra == 0 ? QStringLiteral("") : QStringLiteral(".") + QString::number( p_release->i_extra ) );
 
             ui.updateNotifyLabel->setText( message );
             message = qfu( p_release->psz_desc ).replace( "\n", "<br/>" );
-- 
GitLab


From 113a0e61ececa5ba75f94e0104805a457b8c7fc8 Mon Sep 17 00:00:00 2001
From: Fatih Uzunoglu <fuzun54@outlook.com>
Date: Tue, 22 Oct 2024 16:45:32 +0300
Subject: [PATCH 10/33] qt: define QT_NO_CAST_FROM_BYTEARRAY

It is dangerous to have implicit casting between
QByteArray and pointer types.

(cherry picked from commit 18f4f954ae044089df4b95d37eb874e9a8629417) (edited)
edited:
- 3.0 doesn't have meson
- the CPP flags are different on 3.0
- 3.0 uses p_intf with config_PutPsz()
- some files modified in 4.0 don't exist on 3.0
---
 modules/gui/qt/Makefile.am                       | 1 +
 modules/gui/qt/components/simple_preferences.cpp | 6 +++---
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/modules/gui/qt/Makefile.am b/modules/gui/qt/Makefile.am
index 8af171eee0fa..e97caed4927a 100644
--- a/modules/gui/qt/Makefile.am
+++ b/modules/gui/qt/Makefile.am
@@ -13,6 +13,7 @@ SUFFIXES += .ui .h .hpp .moc.cpp
 
 libqt_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) \
 	-DQT_USE_QSTRINGBUILDER \
+	-DQT_NO_CAST_FROM_BYTEARRAY \
 	-I$(srcdir)/gui/qt -I$(builddir)/gui/qt
 libqt_plugin_la_CXXFLAGS = $(AM_CXXFLAGS) $(QT_CFLAGS) $(CXXFLAGS_qt)
 libqt_plugin_la_LIBADD = $(QT_LIBS) $(LIBS_qt) $(LIBM)
diff --git a/modules/gui/qt/components/simple_preferences.cpp b/modules/gui/qt/components/simple_preferences.cpp
index 3e96c8915fd1..f117239722b8 100644
--- a/modules/gui/qt/components/simple_preferences.cpp
+++ b/modules/gui/qt/components/simple_preferences.cpp
@@ -1095,10 +1095,10 @@ void SPrefsPanel::apply()
             qobject_cast<QComboBox *>(optionWidgets["inputLE"])->currentText().toUtf8();
         if( devicepath.size() > 0 )
         {
-            config_PutPsz( p_intf, "dvd", devicepath );
-            config_PutPsz( p_intf, "vcd", devicepath );
+            config_PutPsz( p_intf, "dvd", devicepath.constData() );
+            config_PutPsz( p_intf, "vcd", devicepath.constData() );
             if( module_exists( "cdda" ) )
-                config_PutPsz( p_intf, "cd-audio", devicepath );
+                config_PutPsz( p_intf, "cd-audio", devicepath.constData() );
         }
 
 #define CaC( name, factor ) config_PutInt( p_intf, name, i_comboValue * factor )
-- 
GitLab


From 5eb8fe49ca7d4879e9a0f2a26e9121fa956e569c Mon Sep 17 00:00:00 2001
From: Steve Lhomme <robux4@ycbcr.xyz>
Date: Tue, 10 Dec 2024 07:33:06 +0100
Subject: [PATCH 11/33] qt: remove deprecated timespec

Will be gone in 6.10. The replacement Timezone was added in 6.7.
And we don't need to set it unless the display format uses a timezone [^1] + [^2].

This avoids this kind of warnings:
```
./gui/qt/ui/open.h:205:27: warning: 'setTimeSpec' is deprecated: Use setTimeZone() instead [-Wdeprecated-declarations]
  205 |         stopTimeTimeEdit->setTimeSpec(Qt::LocalTime);
      |                           ^
/mnt/s/sources/build/win64-llvm18/contrib/x86_64-w64-mingw32ucrt/include/QtWidgets/qdatetimeedit.h:134:5: note: 'setTimeSpec' has been explicitly marked deprecated here
  134 |     QT_DEPRECATED_VERSION_X_6_10("Use setTimeZone() instead")
      |     ^
/mnt/s/sources/build/win64-llvm18/contrib/x86_64-w64-mingw32ucrt/include/QtCore/qtdeprecationmarkers.h:187:45: note: expanded from macro 'QT_DEPRECATED_VERSION_X_6_10'
  187 | # define QT_DEPRECATED_VERSION_X_6_10(text) QT_DEPRECATED_X(text)
      |                                             ^
/mnt/s/sources/build/win64-llvm18/contrib/x86_64-w64-mingw32ucrt/include/QtCore/qtdeprecationmarkers.h:29:33: note: expanded from macro 'QT_DEPRECATED_X'
   29 | #  define QT_DEPRECATED_X(text) Q_DECL_DEPRECATED_X(text)
      |                                 ^
/mnt/s/sources/build/win64-llvm18/contrib/x86_64-w64-mingw32ucrt/include/QtCore/qcompilerdetection.h:1000:36: note: expanded from macro 'Q_DECL_DEPRECATED_X'
 1000 | #  define Q_DECL_DEPRECATED_X(x) [[deprecated(x)]]
      |                                    ^
```

[^1]: https://doc.qt.io/qt-6/qdatetimeedit.html#timeZone-prop
[^2]: https://doc.qt.io/qt-6/qtime.html#toString

(cherry picked from commit 3c07c3369a5313b2d79e95dec20c1f6a1041ad23) (edited)
edited:
- the file was moved in 4.0
---
 modules/gui/qt/ui/open.ui | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/modules/gui/qt/ui/open.ui b/modules/gui/qt/ui/open.ui
index f105fe42bff3..b9c01307f050 100644
--- a/modules/gui/qt/ui/open.ui
+++ b/modules/gui/qt/ui/open.ui
@@ -249,9 +249,6 @@
         <property name="displayFormat">
          <string>HH'H':mm'm':ss's'.zzz</string>
         </property>
-        <property name="timeSpec">
-         <enum>Qt::LocalTime</enum>
-        </property>
        </widget>
       </item>
       <item row="1" column="4" colspan="2">
@@ -268,9 +265,6 @@
         <property name="displayFormat">
          <string>HH'H':mm'm':ss's'.zzz</string>
         </property>
-        <property name="timeSpec">
-         <enum>Qt::LocalTime</enum>
-        </property>
        </widget>
       </item>
       <item row="4" column="0" colspan="6">
-- 
GitLab


From 3952b4f3e9fa3a8986b3f626aa88f48863a635e4 Mon Sep 17 00:00:00 2001
From: Steve Lhomme <robux4@ycbcr.xyz>
Date: Tue, 17 Dec 2024 10:11:30 +0100
Subject: [PATCH 12/33] qt: use QPalette::window() instead of
 QPalette::background()

It's deprecated and the replacement suggested in the doc [^1].

It's deprecated in Qt 5.15 [^1], since 5.13 [^2], and removed in Qt 6.

The commit log of [^2] even mentions its deprecated for all Qt5 but was not
marked as such yet.

[^1]: https://doc.qt.io/qt-5/qpainter.html#RenderHint-enum
[^2]: https://github.com/qt/qtbase/commit/4c522e0226da1bcc67a585130e3b2a976be128fd
---
 modules/gui/qt/dialogs/toolbar.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/gui/qt/dialogs/toolbar.cpp b/modules/gui/qt/dialogs/toolbar.cpp
index 22e351ccf613..714f63d1bddc 100644
--- a/modules/gui/qt/dialogs/toolbar.cpp
+++ b/modules/gui/qt/dialogs/toolbar.cpp
@@ -333,7 +333,7 @@ void PreviewWidget::paintEvent( QPaintEvent * )
             if ( !strcmp( item->widget()->metaObject()->className(), "QLabel" ) )
             {
                 QPainter eraser( &pixmaps[i] );
-                eraser.fillRect( item->geometry(), palette().background() );
+                eraser.fillRect( item->geometry(), palette().window() );
                 eraser.end();
             }
         }
-- 
GitLab


From fa6eaadc6e83fb8f1b665d4159448dbe45adcb9f Mon Sep 17 00:00:00 2001
From: Steve Lhomme <robux4@ycbcr.xyz>
Date: Tue, 17 Dec 2024 10:59:17 +0100
Subject: [PATCH 13/33] qt: use QTreeWidgetItem::setExpanded() instead of
 QTreeWidget::InfoTree->setItemExpanded()

It's deprecated in Qt 5.15 [^1], since 5.13 [^2], and removed in Qt 6.

The commit log of [^2] even mentions its deprecated for "a long time".

[^1]: https://doc.qt.io/qt-5/qtreewidget-obsolete.html#setItemExpanded
[^2]: https://github.com/qt/qtbase/commit/76bb804405f424708fffec502788995ea91206b8
---
 modules/gui/qt/components/info_panels.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/gui/qt/components/info_panels.cpp b/modules/gui/qt/components/info_panels.cpp
index 88503145f4a2..6d3c0ce7498f 100644
--- a/modules/gui/qt/components/info_panels.cpp
+++ b/modules/gui/qt/components/info_panels.cpp
@@ -516,7 +516,7 @@ void InfoPanel::update( input_item_t *p_item)
 
             current_item->addChild(child_item);
         }
-        InfoTree->setItemExpanded( current_item, true);
+        current_item->setExpanded(true);
     }
 }
 
-- 
GitLab


From f13e6d30930a08b6e5b18d631f1cc25f342a379b Mon Sep 17 00:00:00 2001
From: Steve Lhomme <robux4@ycbcr.xyz>
Date: Tue, 17 Dec 2024 15:58:32 +0100
Subject: [PATCH 14/33] qt: use QRandomGenerator instead of qrand()

It's deprecated since Qt 5.15 [^1], and removed in Qt 6.

The commit log of [^2] even mentions its deprecated "in the documentation for a while".

The QRandomGenerator class was added in Qt 5.10 [^3] so we can't use it
before that.

[^1]: https://doc.qt.io/qt-5/qtglobal-obsolete.html#qrand
[^2]: https://github.com/qt/qtbase/commit/b3c0e9afa0041d4d45e47880732deda1dd1013b9
[^3]: https://doc.qt.io/qt-5/qrandomgenerator.html
---
 modules/gui/qt/components/interface_widgets.cpp | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/modules/gui/qt/components/interface_widgets.cpp b/modules/gui/qt/components/interface_widgets.cpp
index 86d288835746..28401691f5cd 100644
--- a/modules/gui/qt/components/interface_widgets.cpp
+++ b/modules/gui/qt/components/interface_widgets.cpp
@@ -43,6 +43,14 @@
 #include <QPainter>
 #include <QTimer>
 #include <QUrl>
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+#include <QRandomGenerator>
+
+static inline int qrand() {
+    auto * q = QRandomGenerator::system();
+    return q->generate();
+}
+#endif
 
 #if defined (QT5_HAS_X11)
 # include <X11/Xlib.h>
-- 
GitLab


From 350391009e5fd5725e9dce2727b25abd5d5b3ff5 Mon Sep 17 00:00:00 2001
From: Steve Lhomme <robux4@ycbcr.xyz>
Date: Tue, 17 Dec 2024 11:54:44 +0100
Subject: [PATCH 15/33] qt: remove Qt::WA_MacBrushedMetal

It's deprecated in Qt 5.15 [^1], since 5.14 [^2], and removed in Qt 6.

The commit log of [^2] even mentions its deprecated for "a log time".

[^1]: https://doc.qt.io/qt-5/qt.html#WidgetAttribute-enum
[^2]: https://github.com/qt/qtbase/commit/4f6eb43898aa14fef5f3a54966b340188271d85e
---
 modules/gui/qt/components/controller.cpp | 1 -
 1 file changed, 1 deletion(-)

diff --git a/modules/gui/qt/components/controller.cpp b/modules/gui/qt/components/controller.cpp
index 59d84ad344e7..d2cf8ef17b74 100644
--- a/modules/gui/qt/components/controller.cpp
+++ b/modules/gui/qt/components/controller.cpp
@@ -721,7 +721,6 @@ ControlsWidget::ControlsWidget( intf_thread_t *_p_i,
 #ifdef DEBUG_LAYOUT
     setStyleSheet( "background: red ");
 #endif
-    setAttribute( Qt::WA_MacBrushedMetal);
     controlLayout = new QVBoxLayout( this );
     controlLayout->setContentsMargins( 3, 1, 0, 1 );
     controlLayout->setSpacing( 0 );
-- 
GitLab


From fba9d990b2c301cd1c81e3784a5c7ab415c058b3 Mon Sep 17 00:00:00 2001
From: Steve Lhomme <robux4@ycbcr.xyz>
Date: Tue, 17 Dec 2024 13:10:52 +0100
Subject: [PATCH 16/33] qt: use QPixmapCache::find(QPixmap*) instead of
 QPixmapCache::find(QPixmap&)

It's deprecated in Qt 5.15 [^1], since 5.13 [^2], and removed in Qt 6.

The commit log of [^2] even mentions its deprecated "since Qt4 times".

[^1]: https://doc.qt.io/qt-5/qpixmapcache-obsolete.html#find
[^2]: https://github.com/qt/qtbase/commit/daee9af969a04a2919a948ba1f5d314626925a9a
---
 modules/gui/qt/components/playlist/vlc_model.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/gui/qt/components/playlist/vlc_model.cpp b/modules/gui/qt/components/playlist/vlc_model.cpp
index e56efde560d6..6144272c058c 100644
--- a/modules/gui/qt/components/playlist/vlc_model.cpp
+++ b/modules/gui/qt/components/playlist/vlc_model.cpp
@@ -83,7 +83,7 @@ QPixmap VLCModel::getArtPixmap( const QModelIndex & index, const QSize & size )
 
     QString key = artUrl + QString("%1%2").arg(size.width()).arg(size.height());
 
-    if( !QPixmapCache::find( key, artPix ))
+    if( !QPixmapCache::find( key, &artPix ))
     {
         if( artUrl.isEmpty() == false )
         {
@@ -97,7 +97,7 @@ QPixmap VLCModel::getArtPixmap( const QModelIndex & index, const QSize & size )
             }
         }
         key = QString("noart%1%2").arg(size.width()).arg(size.height());
-        if( !QPixmapCache::find( key, artPix ) )
+        if( !QPixmapCache::find( key, &artPix ) )
         {
             artPix = QPixmap( ":/noart" ).scaled( size,
                                           Qt::KeepAspectRatio,
-- 
GitLab


From 381b6f56deafbde5ff8b3cf64e86a5efd15d183b Mon Sep 17 00:00:00 2001
From: Steve Lhomme <robux4@ycbcr.xyz>
Date: Tue, 17 Dec 2024 13:19:54 +0100
Subject: [PATCH 17/33] qt: use QAbstractItemModel::index() instead of
 QModelIndex::child()

It's deprecated in Qt 5.15 [^1], since 5.8 [^2], and removed in Qt 6.
We use a replacement is suggested in [^1].

The commit log of [^2] even mentions its deprecated "since Qt4 times".

[^1]: https://doc.qt.io/qt-5/qmodelindex-obsolete.html#child
[^2]: https://github.com/qt/qtbase/commit/8dc45d5b7cd9637f28b2d872a834266b991bf434
---
 modules/gui/qt/components/playlist/vlc_model.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/gui/qt/components/playlist/vlc_model.cpp b/modules/gui/qt/components/playlist/vlc_model.cpp
index 6144272c058c..9a881d0b2145 100644
--- a/modules/gui/qt/components/playlist/vlc_model.cpp
+++ b/modules/gui/qt/components/playlist/vlc_model.cpp
@@ -206,7 +206,7 @@ void VLCModel::ensureArtRequested( const QModelIndex &index )
         QModelIndex child;
         for( int row = 0 ; row < nbnodes ; row++ )
         {
-            child = index.child( row, COLUMN_COVER );
+            child = index.model()->index( row, COLUMN_COVER );
             if ( child.isValid() && child.data().toString().isEmpty() )
                 THEMIM->getIM()->requestArtUpdate( getInputItem( child ), false );
         }
-- 
GitLab


From 27593ce6af825d41d0b85bdd50ed5f8a0549a78b Mon Sep 17 00:00:00 2001
From: Steve Lhomme <robux4@ycbcr.xyz>
Date: Tue, 17 Dec 2024 13:29:09 +0100
Subject: [PATCH 18/33] qt: use QWheelEvent::pixelDelta() instead of
 QWheelEvent::delta()

It's deprecated in Qt 5.15 [^1], since 5.0 [^2], and removed in Qt 6.
Although the deprecation was delayed to 5.15 because of a Qt3D issue [^3], that
we don't use.
We use a replacement is suggested in [^1].

The commit log of [^2] even mentions its deprecated "since Qt4 times".

[^1]: https://doc.qt.io/qt-5/qwheelevent-obsolete.html#delta
[^2]: https://github.com/qt/qtbase/commit/7d29807296cb7ccc7f3459e106d74f93a321c493
[^3]: https://github.com/qt/qtbase/commit/8dc45d5b7cd9637f28b2d872a834266b991bf434
---
 modules/gui/qt/components/playlist/selector.cpp      | 4 ++--
 modules/gui/qt/components/playlist/standardpanel.cpp | 2 +-
 modules/gui/qt/util/input_slider.cpp                 | 4 ++--
 modules/gui/qt/util/pictureflow.cpp                  | 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/modules/gui/qt/components/playlist/selector.cpp b/modules/gui/qt/components/playlist/selector.cpp
index 308e245ca367..3925a3f6b8a0 100644
--- a/modules/gui/qt/components/playlist/selector.cpp
+++ b/modules/gui/qt/components/playlist/selector.cpp
@@ -640,8 +640,8 @@ int PLSelector::getCurrentItemCategory()
 void PLSelector::wheelEvent( QWheelEvent *e )
 {
     if( verticalScrollBar()->isVisible() && (
-        (verticalScrollBar()->value() != verticalScrollBar()->minimum() && e->delta() >= 0 ) ||
-        (verticalScrollBar()->value() != verticalScrollBar()->maximum() && e->delta() < 0 )
+        (verticalScrollBar()->value() != verticalScrollBar()->minimum() && e->pixelDelta().y() >= 0 ) ||
+        (verticalScrollBar()->value() != verticalScrollBar()->maximum() && e->pixelDelta().y() < 0 )
         ) )
         QApplication::sendEvent(verticalScrollBar(), e);
 
diff --git a/modules/gui/qt/components/playlist/standardpanel.cpp b/modules/gui/qt/components/playlist/standardpanel.cpp
index f4107cad4586..e3dfd88d7425 100644
--- a/modules/gui/qt/components/playlist/standardpanel.cpp
+++ b/modules/gui/qt/components/playlist/standardpanel.cpp
@@ -538,7 +538,7 @@ void StandardPLPanel::browseInto()
 void StandardPLPanel::wheelEvent( QWheelEvent *e )
 {
     if( e->modifiers() & Qt::ControlModifier ) {
-        int numSteps = e->delta() / 8 / 15;
+        int numSteps = e->pixelDelta().y() / 8 / 15;
         if( numSteps > 0)
             increaseZoom();
         else if( numSteps < 0)
diff --git a/modules/gui/qt/util/input_slider.cpp b/modules/gui/qt/util/input_slider.cpp
index d26ecb7fad00..6b0163761b15 100644
--- a/modules/gui/qt/util/input_slider.cpp
+++ b/modules/gui/qt/util/input_slider.cpp
@@ -403,7 +403,7 @@ void SeekSlider::wheelEvent( QWheelEvent *event )
     {
         vlc_tick_t i_size = var_InheritInteger( p_intf->obj.libvlc, "short-jump-size" );
         int i_mode = var_InheritInteger( p_intf->obj.libvlc, "hotkeys-x-wheel-mode" );
-        if ( ( event->delta() < 0 && i_mode != 3 ) || ( event->delta() > 0 && i_mode == 3 ) )
+        if ( ( event->pixelDelta().x() < 0 && i_mode != 3 ) || ( event->pixelDelta().x() > 0 && i_mode == 3 ) )
             i_size = - i_size;
         float posOffset = static_cast<float>( i_size ) / static_cast<float>( inputLength );
         setValue( value() + posOffset * maximum() );
@@ -674,7 +674,7 @@ SoundSlider::SoundSlider( QWidget *_parent, float _i_step,
 
 void SoundSlider::wheelEvent( QWheelEvent *event )
 {
-    int newvalue = value() + event->delta() / ( 8 * 15 ) * f_step;
+    int newvalue = value() + event->pixelDelta().y() / ( 8 * 15 ) * f_step;
     setValue( __MIN( __MAX( minimum(), newvalue ), maximum() ) );
 
     emit sliderReleased();
diff --git a/modules/gui/qt/util/pictureflow.cpp b/modules/gui/qt/util/pictureflow.cpp
index cf00f9d8c931..f5135a93459b 100644
--- a/modules/gui/qt/util/pictureflow.cpp
+++ b/modules/gui/qt/util/pictureflow.cpp
@@ -869,7 +869,7 @@ void PictureFlow::wheelEvent(QWheelEvent * event)
     }
     else
     {
-        int numSteps = -((event->delta() / 8) / 15);
+        int numSteps = -((event->pixelDelta().y() / 8) / 15);
 
         if (numSteps > 0)
         {
-- 
GitLab


From 211e7abcd719b1661cefaa1db4ca607787d40f85 Mon Sep 17 00:00:00 2001
From: Steve Lhomme <robux4@ycbcr.xyz>
Date: Tue, 17 Dec 2024 13:35:16 +0100
Subject: [PATCH 19/33] qt: use Qt::MiddleButton instead of Qt::MidButton

It's deprecated in Qt 5.15 [^1], since 4.7, and removed in Qt 6.

[^1]: https://github.com/qt/qtbase/commit/6ee6c52b57a0fbe9df00b30616afd90476ebdfd6
---
 modules/gui/qt/util/input_slider.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/modules/gui/qt/util/input_slider.cpp b/modules/gui/qt/util/input_slider.cpp
index 6b0163761b15..5045e5f28930 100644
--- a/modules/gui/qt/util/input_slider.cpp
+++ b/modules/gui/qt/util/input_slider.cpp
@@ -281,7 +281,7 @@ void SeekSlider::processReleasedButton()
 
 void SeekSlider::mouseReleaseEvent( QMouseEvent *event )
 {
-    if ( event->button() != Qt::LeftButton && event->button() != Qt::MidButton )
+    if ( event->button() != Qt::LeftButton && event->button() != Qt::MiddleButton )
     {
         QSlider::mouseReleaseEvent( event );
         return;
@@ -294,7 +294,7 @@ void SeekSlider::mousePressEvent( QMouseEvent* event )
 {
     /* Right-click */
     if ( !isEnabled() ||
-         ( event->button() != Qt::LeftButton && event->button() != Qt::MidButton )
+         ( event->button() != Qt::LeftButton && event->button() != Qt::MiddleButton )
        )
     {
         QSlider::mousePressEvent( event );
@@ -348,7 +348,7 @@ void SeekSlider::mousePressEvent( QMouseEvent* event )
 
 void SeekSlider::mouseMoveEvent( QMouseEvent *event )
 {
-    if ( ! ( event->buttons() & ( Qt::LeftButton | Qt::MidButton ) ) )
+    if ( ! ( event->buttons() & ( Qt::LeftButton | Qt::MiddleButton ) ) )
     {
         /* Handle button release when mouserelease has been hijacked by popup */
         processReleasedButton();
-- 
GitLab


From 5d3bde43735f8b375850f2967e35f56d06467396 Mon Sep 17 00:00:00 2001
From: Steve Lhomme <robux4@ycbcr.xyz>
Date: Tue, 17 Dec 2024 13:42:42 +0100
Subject: [PATCH 20/33] qt: use QWheelEvent::angleDelta() instead of
 QWheelEvent::orientation()

It's deprecated in Qt 5.15 [^1], since 5.0 [^2], and removed in Qt 6.
Although the deprecation was delayed to 5.15 because of a Qt3D issue [^3], that
we don't use.
We use a replacement is suggested in [^1].

The commit log of [^2] even mentions its deprecated "since Qt4 times".

[^1]: https://doc.qt.io/qt-5/qwheelevent-obsolete.html#orientation
[^2]: https://github.com/qt/qtbase/commit/7d29807296cb7ccc7f3459e106d74f93a321c493
[^3]: https://github.com/qt/qtbase/commit/8dc45d5b7cd9637f28b2d872a834266b991bf434
---
 modules/gui/qt/util/pictureflow.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/gui/qt/util/pictureflow.cpp b/modules/gui/qt/util/pictureflow.cpp
index f5135a93459b..3977fe29fa93 100644
--- a/modules/gui/qt/util/pictureflow.cpp
+++ b/modules/gui/qt/util/pictureflow.cpp
@@ -863,7 +863,7 @@ void PictureFlow::resizeEvent(QResizeEvent* event)
 
 void PictureFlow::wheelEvent(QWheelEvent * event)
 {
-    if (event->orientation() == Qt::Horizontal)
+    if (event->angleDelta().y() == 0)
     {
         event->ignore();
     }
-- 
GitLab


From 42eb87b3807d0276d94ad3a596b364cb9b9013cb Mon Sep 17 00:00:00 2001
From: Steve Lhomme <robux4@ycbcr.xyz>
Date: Tue, 17 Dec 2024 16:12:27 +0100
Subject: [PATCH 21/33] qt: use QMouseEvent::globalPosition() instead of
 QMouseEvent::globalX/Y()

globalPosition() doesn't exist in Qt5 but globalPos() is the same thing [^2].

It's deprecated in Qt 5.15 [^1], since 5.0 [^3], and removed in Qt 6.
Although the deprecation was delayed to 5.15 because of a Qt3D issue [^4], that
we don't use.
We use a replacement is suggested in [^1].

The commit log of [^3] even mentions its deprecated "since Qt4 times".

[^1]: https://doc.qt.io/qt-6.2/qmouseevent-obsolete.html#globalX
[^2]: https://doc.qt.io/qt-5/qmouseevent.html#globalPos
[^3]: https://github.com/qt/qtbase/commit/7d29807296cb7ccc7f3459e106d74f93a321c493
[^4]: https://github.com/qt/qtbase/commit/8dc45d5b7cd9637f28b2d872a834266b991bf434
---
 modules/gui/qt/components/controller.cpp | 22 ++++++++++++++++------
 modules/gui/qt/util/input_slider.cpp     |  7 ++++++-
 2 files changed, 22 insertions(+), 7 deletions(-)

diff --git a/modules/gui/qt/components/controller.cpp b/modules/gui/qt/components/controller.cpp
index d2cf8ef17b74..3a0782ac6546 100644
--- a/modules/gui/qt/components/controller.cpp
+++ b/modules/gui/qt/components/controller.cpp
@@ -1112,8 +1112,13 @@ void FullscreenControllerWidget::mouseMoveEvent( QMouseEvent *event )
         if( i_mouse_last_x == -1 || i_mouse_last_y == -1 )
             return;
 
-        int i_moveX = event->globalX() - i_mouse_last_x;
-        int i_moveY = event->globalY() - i_mouse_last_y;
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+        const auto pos = event->globalPosition();
+#else
+        const auto pos = event->globalPos();
+#endif
+        int i_moveX = pos.x() - i_mouse_last_x;
+        int i_moveY = pos.y() - i_mouse_last_y;
 
         const QRect screenRect = QApplication::desktop()->screenGeometry( targetScreen() );
 
@@ -1122,8 +1127,8 @@ void FullscreenControllerWidget::mouseMoveEvent( QMouseEvent *event )
 
         move( i_x, i_y );
 
-        i_mouse_last_x = event->globalX();
-        i_mouse_last_y = event->globalY();
+        i_mouse_last_x = pos.x();
+        i_mouse_last_y = pos.y();
     }
 }
 
@@ -1134,8 +1139,13 @@ void FullscreenControllerWidget::mouseMoveEvent( QMouseEvent *event )
 void FullscreenControllerWidget::mousePressEvent( QMouseEvent *event )
 {
     if( isWideFSC ) return;
-    i_mouse_last_x = event->globalX();
-    i_mouse_last_y = event->globalY();
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+    auto pos = event->globalPosition();
+#else
+    auto pos = event->globalPos();
+#endif
+    i_mouse_last_x = pos.x();
+    i_mouse_last_y = pos.y();
     event->accept();
 }
 
diff --git a/modules/gui/qt/util/input_slider.cpp b/modules/gui/qt/util/input_slider.cpp
index 5045e5f28930..0317a1e82f92 100644
--- a/modules/gui/qt/util/input_slider.cpp
+++ b/modules/gui/qt/util/input_slider.cpp
@@ -386,7 +386,12 @@ void SeekSlider::mouseMoveEvent( QMouseEvent *event )
             }
         }
 
-        QPoint target( event->globalX() - ( event->x() - posX ),
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+        const auto pos = event->globalPosition();
+#else
+        const auto pos = event->globalPos();
+#endif
+        QPoint target( pos.x() - ( event->x() - posX ),
                 QWidget::mapToGlobal( QPoint( 0, 0 ) ).y() );
         if( likely( size().width() > handleLength() ) ) {
             secstotimestr( psz_length, getValuePercentageFromXPos( event->x() ) * inputLength );
-- 
GitLab


From fbf3090a9fbe0a001f44e4baf9d877006e1ed6b3 Mon Sep 17 00:00:00 2001
From: Steve Lhomme <robux4@ycbcr.xyz>
Date: Wed, 18 Dec 2024 09:04:18 +0100
Subject: [PATCH 22/33] qt: merge MainInterfaceWin32::nativeEvent() and
 MainInterfaceWin32::winEvent()

No need for an extra method.
---
 modules/gui/qt/main_interface_win32.cpp | 5 +----
 modules/gui/qt/main_interface_win32.hpp | 1 -
 2 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/modules/gui/qt/main_interface_win32.cpp b/modules/gui/qt/main_interface_win32.cpp
index 8e5f1b8c59db..6c494ae7e934 100644
--- a/modules/gui/qt/main_interface_win32.cpp
+++ b/modules/gui/qt/main_interface_win32.cpp
@@ -217,11 +217,8 @@ void MainInterfaceWin32::createTaskBarButtons()
 
 bool MainInterfaceWin32::nativeEvent(const QByteArray &, void *message, long *result)
 {
-    return winEvent( static_cast<MSG*>( message ), result );
-}
+    MSG * msg = static_cast<MSG*>( message );
 
-bool MainInterfaceWin32::winEvent ( MSG * msg, long * result )
-{
     if (msg->message == taskbar_wmsg)
     {
         //We received the taskbarbuttoncreated, now we can really create the buttons
diff --git a/modules/gui/qt/main_interface_win32.hpp b/modules/gui/qt/main_interface_win32.hpp
index 1e456c4c3512..09538d4c2938 100644
--- a/modules/gui/qt/main_interface_win32.hpp
+++ b/modules/gui/qt/main_interface_win32.hpp
@@ -37,7 +37,6 @@ public:
 
 private:
     virtual bool nativeEvent(const QByteArray &eventType, void *message, long *result) Q_DECL_OVERRIDE;
-    virtual bool winEvent( MSG *, long * );
     virtual void toggleUpdateSystrayMenuWhenVisible() Q_DECL_OVERRIDE;
 
 protected:
-- 
GitLab


From 24eb189f5b9462e7b256009544c175021ada7496 Mon Sep 17 00:00:00 2001
From: Steve Lhomme <robux4@ycbcr.xyz>
Date: Mon, 16 Dec 2024 14:54:48 +0100
Subject: [PATCH 23/33] qt: use QAbstractNativeEventFilter

Instead of deprecated nativeEvent() method.
---
 modules/gui/qt/components/interface_widgets.cpp |  7 ++++++-
 modules/gui/qt/components/interface_widgets.hpp |  9 +++++++--
 modules/gui/qt/main_interface_win32.cpp         |  7 ++++++-
 modules/gui/qt/main_interface_win32.hpp         | 10 ++++++++--
 4 files changed, 27 insertions(+), 6 deletions(-)

diff --git a/modules/gui/qt/components/interface_widgets.cpp b/modules/gui/qt/components/interface_widgets.cpp
index 28401691f5cd..556bdf9e4020 100644
--- a/modules/gui/qt/components/interface_widgets.cpp
+++ b/modules/gui/qt/components/interface_widgets.cpp
@@ -90,6 +90,7 @@ VideoWidget::VideoWidget( intf_thread_t *_p_i, QWidget* p_parent )
     layout->setContentsMargins( 0, 0, 0, 0 );
     stable = NULL;
     p_window = NULL;
+    qApp->installNativeEventFilter(this);
     show();
 }
 
@@ -269,7 +270,11 @@ void VideoWidget::setSize( unsigned int w, unsigned int h )
     sync();
 }
 
-bool VideoWidget::nativeEvent( const QByteArray& eventType, void* message, long* )
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+bool VideoWidget::nativeEventFilter(const QByteArray &eventType, void *message, qintptr *)
+#else
+bool VideoWidget::nativeEventFilter(const QByteArray &eventType, void *message, long *)
+#endif
 {
 #if defined(QT5_HAS_X11)
 # if defined(QT5_HAS_XCB)
diff --git a/modules/gui/qt/components/interface_widgets.hpp b/modules/gui/qt/components/interface_widgets.hpp
index c953004d6274..995b8e012913 100644
--- a/modules/gui/qt/components/interface_widgets.hpp
+++ b/modules/gui/qt/components/interface_widgets.hpp
@@ -43,6 +43,7 @@
 #include <QLabel>
 #include <QMouseEvent>
 #include <QPropertyAnimation>
+#include <QAbstractNativeEventFilter>
 
 class QMenu;
 class QSlider;
@@ -51,7 +52,7 @@ class SpeedControlWidget;
 struct vout_window_t;
 
 /******************** Video Widget ****************/
-class VideoWidget : public QFrame
+class VideoWidget : public QFrame, public QAbstractNativeEventFilter
 {
     Q_OBJECT
 public:
@@ -68,7 +69,11 @@ protected:
         return NULL;
     }
 
-    bool nativeEvent(const QByteArray &eventType, void *message, long *result) Q_DECL_OVERRIDE;
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+    bool nativeEventFilter(const QByteArray &eventType, void *message, qintptr *result) override;
+#else
+    bool nativeEventFilter(const QByteArray &eventType, void *message, long *result) override;
+#endif
     virtual void resizeEvent(QResizeEvent *) Q_DECL_OVERRIDE;
     void mousePressEvent(QMouseEvent *) Q_DECL_OVERRIDE;
     void mouseMoveEvent(QMouseEvent *) Q_DECL_OVERRIDE;
diff --git a/modules/gui/qt/main_interface_win32.cpp b/modules/gui/qt/main_interface_win32.cpp
index 6c494ae7e934..8c69b037b7d1 100644
--- a/modules/gui/qt/main_interface_win32.cpp
+++ b/modules/gui/qt/main_interface_win32.cpp
@@ -91,6 +91,7 @@ MainInterfaceWin32::MainInterfaceWin32( intf_thread_t *_p_intf )
     taskbar_wmsg = RegisterWindowMessage(TEXT("TaskbarButtonCreated"));
     if (taskbar_wmsg == 0)
         msg_Warn( p_intf, "Failed to register TaskbarButtonCreated message" );
+    qApp->installNativeEventFilter(this);
 }
 
 MainInterfaceWin32::~MainInterfaceWin32()
@@ -215,7 +216,11 @@ void MainInterfaceWin32::createTaskBarButtons()
         changeThumbbarButtons( THEMIM->getIM()->playingStatus() );
 }
 
-bool MainInterfaceWin32::nativeEvent(const QByteArray &, void *message, long *result)
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+bool MainInterfaceWin32::nativeEventFilter(const QByteArray &, void *message, qintptr *result)
+#else
+bool MainInterfaceWin32::nativeEventFilter(const QByteArray &, void *message, long *result)
+#endif
 {
     MSG * msg = static_cast<MSG*>( message );
 
diff --git a/modules/gui/qt/main_interface_win32.hpp b/modules/gui/qt/main_interface_win32.hpp
index 09538d4c2938..91e135cfe7ea 100644
--- a/modules/gui/qt/main_interface_win32.hpp
+++ b/modules/gui/qt/main_interface_win32.hpp
@@ -27,7 +27,9 @@
 
 #include "main_interface.hpp"
 
-class MainInterfaceWin32 : public MainInterface
+#include <QAbstractNativeEventFilter>
+
+class MainInterfaceWin32 : public MainInterface, public QAbstractNativeEventFilter
 {
     Q_OBJECT
 
@@ -36,7 +38,11 @@ public:
     virtual ~MainInterfaceWin32();
 
 private:
-    virtual bool nativeEvent(const QByteArray &eventType, void *message, long *result) Q_DECL_OVERRIDE;
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+    bool nativeEventFilter(const QByteArray &eventType, void *message, qintptr *result) override;
+#else
+    bool nativeEventFilter(const QByteArray &eventType, void *message, long *result) override;
+#endif
     virtual void toggleUpdateSystrayMenuWhenVisible() Q_DECL_OVERRIDE;
 
 protected:
-- 
GitLab


From 17cc9480b950c0b73a61e5a619234ba837fbffaf Mon Sep 17 00:00:00 2001
From: Steve Lhomme <robux4@ycbcr.xyz>
Date: Fri, 20 Dec 2024 10:51:48 +0100
Subject: [PATCH 24/33] qt: remove unused showBuffering()

Removed in 4.0 in 92539782be07770312eeb6549b50a72c86879729.
---
 modules/gui/qt/main_interface.cpp | 6 ------
 modules/gui/qt/main_interface.hpp | 2 --
 2 files changed, 8 deletions(-)

diff --git a/modules/gui/qt/main_interface.cpp b/modules/gui/qt/main_interface.cpp
index fc33ec517f8f..c78843488136 100644
--- a/modules/gui/qt/main_interface.cpp
+++ b/modules/gui/qt/main_interface.cpp
@@ -1286,12 +1286,6 @@ void MainInterface::showCryptedLabel( bool b_show )
     cryptedLabel->setVisible( b_show );
 }
 
-void MainInterface::showBuffering( float f_cache )
-{
-    QString amount = QString("Buffering: %1%").arg( (int)(100*f_cache) );
-    statusBar()->showMessage( amount, 1000 );
-}
-
 /*****************************************************************************
  * Systray Icon and Systray Menu
  *****************************************************************************/
diff --git a/modules/gui/qt/main_interface.hpp b/modules/gui/qt/main_interface.hpp
index e73a6b5ce6b7..e7402e68ca03 100644
--- a/modules/gui/qt/main_interface.hpp
+++ b/modules/gui/qt/main_interface.hpp
@@ -237,8 +237,6 @@ protected slots:
 
     void handleKeyPress( QKeyEvent * );
 
-    void showBuffering( float );
-
     void resizeStack( int w, int h )
     {
         if( !isFullScreen() && !isMaximized() && !b_isWindowTiled )
-- 
GitLab


From 1dd3df8f44b34990258b9ca135d1ecc3ec8e5859 Mon Sep 17 00:00:00 2001
From: Steve Lhomme <robux4@ycbcr.xyz>
Date: Tue, 17 Dec 2024 08:15:16 +0100
Subject: [PATCH 25/33] qt: disable statusBar() usage if Qt is not built with
 it

We can't remove the unused methods because we don't have the proper
check in moc.
---
 modules/gui/qt/main_interface.cpp | 27 ++++++++++++++++++++++++++-
 modules/gui/qt/menus.cpp          |  7 ++++++-
 2 files changed, 32 insertions(+), 2 deletions(-)

diff --git a/modules/gui/qt/main_interface.cpp b/modules/gui/qt/main_interface.cpp
index c78843488136..d6557683127e 100644
--- a/modules/gui/qt/main_interface.cpp
+++ b/modules/gui/qt/main_interface.cpp
@@ -57,7 +57,6 @@
 #include <QWindow>
 #include <QMenu>
 #include <QMenuBar>
-#include <QStatusBar>
 #include <QLabel>
 #include <QStackedWidget>
 #include <QScreen>
@@ -65,6 +64,10 @@
 #include <QFileInfo>
 #endif
 
+#ifndef QT_NO_STATUSBAR
+# include <QStatusBar>
+#endif
+
 #if ! HAS_QT510 && defined(QT5_HAS_X11)
 # include <QX11Info>
 # include <X11/Xlib.h>
@@ -168,11 +171,13 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
 
     createMainWidget( settings );
 
+#ifndef QT_NO_STATUSBAR
     /**************
      * Status Bar *
      **************/
     createStatusBar();
     setStatusBarVisibility( getSettings()->value( "MainWindow/status-bar-visible", false ).toBool() );
+#endif
 
     /*********************************
      * Create the Systray Management *
@@ -550,6 +555,7 @@ inline void MainInterface::initSystray()
         createSystray();
 }
 
+#ifndef QT_NO_STATUSBAR
 inline void MainInterface::createStatusBar()
 {
     /****************
@@ -587,8 +593,10 @@ inline void MainInterface::createStatusBar()
          elapsed time.*/
     CONNECT( timeLabel, doubleClicked(), THEDP, gotoTimeDialog() );
 
+#ifndef QT_NO_STATUSBAR
     CONNECT( THEMIM->getIM(), encryptionChanged( bool ),
              this, showCryptedLabel( bool ) );
+#endif
 
     /* This shouldn't be necessary, but for somehow reason, the statusBarr
        starts at height of 20px and when a text is shown it needs more space.
@@ -598,6 +606,7 @@ inline void MainInterface::createStatusBar()
      */
     statusBarr->setFixedHeight( statusBarr->sizeHint().height() + 2 );
 }
+#endif
 
 /**********************************************************************
  * Handling of sizing of the components
@@ -828,8 +837,10 @@ void MainInterface::setVideoSize( unsigned int w, unsigned int h )
                         h -= menuBar()->height();
                     if( controls->isVisible() )
                         h -= controls->height();
+#ifndef QT_NO_STATUSBAR
                     if( statusBar()->isVisible() )
                         h -= statusBar()->height();
+#endif
                     if( inputC->isVisible() )
                         h -= inputC->height();
                 }
@@ -1116,7 +1127,9 @@ void MainInterface::displayNormalView()
 {
     menuBar()->setVisible( false );
     controls->setVisible( false );
+#ifndef QT_NO_STATUSBAR
     statusBar()->setVisible( false );
+#endif
     inputC->setVisible( false );
 }
 
@@ -1128,7 +1141,9 @@ void MainInterface::setMinimalView( bool b_minimal )
 {
     bool b_menuBarVisible = menuBar()->isVisible();
     bool b_controlsVisible = controls->isVisible();
+#ifndef QT_NO_STATUSBAR
     bool b_statusBarVisible = statusBar()->isVisible();
+#endif
     bool b_inputCVisible = inputC->isVisible();
 
     if( !isFullScreen() && !isMaximized() && b_minimal && !b_isWindowTiled )
@@ -1139,8 +1154,10 @@ void MainInterface::setMinimalView( bool b_minimal )
             i_heightChange += menuBar()->height();
         if( b_controlsVisible )
             i_heightChange += controls->height();
+#ifndef QT_NO_STATUSBAR
         if( b_statusBarVisible )
             i_heightChange += statusBar()->height();
+#endif
         if( b_inputCVisible )
             i_heightChange += inputC->height();
 
@@ -1150,7 +1167,9 @@ void MainInterface::setMinimalView( bool b_minimal )
 
     menuBar()->setVisible( !b_minimal );
     controls->setVisible( !b_minimal );
+#ifndef QT_NO_STATUSBAR
     statusBar()->setVisible( !b_minimal && b_statusbarVisible );
+#endif
     inputC->setVisible( !b_minimal );
 
     if( !isFullScreen() && !isMaximized() && !b_minimal && !b_isWindowTiled )
@@ -1161,8 +1180,10 @@ void MainInterface::setMinimalView( bool b_minimal )
             i_heightChange += menuBar()->height();
         if( !b_controlsVisible && controls->isVisible() )
             i_heightChange += controls->height();
+#ifndef QT_NO_STATUSBAR
         if( !b_statusBarVisible && statusBar()->isVisible() )
             i_heightChange += statusBar()->height();
+#endif
         if( !b_inputCVisible && inputC->isVisible() )
             i_heightChange += inputC->height();
 
@@ -1230,9 +1251,11 @@ StandardPLPanel *MainInterface::getPlaylistView()
 
 void MainInterface::setStatusBarVisibility( bool b_visible )
 {
+#ifndef QT_NO_STATUSBAR
     statusBar()->setVisible( b_visible );
     b_statusbarVisible = b_visible;
     if( controls ) controls->setGripVisible( !b_statusbarVisible );
+#endif
 }
 
 
@@ -1274,6 +1297,7 @@ void MainInterface::setVLCWindowsTitle( const QString& aTitle )
 
 void MainInterface::showCryptedLabel( bool b_show )
 {
+#ifndef QT_NO_STATUSBAR
     if( cryptedLabel == NULL )
     {
         cryptedLabel = new QLabel;
@@ -1284,6 +1308,7 @@ void MainInterface::showCryptedLabel( bool b_show )
     }
 
     cryptedLabel->setVisible( b_show );
+#endif
 }
 
 /*****************************************************************************
diff --git a/modules/gui/qt/menus.cpp b/modules/gui/qt/menus.cpp
index 3235cc6efaae..3b6276cf4ce3 100644
--- a/modules/gui/qt/menus.cpp
+++ b/modules/gui/qt/menus.cpp
@@ -54,7 +54,10 @@
 #include <QAction>
 #include <QActionGroup>
 #include <QSignalMapper>
-#include <QStatusBar>
+
+#ifndef QT_NO_STATUSBAR
+# include <QStatusBar>
+#endif
 
 /*
   This file defines the main menus and the pop-up menu (right-click menu)
@@ -531,10 +534,12 @@ QMenu *VLCMenuBar::ViewMenu( intf_thread_t *p_intf, QMenu *current, MainInterfac
         action->setChecked( true );
     action->setEnabled(mi->isAdvancedWidgetAvailable());
 
+#ifndef QT_NO_STATUSBAR
     action = menu->addAction( qtr( "Status Bar" ) );
     action->setCheckable( true );
     action->setChecked( mi->statusBar()->isVisible() );
     CONNECT( action, triggered( bool ), mi, setStatusBarVisibility( bool) );
+#endif
 #if 0 /* For Visualisations. Not yet working */
     adv = menu->addAction( qtr( "Visualizations selector" ), mi,
                            SLOT( visual() ) );
-- 
GitLab


From f6510d2f91ccf7306675386e8fa3166c467d87e9 Mon Sep 17 00:00:00 2001
From: Steve Lhomme <robux4@ycbcr.xyz>
Date: Tue, 17 Dec 2024 08:22:48 +0100
Subject: [PATCH 26/33] qt: use QEnterEvent with enterEvent() in Qt6

---
 modules/gui/qt/components/controller.cpp        | 4 ++++
 modules/gui/qt/components/controller.hpp        | 4 ++++
 modules/gui/qt/components/playlist/selector.hpp | 4 ++++
 modules/gui/qt/util/input_slider.cpp            | 4 ++++
 modules/gui/qt/util/input_slider.hpp            | 6 +++++-
 5 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/modules/gui/qt/components/controller.cpp b/modules/gui/qt/components/controller.cpp
index 3a0782ac6546..32712adfe04b 100644
--- a/modules/gui/qt/components/controller.cpp
+++ b/modules/gui/qt/components/controller.cpp
@@ -1163,7 +1163,11 @@ void FullscreenControllerWidget::mouseReleaseEvent( QMouseEvent *event )
 /**
  * On mouse go above FSC
  */
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+void FullscreenControllerWidget::enterEvent( QEnterEvent *event )
+#else
 void FullscreenControllerWidget::enterEvent( QEvent *event )
+#endif
 {
     b_mouse_over = true;
 
diff --git a/modules/gui/qt/components/controller.hpp b/modules/gui/qt/components/controller.hpp
index ab7b29f194a5..3275108cb1a1 100644
--- a/modules/gui/qt/components/controller.hpp
+++ b/modules/gui/qt/components/controller.hpp
@@ -277,7 +277,11 @@ protected:
     void mouseMoveEvent( QMouseEvent *event ) Q_DECL_OVERRIDE;
     void mousePressEvent( QMouseEvent *event ) Q_DECL_OVERRIDE;
     void mouseReleaseEvent( QMouseEvent *event ) Q_DECL_OVERRIDE;
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+    void enterEvent( QEnterEvent *event ) Q_DECL_OVERRIDE;
+#else
     void enterEvent( QEvent *event ) Q_DECL_OVERRIDE;
+#endif
     void leaveEvent( QEvent *event ) Q_DECL_OVERRIDE;
     void keyPressEvent( QKeyEvent *event ) Q_DECL_OVERRIDE;
 
diff --git a/modules/gui/qt/components/playlist/selector.hpp b/modules/gui/qt/components/playlist/selector.hpp
index 2e333a3a6648..d0c612aac681 100644
--- a/modules/gui/qt/components/playlist/selector.hpp
+++ b/modules/gui/qt/components/playlist/selector.hpp
@@ -99,7 +99,11 @@ signals:
     void action( PLSelItem* );
 
 private:
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+    inline void enterEvent( QEnterEvent* ){ showAction(); }
+#else
     inline void enterEvent( QEvent* ){ showAction(); }
+#endif
     inline void leaveEvent( QEvent* ){ hideAction(); }
 
     QTreeWidgetItem*     qitem;
diff --git a/modules/gui/qt/util/input_slider.cpp b/modules/gui/qt/util/input_slider.cpp
index 0317a1e82f92..85c9e83e4a1d 100644
--- a/modules/gui/qt/util/input_slider.cpp
+++ b/modules/gui/qt/util/input_slider.cpp
@@ -417,7 +417,11 @@ void SeekSlider::wheelEvent( QWheelEvent *event )
     event->accept();
 }
 
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+void SeekSlider::enterEvent( QEnterEvent * )
+#else
 void SeekSlider::enterEvent( QEvent * )
+#endif
 {
     /* Cancel the fade-out timer */
     hideHandleTimer->stop();
diff --git a/modules/gui/qt/util/input_slider.hpp b/modules/gui/qt/util/input_slider.hpp
index aad65ce4d498..648088220baf 100644
--- a/modules/gui/qt/util/input_slider.hpp
+++ b/modules/gui/qt/util/input_slider.hpp
@@ -65,7 +65,11 @@ protected:
     void mousePressEvent( QMouseEvent* event ) Q_DECL_OVERRIDE;
     void mouseReleaseEvent( QMouseEvent *event ) Q_DECL_OVERRIDE;
     void wheelEvent( QWheelEvent *event ) Q_DECL_OVERRIDE;
-    void enterEvent( QEvent * ) Q_DECL_OVERRIDE;
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+    void enterEvent( QEnterEvent *event ) Q_DECL_OVERRIDE;
+#else
+    void enterEvent( QEvent *event ) Q_DECL_OVERRIDE;
+#endif
     void leaveEvent( QEvent * ) Q_DECL_OVERRIDE;
     void hideEvent( QHideEvent * ) Q_DECL_OVERRIDE;
     void paintEvent(QPaintEvent *ev) Q_DECL_OVERRIDE;
-- 
GitLab


From fe605669e44828837891a083c00a625b2c591721 Mon Sep 17 00:00:00 2001
From: Steve Lhomme <robux4@ycbcr.xyz>
Date: Tue, 17 Dec 2024 08:50:57 +0100
Subject: [PATCH 27/33] qt: use screens() to get the list of screen

Gettting the desktop() object is deprecated and removed in Qt6 [^1].

[^1]: https://doc.qt.io/qt-6/widgets-changes-qt6.html#qdesktopwidget-and-qapplication-desktop
---
 modules/gui/qt/components/controller.cpp | 2 +-
 modules/gui/qt/main_interface.cpp        | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/gui/qt/components/controller.cpp b/modules/gui/qt/components/controller.cpp
index 32712adfe04b..dd3e598b0c42 100644
--- a/modules/gui/qt/components/controller.cpp
+++ b/modules/gui/qt/components/controller.cpp
@@ -1026,7 +1026,7 @@ void FullscreenControllerWidget::setTargetScreen(int screennumber)
 
 int FullscreenControllerWidget::targetScreen()
 {
-    if( i_screennumber < 0 || i_screennumber >= QApplication::desktop()->screenCount() )
+    if( i_screennumber < 0 || i_screennumber >= QGuiApplication::screens().length() )
         return QApplication::desktop()->screenNumber( p_intf->p_sys->p_mi );
     return i_screennumber;
 }
diff --git a/modules/gui/qt/main_interface.cpp b/modules/gui/qt/main_interface.cpp
index d6557683127e..1236ab07f9a8 100644
--- a/modules/gui/qt/main_interface.cpp
+++ b/modules/gui/qt/main_interface.cpp
@@ -875,7 +875,7 @@ void MainInterface::setVideoFullScreen( bool fs )
     {
         int numscreen = var_InheritInteger( p_intf, "qt-fullscreen-screennumber" );
 
-        if ( numscreen >= 0 && numscreen < QApplication::desktop()->screenCount() )
+        if ( numscreen >= 0 && numscreen < QGuiApplication::screens().length() )
         {
             if( fullscreenControls )
                 fullscreenControls->setTargetScreen( numscreen );
-- 
GitLab


From 57e48c402d2684e0164a0ec98bd546d8e47b9e91 Mon Sep 17 00:00:00 2001
From: Steve Lhomme <robux4@ycbcr.xyz>
Date: Mon, 16 Dec 2024 14:48:15 +0100
Subject: [PATCH 28/33] qt: use availableGeometry() from the primaryscreen

Gettting the desktop() object is deprecated and removed in Qt6 [^1].

[^1]: https://doc.qt.io/qt-6/widgets-changes-qt6.html#qdesktopwidget-and-qapplication-desktop
---
 modules/gui/qt/main_interface.cpp | 2 +-
 modules/gui/qt/util/qvlcframe.hpp | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/modules/gui/qt/main_interface.cpp b/modules/gui/qt/main_interface.cpp
index 1236ab07f9a8..156f4fa3e605 100644
--- a/modules/gui/qt/main_interface.cpp
+++ b/modules/gui/qt/main_interface.cpp
@@ -821,7 +821,7 @@ void MainInterface::setVideoSize( unsigned int w, unsigned int h )
          */
         if (b_autoresize)
         {
-            QRect screen = QApplication::desktop()->availableGeometry();
+            QRect screen = QGuiApplication::primaryScreen()->availableGeometry();
 #if HAS_QT56
             float factor = videoWidget->devicePixelRatioF();
 #else
diff --git a/modules/gui/qt/util/qvlcframe.hpp b/modules/gui/qt/util/qvlcframe.hpp
index fcbf75f8eee1..a139534c3d44 100644
--- a/modules/gui/qt/util/qvlcframe.hpp
+++ b/modules/gui/qt/util/qvlcframe.hpp
@@ -29,7 +29,7 @@
 #include <QApplication>
 #include <QMainWindow>
 #include <QKeyEvent>
-#include <QDesktopWidget>
+#include <QScreen>
 #include <QSettings>
 #include <QStyle>
 
@@ -115,7 +115,7 @@ class QVLCTools
             widget->resize(defSize);
 
             if(defPos.x() == 0 && defPos.y()==0)
-               widget->setGeometry(QStyle::alignedRect(Qt::LeftToRight, Qt::AlignCenter, widget->size(), qApp->desktop()->availableGeometry()));
+               widget->setGeometry(QStyle::alignedRect(Qt::LeftToRight, Qt::AlignCenter, widget->size(), QGuiApplication::primaryScreen()->availableGeometry()));
             return true;
           }
           return false;
-- 
GitLab


From e7c405b2d247a76676adfd1735a7172c65439495 Mon Sep 17 00:00:00 2001
From: Steve Lhomme <robux4@ycbcr.xyz>
Date: Tue, 17 Dec 2024 09:06:11 +0100
Subject: [PATCH 29/33] qt: use screenAt() to find the screen at a given
 position

Gettting the desktop() object is deprecated and removed in Qt6 [^1].

[^1]: https://doc.qt.io/qt-6/widgets-changes-qt6.html#qdesktopwidget-and-qapplication-desktop
---
 modules/gui/qt/components/controller.cpp | 18 ++++++++++++++++++
 modules/gui/qt/util/timetooltip.cpp      | 11 +++++++++++
 2 files changed, 29 insertions(+)

diff --git a/modules/gui/qt/components/controller.cpp b/modules/gui/qt/components/controller.cpp
index dd3e598b0c42..06231e41a484 100644
--- a/modules/gui/qt/components/controller.cpp
+++ b/modules/gui/qt/components/controller.cpp
@@ -52,6 +52,9 @@
 #include <QApplication>
 #include <QWindow>
 #include <QScreen>
+#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0)
+#include <QDesktopWidget>
+#endif
 
 //#define DEBUG_LAYOUT 1
 
@@ -1027,7 +1030,22 @@ void FullscreenControllerWidget::setTargetScreen(int screennumber)
 int FullscreenControllerWidget::targetScreen()
 {
     if( i_screennumber < 0 || i_screennumber >= QGuiApplication::screens().length() )
+    {
+#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
+        auto *screen = QGuiApplication::screenAt( p_intf->p_sys->p_mi->pos() );
+        if (screen != nullptr)
+        {
+            for (qsizetype i = 0; i < QGuiApplication::screens().length(); i++)
+            {
+                if (screen == QGuiApplication::screens()[i])
+                    return i;
+            }
+        }
+        return -1;
+#else
         return QApplication::desktop()->screenNumber( p_intf->p_sys->p_mi );
+#endif
+    }
     return i_screennumber;
 }
 
diff --git a/modules/gui/qt/util/timetooltip.cpp b/modules/gui/qt/util/timetooltip.cpp
index 6de5cf1877d7..ffa2c099868e 100644
--- a/modules/gui/qt/util/timetooltip.cpp
+++ b/modules/gui/qt/util/timetooltip.cpp
@@ -25,7 +25,11 @@
 #include <QPainter>
 #include <QBitmap>
 #include <QFontMetrics>
+#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0)
 #include <QDesktopWidget>
+#else
+#include <QScreen>
+#endif
 
 #define TIP_HEIGHT 5
 
@@ -76,7 +80,14 @@ void TimeTooltip::adjustPosition()
 #endif
 
     // Keep the tooltip on the same screen if possible
+#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
+    QRect screen{};
+    auto *screenAt = QGuiApplication::screenAt( mTarget );
+    if (screenAt != nullptr)
+        screen = screenAt->geometry();
+#else
     QRect screen = QApplication::desktop()->screenGeometry( mTarget );
+#endif
     position.setX( qMax( screen.left(), qMin( position.x(),
         screen.left() + screen.width() - size.width() ) ) );
     position.setY( qMax( screen.top(), qMin( position.y(),
-- 
GitLab


From cc662ee762b661a0ff8b7d11a17b66d5310c0723 Mon Sep 17 00:00:00 2001
From: Steve Lhomme <robux4@ycbcr.xyz>
Date: Tue, 17 Dec 2024 08:57:05 +0100
Subject: [PATCH 30/33] qt: get the screens geometry using screens()

Gettting the desktop() object is deprecated and removed in Qt6 [^1].

targetScreen() is always within the boundaries of QGuiApplication::screens().length()
or -1. And that's always the value used in controller.cpp.

[^1]: https://doc.qt.io/qt-6/widgets-changes-qt6.html#qdesktopwidget-and-qapplication-desktop
---
 modules/gui/qt/components/controller.cpp | 8 ++++----
 modules/gui/qt/main_interface.cpp        | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/modules/gui/qt/components/controller.cpp b/modules/gui/qt/components/controller.cpp
index 06231e41a484..2e327e5ab9d8 100644
--- a/modules/gui/qt/components/controller.cpp
+++ b/modules/gui/qt/components/controller.cpp
@@ -896,7 +896,7 @@ void FullscreenControllerWidget::restoreFSC()
         if ( targetScreen() < 0 )
             return;
 
-        QRect currentRes = QApplication::desktop()->screenGeometry( targetScreen() );
+        QRect currentRes = QGuiApplication::screens()[ targetScreen() ]->geometry();
         QWindow *wh = windowHandle();
         if ( wh != Q_NULLPTR )
         {
@@ -932,7 +932,7 @@ void FullscreenControllerWidget::restoreFSC()
 
 void FullscreenControllerWidget::centerFSC( int number )
 {
-    QRect currentRes = QApplication::desktop()->screenGeometry( number );
+    QRect currentRes = QGuiApplication::screens()[ number ]->geometry();
 
     /* screen has changed, calculate new position */
     QPoint pos = QPoint( currentRes.x() + (currentRes.width() / 2) - (width() / 2),
@@ -1006,7 +1006,7 @@ void FullscreenControllerWidget::slowHideFSC()
 
 void FullscreenControllerWidget::updateFullwidthGeometry( int number )
 {
-    QRect screenGeometry = QApplication::desktop()->screenGeometry( number );
+    QRect screenGeometry = QGuiApplication::screens()[ number ]->geometry();
     setMinimumWidth( screenGeometry.width() );
     setGeometry( screenGeometry.x(), screenGeometry.y() + screenGeometry.height() - height(), screenGeometry.width(), height() );
     adjustSize();
@@ -1138,7 +1138,7 @@ void FullscreenControllerWidget::mouseMoveEvent( QMouseEvent *event )
         int i_moveX = pos.x() - i_mouse_last_x;
         int i_moveY = pos.y() - i_mouse_last_y;
 
-        const QRect screenRect = QApplication::desktop()->screenGeometry( targetScreen() );
+        const QRect screenRect = QGuiApplication::screens()[ targetScreen() ]->geometry();
 
         const int i_x = qBound( screenRect.left(), x() + i_moveX, screenRect.right() - width() );
         const int i_y = qBound( screenRect.top(),  y() + i_moveY, screenRect.bottom() - height() );
diff --git a/modules/gui/qt/main_interface.cpp b/modules/gui/qt/main_interface.cpp
index 156f4fa3e605..d6a6e262392f 100644
--- a/modules/gui/qt/main_interface.cpp
+++ b/modules/gui/qt/main_interface.cpp
@@ -880,7 +880,7 @@ void MainInterface::setVideoFullScreen( bool fs )
             if( fullscreenControls )
                 fullscreenControls->setTargetScreen( numscreen );
 
-            QRect screenres = QApplication::desktop()->screenGeometry( numscreen );
+            QRect screenres = QGuiApplication::screens()[ numscreen ]->geometry();
             lastWinScreen = windowHandle()->screen();
 #ifdef QT5_HAS_WAYLAND
             if( !b_hasWayland )
-- 
GitLab


From bc5542668ae618b7cfbaf7345ba90adb8bf22e5d Mon Sep 17 00:00:00 2001
From: Steve Lhomme <robux4@ycbcr.xyz>
Date: Wed, 13 Nov 2024 14:29:27 +0100
Subject: [PATCH 31/33] contrib: mpcdec: only build libmpcdec

We don't need the rest.

(cherry picked from commit 22e73a44cf2b707fd0d825ad2eed5e882d003c25)
---
 ...tch-0001-shared.patch-from-buildroot.patch | 10 ++++----
 .../mpcdec/0007-only-build-libmpcdec.patch    | 24 +++++++++++++++++++
 contrib/src/mpcdec/musepack-asinh-msvc.patch  | 22 +++++++++++++----
 contrib/src/mpcdec/musepack-no-binaries.patch | 21 ++++++++++++----
 .../mpcdec/musepack-no-cflags-clobber.patch   | 21 ++++++++++++----
 5 files changed, 81 insertions(+), 17 deletions(-)
 create mode 100644 contrib/src/mpcdec/0007-only-build-libmpcdec.patch

diff --git a/contrib/src/mpcdec/0006-adapted-patch-0001-shared.patch-from-buildroot.patch b/contrib/src/mpcdec/0006-adapted-patch-0001-shared.patch-from-buildroot.patch
index b02e17a8501a..78223c415ec0 100644
--- a/contrib/src/mpcdec/0006-adapted-patch-0001-shared.patch-from-buildroot.patch
+++ b/contrib/src/mpcdec/0006-adapted-patch-0001-shared.patch-from-buildroot.patch
@@ -1,7 +1,7 @@
-From 617c72c7df93da5bcca2febbad066e31a411d976 Mon Sep 17 00:00:00 2001
+From 714e0e572ea7746831b5fa5434ea2669180e702f Mon Sep 17 00:00:00 2001
 From: r2d <r2d@c51c8d5e-032a-db11-a0f2-0002b3467eef>
 Date: Sun, 14 Feb 2016 22:07:10 +0000
-Subject: [PATCH 6/6] adapted patch 0001-shared.patch from buildroot:
+Subject: [PATCH 6/7] adapted patch 0001-shared.patch from buildroot:
  https://git.busybox.net/buildroot/tree/package/musepack/0001-shared.patch
  original changelog :
 
@@ -16,7 +16,7 @@ git-svn-id: http://svn.musepack.net/libmpc/trunk@491 c51c8d5e-032a-db11-a0f2-000
  1 file changed, 8 insertions(+), 5 deletions(-)
 
 diff --git a/libmpcdec/CMakeLists.txt b/libmpcdec/CMakeLists.txt
-index fb18968..fa9c800 100644
+index 5579d55..7ce5e94 100644
 --- a/libmpcdec/CMakeLists.txt
 +++ b/libmpcdec/CMakeLists.txt
 @@ -4,7 +4,6 @@ SET(mpcdec_VERSION_PATCH 1)
@@ -29,7 +29,7 @@ index fb18968..fa9c800 100644
  	${libmpc_SOURCE_DIR}/include/mpc/reader.h
 @@ -12,12 +11,16 @@ install(FILES
  	${libmpc_SOURCE_DIR}/include/mpc/mpc_types.h
- 	DESTINATION include/mpcdec COMPONENT headers)
+ 	DESTINATION include/mpc COMPONENT headers)
  
 +include_directories(${libmpc_SOURCE_DIR}/include)
  if(SHARED)
@@ -49,5 +49,5 @@ index fb18968..fa9c800 100644
  endif(SHARED)
  
 -- 
-2.37.3.windows.1
+2.45.0.windows.1
 
diff --git a/contrib/src/mpcdec/0007-only-build-libmpcdec.patch b/contrib/src/mpcdec/0007-only-build-libmpcdec.patch
new file mode 100644
index 000000000000..28cb2bf888ce
--- /dev/null
+++ b/contrib/src/mpcdec/0007-only-build-libmpcdec.patch
@@ -0,0 +1,24 @@
+From 0b5a35b4a87952465717a76d5dcdadf52b930ba9 Mon Sep 17 00:00:00 2001
+From: Steve Lhomme <robux4@ycbcr.xyz>
+Date: Wed, 13 Nov 2024 14:25:36 +0100
+Subject: [PATCH 7/7] only build libmpcdec
+
+We don't need anything else for VLC
+---
+ CMakeLists.txt | 3 ---
+ 1 file changed, 3 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 50666fe..237daf1 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -25,6 +25,3 @@ if(NOT MSVC)
+ endif(NOT MSVC)
+ 
+ add_subdirectory(libmpcdec)
+-add_subdirectory(libmpcpsy)
+-add_subdirectory(libmpcenc)
+-add_subdirectory(libwavformat)
+-- 
+2.45.0.windows.1
+
diff --git a/contrib/src/mpcdec/musepack-asinh-msvc.patch b/contrib/src/mpcdec/musepack-asinh-msvc.patch
index c6bb01e2c468..7efc3eb6302a 100644
--- a/contrib/src/mpcdec/musepack-asinh-msvc.patch
+++ b/contrib/src/mpcdec/musepack-asinh-msvc.patch
@@ -1,11 +1,25 @@
---- musepack.clean/libmpcpsy/psy_tab.c	2014-12-03 15:25:37.877616700 +0100
-+++ musepack/libmpcpsy/psy_tab.c	2014-12-03 15:20:59.300071300 +0100
-@@ -186,7 +187,7 @@
+From db238381db9763ca1a7fc066a613a087b37d87e2 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Hugo=20Beauz=C3=A9e-Luyssen?= <hugo@beauzee.fr>
+Date: Wed, 3 Dec 2014 15:47:33 +0100
+Subject: [PATCH 3/7] contribs: Fix mpcdec build with MSVC
+
+---
+ libmpcpsy/psy_tab.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libmpcpsy/psy_tab.c b/libmpcpsy/psy_tab.c
+index 35c56ac..698601c 100644
+--- a/libmpcpsy/psy_tab.c
++++ b/libmpcpsy/psy_tab.c
+@@ -187,7 +187,7 @@ Ruhehoerschwelle ( PsyModel* m,
      }
  }
-
+ 
 -#ifdef _MSC_VER
 +#if defined(_MSC_VER) && _MSC_VER < 1800
  static double
  asinh ( double x )
  {
+-- 
+2.45.0.windows.1
+
diff --git a/contrib/src/mpcdec/musepack-no-binaries.patch b/contrib/src/mpcdec/musepack-no-binaries.patch
index bb48e8515f66..0bf76c45f1a1 100644
--- a/contrib/src/mpcdec/musepack-no-binaries.patch
+++ b/contrib/src/mpcdec/musepack-no-binaries.patch
@@ -1,7 +1,17 @@
-diff -urN musepack_src_r475.clean/CMakeLists.txt musepack_src_r475/CMakeLists.txt
---- musepack_src_r475.clean/CMakeLists.txt	2012-04-17 15:16:37.000000000 +0400
-+++ musepack_src_r475/CMakeLists.txt	2012-04-17 15:17:07.000000000 +0400
-@@ -23,11 +23,4 @@
+From 22bfcda42e120ffe18b727a53b346fb489ebd88f Mon Sep 17 00:00:00 2001
+From: Pavlov Konstantin <thresh@videolan.org>
+Date: Tue, 17 Apr 2012 13:18:34 +0200
+Subject: [PATCH 2/7] don't build binaries
+
+---
+ CMakeLists.txt | 7 -------
+ 1 file changed, 7 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index a6478c5..06d4363 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -23,11 +23,4 @@ add_subdirectory(libmpcdec)
  add_subdirectory(libmpcpsy)
  add_subdirectory(libmpcenc)
  add_subdirectory(libwavformat)
@@ -13,3 +23,6 @@ diff -urN musepack_src_r475.clean/CMakeLists.txt musepack_src_r475/CMakeLists.tx
 -add_subdirectory(mpcchap)
 -add_subdirectory(wavcmp)
  add_subdirectory(include)
+-- 
+2.45.0.windows.1
+
diff --git a/contrib/src/mpcdec/musepack-no-cflags-clobber.patch b/contrib/src/mpcdec/musepack-no-cflags-clobber.patch
index 2a376e33b8fd..f2e5251faee6 100644
--- a/contrib/src/mpcdec/musepack-no-cflags-clobber.patch
+++ b/contrib/src/mpcdec/musepack-no-cflags-clobber.patch
@@ -1,7 +1,17 @@
-diff -ru musepack.orig/CMakeLists.txt musepack/CMakeLists.txt
---- musepack.orig/CMakeLists.txt	2011-08-08 10:21:17.000000000 +0300
-+++ musepack/CMakeLists.txt	2011-08-08 10:21:03.000000000 +0300
-@@ -16,7 +16,7 @@
+From 1f177a63ae04331f07be40b6cbfda312c51ac0c8 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?R=C3=A9mi=20Denis-Courmont?= <remi@remlab.net>
+Date: Mon, 8 Aug 2011 17:31:04 +0200
+Subject: [PATCH 1/7] do not clobber our precious CFLAGS
+
+---
+ CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index b13f78c..a6478c5 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -16,7 +16,7 @@ endif(WIN32)
  add_definitions(-DFAST_MATH -DCVD_FASTLOG)
  
  if(NOT MSVC)
@@ -10,3 +20,6 @@ diff -ru musepack.orig/CMakeLists.txt musepack/CMakeLists.txt
  endif(NOT MSVC)
  
  add_subdirectory(libmpcdec)
+-- 
+2.45.0.windows.1
+
-- 
GitLab


From e2faac7b2665827219ab6a98637edd6ac244089e Mon Sep 17 00:00:00 2001
From: Steve Lhomme <robux4@ycbcr.xyz>
Date: Mon, 18 Nov 2024 13:43:12 +0100
Subject: [PATCH 32/33] contrib: mpcdec: apply all patches

The build reduction patch was added but not called in 22e73a44cf2b707fd0d825ad2eed5e882d003c25.

(cherry picked from commit fc6bc315243345a4798618ccaa3135b61660edca)
---
 contrib/src/mpcdec/rules.mak | 1 +
 1 file changed, 1 insertion(+)

diff --git a/contrib/src/mpcdec/rules.mak b/contrib/src/mpcdec/rules.mak
index 3452f1205fa6..f12959694671 100644
--- a/contrib/src/mpcdec/rules.mak
+++ b/contrib/src/mpcdec/rules.mak
@@ -32,6 +32,7 @@ musepack: musepack_src_r$(MUSE_REV).tar.gz .sum-mpcdec
 	$(APPLY) $(SRC)/mpcdec/0004-libmpcdec-added-install-and-soversion.patch
 	$(APPLY) $(SRC)/mpcdec/0005-If-BUILD_SHARED_LIBS-is-set-and-SHARED-undefined-the.patch
 	$(APPLY) $(SRC)/mpcdec/0006-adapted-patch-0001-shared.patch-from-buildroot.patch
+	$(APPLY) $(SRC)/mpcdec/0007-only-build-libmpcdec.patch
 	$(MOVE)
 
 .mpcdec: musepack toolchain.cmake
-- 
GitLab


From 64288d6f6df04d81f995a7d306c882deaf2f7a02 Mon Sep 17 00:00:00 2001
From: Steve Lhomme <robux4@ycbcr.xyz>
Date: Wed, 5 Feb 2025 13:56:31 +0100
Subject: [PATCH 33/33] CI: add a Debian target to compile with Qt6

And plenty of newer system packages on Linux.
---
 extras/ci/gitlab-ci.yml | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/extras/ci/gitlab-ci.yml b/extras/ci/gitlab-ci.yml
index f3282108ddfb..eaeadf824cd9 100644
--- a/extras/ci/gitlab-ci.yml
+++ b/extras/ci/gitlab-ci.yml
@@ -18,6 +18,7 @@ variables:
     VLC_UWP_LLVM_IMAGE: registry.videolan.org/vlc-debian-llvm-uwp:20211020111246
     VLC_WIN_LLVM_UCRT_IMAGE: registry.videolan.org/vlc-debian-llvm-ucrt:20241111035123
     VLC_DEBIAN_IMAGE: registry.videolan.org/vlc-debian-unstable:20200229201904
+    VLC_DEBIAN_QT6_IMAGE: registry.videolan.org/vlc-debian-unstable:20241112155431
     VLC_ANDROID_IMAGE: registry.videolan.org/vlc-debian-android-3.0:20230621085943
     VLC_SNAP_IMAGE: registry.videolan.org/vlc-ubuntu-bionic:20190627090437
 
@@ -268,6 +269,37 @@ debian:
         fi
     variables: *variables-debian
 
+debian-qt6:
+    extends: .docker-template
+    image:
+        name: $VLC_DEBIAN_QT6_IMAGE
+    script: |
+        export NCPU=$(getconf _NPROCESSORS_ONLN)
+
+        # Build tools
+        ( cd extras/tools && ./bootstrap && make -j$NCPU --output-sync=recurse )
+        export PATH="$(pwd)/extras/tools/build/bin:$PATH"
+
+        # Build contribs
+        mkdir -p contrib/contrib-$TRIPLET && cd contrib/contrib-$TRIPLET
+        ../bootstrap
+        make list
+        if [ -n "$VLC_PREBUILT_CONTRIBS_URL" ]; then
+            echo "Building using prebuilt contribs at $VLC_PREBUILT_CONTRIBS_URL"
+            make prebuilt PREBUILT_URL="${VLC_PREBUILT_CONTRIBS_URL}"
+        else
+            make -j$NCPU --output-sync=recurse fetch
+            make -j$NCPU --output-sync=recurse
+            make package
+        fi
+        cd ../../
+
+        # Build VLC
+        ./bootstrap
+        ./configure
+        make -j$NCPU
+    variables: *variables-debian
+
 nightly-debian:
     extends: debian
     only:
-- 
GitLab