Bug 386289 - QQC2 Causes QtQuickControls 2.2 Slider to fail to load QML with component version error
Summary: QQC2 Causes QtQuickControls 2.2 Slider to fail to load QML with component ver...
Status: RESOLVED FIXED
Alias: None
Product: frameworks-qqc2-desktop-style
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 5.40.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Marco Martin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-10-28 19:07 UTC by Mike
Modified: 2017-12-05 11:24 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Version error ss (22.77 KB, image/png)
2017-11-27 14:37 UTC, Mike
Details
QML Item with QtControls in a Plasmoid (4.65 KB, text/plain)
2017-12-05 11:23 UTC, Mike
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike 2017-10-28 19:07:30 UTC
With QQC2 installed on Tumbleweed, with the latest KF5.39 (factory repo), my apps (binaries) and plasmoids QML fails to load, specifically referencing my use of Slider from QtQuickControls 2.2.  If I use any properties/signals from the Slider 2.2, the QML fails to load.  If I comment out the 2.2 properties/signals, the QML loads.

If I uninstall the QQC2, the binaries and plasmoids continue loading the QML as before.

Easy to repro, just make sure QQC2 is installed, add a Slider from QtQuickControls 2.2, use a property like "live" or a signal like "moved" and the QML will not load.  Remove QQC2 and then try to load the QML Item and it will work.
Comment 1 Mike 2017-10-30 11:32:54 UTC
Example of a plasmoid that fails to load with QQC2 installed on 5.39:

https://store.kde.org/p/1194975/

Install, add to a panel or desktop.  If QQC2 is installed, it won't load.  Uninstall QQC2 and it will load.
Comment 2 Chris Rizzitello 2017-11-25 13:51:21 UTC
I have a similar issue in arch but with the combobox. This seams to only happens with qqc2-desktop-style installed. 

example qml below
~~~~~~
import QtQuick 2.2
import QtQuick.Controls 2.2
     
ComboBox {
    editable: true
}
~~~~~~
Comment 3 Marco Martin 2017-11-27 14:12:15 UTC
any debug output when the app is launched in a terminal?
Comment 4 Chris Rizzitello 2017-11-27 14:24:47 UTC
(In reply to Marco Martin from comment #3)
> any debug output when the app is launched in a terminal?

In the example above the only terminal out put is 
"ComboBox.editable" is not available due to component versioning
Comment 5 Mike 2017-11-27 14:37:38 UTC
Created attachment 109080 [details]
Version error ss

Thought I had attached this previously...anyway, I'm running the plasmoid from the terminal with:

plasmoidviewer -f planar -a plasmoid/
Comment 6 Urs Joss 2017-11-27 14:39:39 UTC
And in my case (failing to start elisa (from git-repo) on archlinux):

=== snip ===
[urs@ctcsh06 elisa-git (master)]$ elisa
org.kde.kcoreaddons: Error loading plugin "kcm_elisa_local_file" "The shared library was not found." 
Plugin search paths are ("/usr/lib/qt/plugins", "/usr/bin") 
The environment variable QT_PLUGIN_PATH might be not correctly set
QQmlApplicationEngine failed to load component
qrc:/MediaServer.qml:391 Type HeaderBar unavailable
qrc:/HeaderBar.qml:138 Type MediaPlayerControl unavailable
qrc:/MediaPlayerControl.qml:323 "Controls2.Slider.live" is not available due to component versioning.
=== snap ===
Comment 7 Marco Martin 2017-11-29 10:04:06 UTC
Git commit d0e3daafdbdd858a5ee6e6b0b2de6a7a39ff27f1 by Marco Martin.
Committed on 29/11/2017 at 10:03.
Pushed by mart into branch 'master'.

determine QQC2 version at build time

Summary:
the qqc2 theme style needs to import the same qqc2 version
than the latest one available in the installed Qt, otherwise
users of QQC2 will only be able to use features available in
Qt 5.7, even if they have a more recent Qt installed.
this will also be needed to conditionally support the icon
property introduced  in Qt 5.10

Test Plan:
kirigami gallery works with the style installed in this way
it will need a better way to figure out what the available
qqc2 version is

Reviewers: #plasma, rizzitello, davidedmundson, apol

Reviewed By: #plasma, rizzitello, davidedmundson, apol

Subscribers: apol, rizzitello, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D9021

M  +20   -1    CMakeLists.txt
M  +1    -1    org.kde.desktop/Button.qml
M  +2    -2    org.kde.desktop/CheckBox.qml
M  +1    -1    org.kde.desktop/CheckDelegate.qml
M  +31   -3    org.kde.desktop/ComboBox.qml
M  +1    -1    org.kde.desktop/Container.qml
M  +1    -1    org.kde.desktop/Control.qml
M  +2    -2    org.kde.desktop/Dial.qml
M  +1    -1    org.kde.desktop/Dialog.qml
M  +1    -1    org.kde.desktop/DialogButtonBox.qml
M  +2    -2    org.kde.desktop/Drawer.qml
M  +2    -2    org.kde.desktop/Frame.qml
M  +2    -2    org.kde.desktop/GroupBox.qml
M  +1    -1    org.kde.desktop/ItemDelegate.qml
M  +1    -1    org.kde.desktop/Label.qml
M  +2    -2    org.kde.desktop/Menu.qml
M  +1    -1    org.kde.desktop/MenuItem.qml
M  +1    -1    org.kde.desktop/Popup.qml
M  +1    -1    org.kde.desktop/ProgressBar.qml
M  +2    -2    org.kde.desktop/RadioButton.qml
M  +1    -1    org.kde.desktop/RadioDelegate.qml
M  +2    -2    org.kde.desktop/RangeSlider.qml
M  +1    -1    org.kde.desktop/ScrollBar.qml
M  +2    -2    org.kde.desktop/ScrollView.qml
M  +1    -1    org.kde.desktop/Slider.qml
M  +1    -1    org.kde.desktop/SpinBox.qml
M  +1    -1    org.kde.desktop/Switch.qml
M  +1    -1    org.kde.desktop/SwitchDelegate.qml
M  +1    -1    org.kde.desktop/TabBar.qml
M  +2    -2    org.kde.desktop/TabButton.qml
M  +1    -1    org.kde.desktop/TextArea.qml
M  +2    -2    org.kde.desktop/TextField.qml
M  +1    -1    org.kde.desktop/ToolBar.qml
M  +1    -1    org.kde.desktop/ToolButton.qml
M  +2    -2    org.kde.desktop/ToolTip.qml

https://commits.kde.org/qqc2-desktop-style/d0e3daafdbdd858a5ee6e6b0b2de6a7a39ff27f1
Comment 8 Mike 2017-12-05 11:23:25 UTC
Created attachment 109216 [details]
QML Item with QtControls in a Plasmoid
Comment 9 Mike 2017-12-05 11:24:44 UTC
Installed 12/2 git QQC2 with TW unstable repos and error loading still happens (version mismatch).  See attached QML item for code to repro.