]> Some of my projects - aniplayer.git/commitdiff
String properties can not be null
authorAPTX <marek321@gmail.com>
Mon, 21 Feb 2022 14:50:36 +0000 (23:50 +0900)
committerAPTX <marek321@gmail.com>
Mon, 21 Feb 2022 14:50:36 +0000 (23:50 +0900)
uiplugins/ui_desktop_qml_default/qml/ComboButton.qml

index 61f929b120ae2ccd873ee4901db9e927d6213e73..185a6379796f6af98c43814e9891c9986bcec39c 100644 (file)
@@ -3,7 +3,7 @@ import QtQuick 2.0
 BasicButton {
     property var model: null
     property int currentIndex: 0
-    property string textRole: null
+    property string textRole: ""
 
     signal activated(int index)
 
@@ -15,7 +15,7 @@ BasicButton {
 
     text: {
         if (!model) return "-";
-        if (textRole) return model.data(model.index(currentIndex, 0), textRole);
+        if (textRole.length) return model.data(model.index(currentIndex, 0), textRole);
         if (currentIndex) return "-";
         return (currentIndex - 1);
     }