Bug 419521

Summary: ComboBox.valueRole is not available
Product: [Frameworks and Libraries] frameworks-qqc2-desktop-style Reporter: Dr. Incognito <v2ray.dev>
Component: generalAssignee: Marco Martin <notmart>
Status: RESOLVED FIXED    
Severity: major CC: kde
Priority: NOR    
Version: 5.68.0   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:

Description Dr. Incognito 2020-04-02 03:23:54 UTC
SUMMARY

As discussed in https://github.com/Dr-Incognito/V2Ray-Desktop/issues/2, the package `qqc2-desktop-style` provides a very old version of ComboBox.qml.

The programs built with newer versions of Qt cannot run normally because they use the one located in /usr/lib/qt/qml/QtQuick/Controls.2/org.kde.desktop/ComboBox.qml instead of /usr/lib/qt/qml/QtQuick/Controls.2/ComboBox.qml.

Could you tell me how to solve this issue?

STEPS TO REPRODUCE
1. git clone https://github.com/Dr-Incognito/V2Ray-Desktop.git
2. git submodule init
3. git submodule update --progress
4. cd V2Ray-Desktop
5. mkdir -p build && cd build
6. qmake PREFIX=/usr ../src
7. make -j$nproc
8. ./V2Ray-Desktop 

OBSERVED RESULT

Click the "Servers" in the sidebar, the right panel is blank.
You will also get an error message saying that "ComboBox.valueRole is not available".

EXPECTED RESULT

Click the "Servers" in the sidebar, the right panel can be loaded normally.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch Linux / 5.68.0
(available in About System)
KDE Plasma Version: 5.68.0
KDE Frameworks Version: 5.68.0
Qt Version: 5.14.1

ADDITIONAL INFORMATION
Comment 1 David Edmundson 2020-04-02 08:17:06 UTC
I'm not building some other piece of software.

If there is a problem with combobox it should be reproducible in a few lines of qmlscene.
Comment 2 David Edmundson 2020-04-02 08:20:54 UTC
valueRole was introduced in the template in 5.14

Our style sets our included version of QtQuick.Templates to the version of Qt that the style is built with. Rebuilding frameworks against 5.14 should resolve the issue.

Note as a bad workaround, you can set the style env var, which will skip our theme being loaded.
Comment 3 Dr. Incognito 2020-04-02 14:15:01 UTC
Thank you for your reply.

Rebuilding the KDE framework seems impossible for all users.
Could you tell me what env to set?


(In reply to David Edmundson from comment #2)
> valueRole was introduced in the template in 5.14
> 
> Our style sets our included version of QtQuick.Templates to the version of
> Qt that the style is built with. Rebuilding frameworks against 5.14 should
> resolve the issue.
> 
> Note as a bad workaround, you can set the style env var, which will skip our
> theme being loaded.
Comment 4 David Edmundson 2020-04-02 14:20:02 UTC
QT_QUICK_CONTROLS_STYLE=fusion ./app

or you can do it programmatically inside your app
QQuickStyle::setStyle("fusion");


In terms of a long term fix Qt6 is scrapping import versions, so given Qt5.15 is nearly out, there's probably not much that's worth doing our side, it'll fix itself with time.
Comment 5 Dr. Incognito 2020-04-03 00:29:27 UTC
It works now.
Thanks for your help.
Comment 6 David Edmundson 2020-04-03 12:37:28 UTC
NP, sorry for indirectly breaking your software