[vlc-commits] [Git][videolan/vlc][master] qt: use std::monostate instead of null pointer
Steve Lhomme (@robUx4)
gitlab at videolan.org
Sat Jul 27 06:35:09 UTC 2024
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
fde67553 by Fatih Uzunoglu at 2024-07-27T06:11:10+00:00
qt: use std::monostate instead of null pointer
- - - - -
3 changed files:
- modules/gui/qt/player/player_controller_p.hpp
- modules/gui/qt/playlist/playlist_controller_p.hpp
- modules/gui/qt/playlist/playlist_model_p.hpp
Changes:
=====================================
modules/gui/qt/player/player_controller_p.hpp
=====================================
@@ -60,7 +60,10 @@ public:
{
Q_Q(PlayerController);
#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
- QMetaObject::invokeMethod(q, [fun = std::forward<Fun>(fun)]() -> void* { fun(); return nullptr; }, Qt::QueuedConnection);
+ // NOTE: Starting with Qt 6.7.0, lambda expression here without a return value
+ // causes compilation issues with some compilers.
+ // TODO: Find out if a more recent Qt version does not behave that way.
+ QMetaObject::invokeMethod(q, [fun = std::forward<Fun>(fun)]() -> std::monostate { fun(); return std::monostate{}; }, Qt::QueuedConnection);
#else
QMetaObject::invokeMethod(q, std::forward<Fun>(fun), Qt::QueuedConnection, nullptr);
#endif
=====================================
modules/gui/qt/playlist/playlist_controller_p.hpp
=====================================
@@ -43,7 +43,10 @@ public:
{
Q_Q(PlaylistController);
#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
- QMetaObject::invokeMethod(q, [fun = std::forward<Fun>(fun)]() -> void* { fun(); return nullptr; }, Qt::QueuedConnection);
+ // NOTE: Starting with Qt 6.7.0, lambda expression here without a return value
+ // causes compilation issues with some compilers.
+ // TODO: Find out if a more recent Qt version does not behave that way.
+ QMetaObject::invokeMethod(q, [fun = std::forward<Fun>(fun)]() -> std::monostate { fun(); return std::monostate{}; }, Qt::QueuedConnection);
#else
QMetaObject::invokeMethod(q, std::forward<Fun>(fun), Qt::QueuedConnection, nullptr);
#endif
=====================================
modules/gui/qt/playlist/playlist_model_p.hpp
=====================================
@@ -42,7 +42,10 @@ public:
{
Q_Q(PlaylistListModel);
#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
- QMetaObject::invokeMethod(q, [fun = std::forward<Fun>(fun)]() -> void* { fun(); return nullptr; }, Qt::QueuedConnection);
+ // NOTE: Starting with Qt 6.7.0, lambda expression here without a return value
+ // causes compilation issues with some compilers.
+ // TODO: Find out if a more recent Qt version does not behave that way.
+ QMetaObject::invokeMethod(q, [fun = std::forward<Fun>(fun)]() -> std::monostate { fun(); return std::monostate{}; }, Qt::QueuedConnection);
#else
QMetaObject::invokeMethod(q, std::forward<Fun>(fun), Qt::QueuedConnection, nullptr);
#endif
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/fde6755330b12d558e08751cbf5030432e645a3a
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/fde6755330b12d558e08751cbf5030432e645a3a
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list