Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build error in ConnectionWindow.qml #256

Open
zultron opened this issue Jan 25, 2018 · 7 comments
Open

Build error in ConnectionWindow.qml #256

zultron opened this issue Jan 25, 2018 · 7 comments

Comments

@zultron
Copy link
Contributor

zultron commented Jan 25, 2018

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
Copy link
Contributor Author

zultron commented Jan 25, 2018

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

[default] property list<<objectType>> propertyName

@zultron
Copy link
Contributor Author

zultron commented Jan 25, 2018

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!

@sirop
Copy link
Contributor

sirop commented Feb 5, 2019

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 `:'

@zultron
Copy link
Contributor Author

zultron commented Feb 7, 2019

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.

@ArcEye
Copy link
Contributor

ArcEye commented Feb 7, 2019

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.

@machinekoder
Copy link
Member

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

@machinekoder
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants