Skip to content

Conversation

@Sportacandy
Copy link

Quick patch for Qt6 build. Confirmed that SMPlayer can be built with Qt6.8.3+minGW13.1.0 and Qt5.15.2+minGW12.0.0, and both are working well.

@Raza-0007 Raza-0007 mentioned this pull request Aug 24, 2025
44 tasks
@smplayer-dev
Copy link
Owner

Thank you so much.

Unfortunately it fails to compile in my computer (Ubuntu, Qt 6.2.4):


In file included from prefinterface.h:22,
                 from preferencesdialog.cpp:25:
.ui/ui_prefinterface.h: In member function ‘void Ui_PrefInterface::setupUi(QWidget*)’:
.ui/ui_prefinterface.h:834:25: error: no matching function for call to ‘QObject::connect(QSlider*&, void (QAbstractSlider::*)(int), QLabel*&, <unresolved overloaded function type>)’
  834 |         QObject::connect(floating_width_slider, &QSlider::valueChanged, floating_width_label, &QLabel::setNum);
      |         ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/x86_64-linux-gnu/qt6/QtCore/qvariant.h:51,
                 from /usr/include/x86_64-linux-gnu/qt6/QtCore/QVariant:1,
                 from .ui/ui_preferencesdialog.h:12,
                 from preferencesdialog.h:22,
                 from preferencesdialog.cpp:20:
/usr/include/x86_64-linux-gnu/qt6/QtCore/qobject.h:217:43: note: candidate: ‘template<class Func1, class Func2> static QMetaObject::Connection QObject::connect(const typename QtPrivate::FunctionPointer<Func>::Object*, Func1, const typename QtPrivate::FunctionPointer<Func2>::Object*, Func2, Qt::ConnectionType)’
  217 |     static inline QMetaObject::Connection connect(const typename QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal,
      |                                           ^~~~~~~
/usr/include/x86_64-linux-gnu/qt6/QtCore/qobject.h:217:43: note:   template argument deduction/substitution failed:
In file included from prefinterface.h:22,
                 from preferencesdialog.cpp:25:
.ui/ui_prefinterface.h:834:25: note:   couldn’t deduce template parameter ‘Func2’
  834 |         QObject::connect(floating_width_slider, &QSlider::valueChanged, floating_width_label, &QLabel::setNum);
      |         ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/x86_64-linux-gnu/qt6/QtCore/qvariant.h:51,
                 from /usr/include/x86_64-linux-gnu/qt6/QtCore/QVariant:1,
                 from .ui/ui_preferencesdialog.h:12,
                 from preferencesdialog.h:22,
                 from preferencesdialog.cpp:20:
/usr/include/x86_64-linux-gnu/qt6/QtCore/qobject.h:249:13: note: candidate: ‘template<class Func1, class Func2> static typename std::enable_if<((int)(QtPrivate::FunctionPointer<Func2>::ArgumentCount) >= 0), QMetaObject::Connection>::type QObject::connect(const typename QtPrivate::FunctionPointer<Func>::Object*, Func1, Func2)’
  249 |             connect(const typename QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal, Func2 slot)
      |             ^~~~~~~
/usr/include/x86_64-linux-gnu/qt6/QtCore/qobject.h:249:13: note:   template argument deduction/substitution failed:
In file included from prefinterface.h:22,
                 from preferencesdialog.cpp:25:
.ui/ui_prefinterface.h:834:25: note:   candidate expects 3 arguments, 4 provided
  834 |         QObject::connect(floating_width_slider, &QSlider::valueChanged, floating_width_label, &QLabel::setNum);
      |         ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/x86_64-linux-gnu/qt6/QtCore/qvariant.h:51,
                 from /usr/include/x86_64-linux-gnu/qt6/QtCore/QVariant:1,
                 from .ui/ui_preferencesdialog.h:12,
                 from preferencesdialog.h:22,
                 from preferencesdialog.cpp:20:

And a lot of similar errors.

@Sportacandy
Copy link
Author

Sportacandy commented Aug 31, 2025

Qt 6.2 is too different from recent Qt releases such as Qt 6.8.x. The reason why I used Qt 6.8 is that It's the latest LTS.
I recommend updating the Qt to Qt6.8.x to apply my patch.

smplayer-dev added a commit that referenced this pull request Sep 1, 2025
@smplayer-dev
Copy link
Owner

I've just applied your patch and fixed the compiling problems with Qt 6.2 in this branch:
https://github.com/smplayer-dev/smplayer/tree/qt6

@Raza-0007
Copy link

Raza-0007 commented Sep 2, 2025

Ricardo, I am assuming you chose Qt 6.2 for better compatibility with Qt 5.15 as explained in this article. But the problem is that Qt 6.2 LTS went out of support on September 2024, no bug fixes or security patches since then, so we are back in the same boat as we were with Qt 5.15!

It would be better to choose Qt 6.8 LTS released on October 2024, as it will be supported for 5 years until September 2029. A little effort now will ensure next 5 years of peace 😉

@smplayer-dev
Copy link
Owner

It's not a matter of choice, it's just that Linux distros include old versions of Qt.

@a17r
Copy link

a17r commented Sep 2, 2025

@smplayer-dev These distro (versions) are unlikely to ever package a future Qt6-based version of smplayer and they won't drop the Qt5-based version either. If you are looking at release-based distributions for Qt support choice, near-term upcoming distro releases should be your target. That gives you the freedom to straighten up at least the latest ifdef offshoots in an ever-growing jungle.

@Raza-0007
Copy link

Raza-0007 commented Sep 2, 2025

I am not a developer, but for an open source software like smplayer, you should be able to download Qt 6.8 LTS for Linux directly from the Qt website. You should not have to depend on your Linux distros built-in Qt.

Just go to the official open source Qt download site. Choose the online installer, it will guide you step-by-step, choose Qt 6.8.x and required modules, and since smplayer is open source, licensing should be taken care of as well. That should be all one needs to compile smplayer with Qt 6.8.x, unless I am missing something, as I mentioned previously, I am not a developer.

@maverick74
Copy link

@smplayer-dev These distro (versions) are unlikely to ever package a future Qt6-based version of smplayer and they won't drop the Qt5-based version either. If you are looking at release-based distributions for Qt support choice, near-term upcoming distro releases should be your target. That gives you the freedom to straighten up at least the latest ifdef offshoots in an ever-growing jungle.

I'm with @a17r on this! Supporting the last LTS does make sense, but older than that is crazy!

If a distro wants to keep software that old it should be their job to do so! Or they can always use the last player version that was compatible with it!

Software devs, from my pov, should only care about the latest stable release and latest LTS! (naturally, while developing, the target is always master/vanilla)... but this is "my" view of it! I'm not dictating anything! Each dev chooses!
But the line has to be drawn somewhere (or risk going crazy ahah)

@Raza-0007
Copy link

I posted a brief feedback for the Qt 6.8 version of smplayer for Windows OS in Qt6 Roadmap thread, I thought I should link it here as well in case someone is following this thread and not the other one.

@VVD
Copy link

VVD commented Nov 13, 2025

Quick patch for Qt6 build. Confirmed that SMPlayer can be built with Qt6.8.3+minGW13.1.0 and Qt5.15.2+minGW12.0.0, and both are working well.

Why replace tabs with spaces in patch?

@Sportacandy
Copy link
Author

Why replace tabs with spaces in patch?

Oh, no special reason, just due to my preference for QtCreator("Default tab policy").

@a17r
Copy link

a17r commented Nov 19, 2025

@Sportacandy Formatting changes should never be intermingled with substantial changes. Existing formatting, indendation, basic coding style, should be adhered to, just as we expect uniform line endings.

Ideally of course, the upstream project would define an .editorconfig that would automatically bind your QtCreator instance to its will.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants