QtQuickVcp icon indicating copy to clipboard operation
QtQuickVcp copied to clipboard

Build error in ConnectionWindow.qml

Open zultron opened this issue 7 years ago • 7 comments

With Qt v. 5.7.1 from Debian Stretch packages, and installing QQVCP from source, running an app from qtcreator ("Debug" mode) fails with the following errors:

QQmlApplicationEngine failed to load component
qrc:///main.qml:15 Type ConnectionWindow unavailable
file:///usr/lib/x86_64-linux-gnu/qt5/qml/Machinekit/Application/Controls/ConnectionWindow.qml:183 Unexpected token `<'
file:///usr/lib/x86_64-linux-gnu/qt5/qml/Machinekit/Application/Controls/ConnectionWindow.qml:183 Expected token `:'

The line in question is here: https://github.com/machinekit/QtQuickVcp/blob/master/src/applicationcontrols/ConnectionWindow.qml#L183

This looks like good syntax, judging from the Qt docs. Is this error the result of the older Qt version packaged in Stretch?

zultron avatar Jan 25 '18 17:01 zultron

Hmm, doesn't seem to be the version; the v. 5.6 docs show the following legal syntax:

[default] property list<<objectType>> propertyName

zultron avatar Jan 25 '18 18:01 zultron

If the default keyword is dropped, the run succeeds:

property list<ApplicationDescription> applications

At this point I'm out of my depth. Does this make any sense? Thanks!

zultron avatar Jan 25 '18 18:01 zultron

The same on RPI3 with Qt 5.7.1. I start the compiled machinekit-client:


libEGL warning: DRI2: failed to authenticate
qt5ct: using qt5ct plugin
JIT is disabled for QML. Property bindings and animations will be very slow. Visit https://wiki.qt.io/V4 to learn about possible solutions for your platform.
qml: Starting to load the main application.
qrc:///main.qml:51:5: Type ConnectionWindow unavailable
file:///home/pi/build_qtquickvcp/QtQuickVcp/imports/Machinekit/Application/Controls/ConnectionWindow.qml:183:26: Unexpected token `<'
file:///home/pi/build_qtquickvcp/QtQuickVcp/imports/Machinekit/Application/Controls/ConnectionWindow.qml:183:49: Expected token `:'

sirop avatar Feb 05 '19 18:02 sirop

I believe this is due to the syntax being introduced only in later Qt versions. I dabbled with fixing the code in QtQuickVcp and with building newer Qt5 from source, but ultimately didn't hit upon an elegant solution, and ended up switching over to the MachinekitClient bintray images on amd64.

Since this one-liner is apparently the only thing keeping QtQuickVcp from building against Debian Stretch packages, I wonder if fixing it would lower the bar for folks to start contributing.

zultron avatar Feb 07 '19 05:02 zultron

QML leaves me cold, but looking at the docs you linked to, it seems a list should have double << around it and the declaration of a property just has single <.

There is also an inconsistency of white space, where double arrowheads have no spacing between the type and the first arrowhead and single arrowheads are spaced from the preceding type, but that could just be style on the part of the example writer.

ArcEye avatar Feb 07 '19 07:02 ArcEye

Yes, the syntax is from newer Qt versions. Just replace it with var for a quick fix.

machinekoder avatar Feb 07 '19 18:02 machinekoder

Update changing things to var breaks the default property. In case you set it to var, make sure also to change the uses of ConnectionWindow to use applications: instead of the default property.

machinekoder avatar Feb 15 '19 10:02 machinekoder