[vlc-devel] [PATCH 3/7] qml: fix qml errors in OverlayMenu

Fatih Uzunoglu fuzun54 at outlook.com
Sun Apr 11 21:45:28 UTC 2021


This patch fixes a component which tries to access
undefined object and tries to assign undefined to
QString.

fixes part of #25601.
---
 modules/gui/qt/widgets/qml/OverlayMenu.qml | 24 +++++++++++++---------
 1 file changed, 14 insertions(+), 10 deletions(-)

diff --git a/modules/gui/qt/widgets/qml/OverlayMenu.qml b/modules/gui/qt/widgets/qml/OverlayMenu.qml
index 8e4af0ca72..dd375451b5 100644
--- a/modules/gui/qt/widgets/qml/OverlayMenu.qml
+++ b/modules/gui/qt/widgets/qml/OverlayMenu.qml
@@ -279,18 +279,22 @@ Item {
                         color: colors.text
                     }
 
-                    ListLabel {
-                        visible: modelData.marking.length >= 1
-
-                        Layout.alignment: Qt.AlignHCenter
+                    Loader {
+                        active: (button.yieldsAnotherModel ||
+                                 ( (!!modelData.marking) && (modelData.marking.length >= 1) ))
+
+                        sourceComponent: ListLabel {
+                            Layout.alignment: Qt.AlignHCenter
+
+                            text: {
+                                if (button.yieldsAnotherModel)
+                                    "⮕"
+                                else if (!!modelData.marking)
+                                    modelData.marking
+                            }
 
-                        text: {
-                            if (button.yieldsAnotherModel)
-                                "⮕"
-                            else if (!!modelData.marking)
-                                modelData.marking
+                            color: colors.text
                         }
-                        color: colors.text
                     }
                 }
 
-- 
2.27.0



More information about the vlc-devel mailing list