From a158d3cbd3f997480c483900ac6a35aca6475fb0 Mon Sep 17 00:00:00 2001 From: Ismael Asensio Date: Thu, 23 Apr 2020 22:43:37 +0200 Subject: [PATCH] Rules kcm: Use new property ComboBox.currentValue Summary: Use the properties `valueRole` and `currentValue`, introduced in Qt5.14 for `QQC2.ComboBox` This didn't work before due to QQC2 version being mis-detected at build time, so the code mocked an internal `currentValue` property. After D28859, it is now required to fix: "file:///home/nate/kde/usr/share/kpackage/kcms/kcm_kwinrules/contents/ui/RulesEditor.qml" "Error loading QML file.\n42: Type RuleItemDelegate unavailable\n68: Type OptionsComboBox unavailable\n35: Cannot override FINAL property\n" QCoreApplication::postEvent: Unexpected null receiver Test Plan: Try to edit a rule or add a new one. The rule editor page shows. Reviewers: ngraham, #kwin, zzag Reviewed By: ngraham, #kwin, zzag Subscribers: kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D29145 --- .../kwinrules/package/contents/ui/OptionsComboBox.qml | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/kcmkwin/kwinrules/package/contents/ui/OptionsComboBox.qml b/kcmkwin/kwinrules/package/contents/ui/OptionsComboBox.qml index 6bcbe4b6d9..3da65fac89 100644 --- a/kcmkwin/kwinrules/package/contents/ui/OptionsComboBox.qml +++ b/kcmkwin/kwinrules/package/contents/ui/OptionsComboBox.qml @@ -29,15 +29,7 @@ QQC2.ComboBox { id: optionsCombo textRole: "display" - //TODO: After KF5 (qqc2-desktop-style) depends on Qt 5.15 this can be simplified using newer API - // (https://bugs.kde.org/show_bug.cgi?id=419521) - // valueRole: "value" - property var currentValue - - onActivated: (index) => { - var modelIndex = model.index(index, 0); - currentValue = model.data(modelIndex, Qt.UserRole); - } + valueRole: "value" property bool multipleChoice: false property int selectionMask: 0