[vlc-commits] [Git][videolan/vlc][master] qt: fail early if QtQuick.Effects module presence does not match the expectation

Steve Lhomme (@robUx4) gitlab at videolan.org
Mon Oct 28 07:25:15 UTC 2024



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
4c934bc0 by Fatih Uzunoglu at 2024-10-28T07:09:48+00:00
qt: fail early if QtQuick.Effects module presence does not match the expectation

If Qt version is at least 6.5.0, the application expects that QtQuick.Effects
module is available. If it is not available, the interface is going to encounter
error when a type provided by that module is used and end up being in broken state.

If we fail early, as we do with the other modules, then the interface will close
gracefully.

Qt always logs when an imported module is not found. The user should install the
required module using the package manager. This module is already provided with
the contrib Qt.

- - - - -


2 changed files:

- modules/gui/qt/maininterface/mainui.cpp
- modules/gui/qt/maininterface/qml/MainInterface.qml


Changes:

=====================================
modules/gui/qt/maininterface/mainui.cpp
=====================================
@@ -447,6 +447,12 @@ void MainUI::registerQMLTypes()
         qmlRegisterModule(uri, versionMajor, versionMinor);
         qmlProtectModule(uri, versionMajor);
     }
+
+#if QT_VERSION < QT_VERSION_CHECK(6, 5, 0)
+    // Dummy QtQuick.Effects module
+    qmlRegisterModule("QtQuick.Effects", 0, 0);
+    // Do not protect, types can still be registered.
+#endif
 }
 
 void MainUI::onQmlWarning(const QList<QQmlError>& qmlErrors)


=====================================
modules/gui/qt/maininterface/qml/MainInterface.qml
=====================================
@@ -25,6 +25,7 @@ import QtQuick.Layouts
 import QtQuick.Templates
 import QtQuick.Controls
 import QtQuick.Window
+import QtQuick.Effects
 import Qt5Compat.GraphicalEffects
 
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/4c934bc0c254db504194136829e4ee149fe132f7

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/4c934bc0c254db504194136829e4ee149fe132f7
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