Discussion:
QtCreator error (QML Module not Found) when including QtDesktop 0.1
André de Castilho
2012-01-19 23:12:14 UTC
Permalink
Hi everybody,

I am struggling for about two days trying to use the Qt Components for
Desktop plugin, and its README lead me to this mailing list.

My project involves using a Linux running on an ARM as a standalone
device, with a GNOME based linux distro. Because of that, I was pretty
happy when I stumbled upon Components for Desktop, as it gave me the
look and feel of a mobile app, with all the nice features of QML
running on GNOME.

My happiness didn't last long, as I could not get it up and running
with Qt Creator.

On to the facts:

1. I'm running Ubuntu 11.10.
2. I got the Qt SDK 1.1.4 two days ago from
http://qt.nokia.com/downloads and installed it with the online
installer.
3. Cloned the git repo from http://qt.gitorious.org/qt-components/desktop.
4. Entered the directory where I cloned the repo, ran 'qmake' and then
'sudo make install'.
5. All went apparently smooth, and the install created the folder
/usr/lib/qt4/imports/QtDesktop
6. I opened the Browser.qml example shiped with the plugin with
QtCreator (with File->Open Project or File), and the second line of
the file (import QtDesktop 0.1) gets underlined. Mouse over tells me:
QML Module not found. Try to change the QML_IMPORT_PATH.
7. Executing ./qmldesktopviewer/qmldesktopviewer
examples/TopLevel.qml, on the other hand, worked like a charm.

As I don't want to make a top level window with QML (I intend to
create my window with Qt, and implement only two dynamic sidebars in
QML), i got a little confused on why it didn't work on QtCreator. So
far as I understood (and I think it wasn't really that far),
qmldesktopviewer is only needed to stop QmlViewer to create the main
window itself. The fact that Qt Creator does not find the QtDesktop
0.1 import I'm guessing has something to do with where the module got
installed, and if everything is on the right place, I think I could be
able to use the SDK to play with the desktop components, right?

What I already tried:

1. I've read the three documents linked on the project's git repo, and
read all the comments with no success.
2. I've googled it, and found a promising link at the qt developer
forum: http://developer.qt.nokia.com/forums/viewthread/13453
- I've gave the idea markc gave a try (trying to make and make
install the project with QtCreator), but got no luck with that.

My questions:

1. Is Qt Components for Desktop intended for use with Qt Creator? Does
it work with it?
2. If it does, any ideas on why it is not recognizing the import on
Creator, but recognizes it with qmldesktopviewer?

Thanks very much in advance,

And if he reads this list: thank you Jens Bache-Wiig for the very good
work. I've long waited for something like Qt Components for Desktop!

Andre' de Castilho
Alan Alpert
2012-01-20 02:41:32 UTC
Permalink
Post by André de Castilho
Hi everybody,
I am struggling for about two days trying to use the Qt Components for
Desktop plugin, and its README lead me to this mailing list.
My project involves using a Linux running on an ARM as a standalone
device, with a GNOME based linux distro. Because of that, I was pretty
happy when I stumbled upon Components for Desktop, as it gave me the
look and feel of a mobile app, with all the nice features of QML
running on GNOME.
My happiness didn't last long, as I could not get it up and running
with Qt Creator.
1. I'm running Ubuntu 11.10.
2. I got the Qt SDK 1.1.4 two days ago from
http://qt.nokia.com/downloads and installed it with the online
installer.
3. Cloned the git repo from http://qt.gitorious.org/qt-components/desktop.
4. Entered the directory where I cloned the repo, ran 'qmake' and then
'sudo make install'.
5. All went apparently smooth, and the install created the folder
/usr/lib/qt4/imports/QtDesktop
6. I opened the Browser.qml example shiped with the plugin with
QtCreator (with File->Open Project or File), and the second line of
QML Module not found. Try to change the QML_IMPORT_PATH.
7. Executing ./qmldesktopviewer/qmldesktopviewer
examples/TopLevel.qml, on the other hand, worked like a charm.
As I don't want to make a top level window with QML (I intend to
create my window with Qt, and implement only two dynamic sidebars in
QML), i got a little confused on why it didn't work on QtCreator. So
far as I understood (and I think it wasn't really that far),
qmldesktopviewer is only needed to stop QmlViewer to create the main
window itself. The fact that Qt Creator does not find the QtDesktop
0.1 import I'm guessing has something to do with where the module got
installed, and if everything is on the right place, I think I could be
able to use the SDK to play with the desktop components, right?
1. I've read the three documents linked on the project's git repo, and
read all the comments with no success.
2. I've googled it, and found a promising link at the qt developer
forum: http://developer.qt.nokia.com/forums/viewthread/13453
- I've gave the idea markc gave a try (trying to make and make
install the project with QtCreator), but got no luck with that.
1. Is Qt Components for Desktop intended for use with Qt Creator? Does
it work with it?
2. If it does, any ideas on why it is not recognizing the import on
Creator, but recognizes it with qmldesktopviewer?
It can work with it, but does not by default. When using your own QML plugins
with creator theres an extra step you have to perform to make it known to
creator. I forget exactly what this step is, but it involves running the
qmlplugindump utility and placing the output somewhere creator can find it.
For Qt Creator to recognize a module, it needs this metadata, which is why
modules can be unknown to creator but loaded properly in qmlviewer.
--
Alan Alpert
Senior Engineer
Nokia, Qt Development Frameworks
Sven Anderson
2012-01-20 11:10:58 UTC
Permalink
Post by Alan Alpert
It can work with it, but does not by default. When using your own QML plugins
with creator theres an extra step you have to perform to make it known to
creator. I forget exactly what this step is, but it involves running the
qmlplugindump utility and placing the output somewhere creator can find it.
For Qt Creator to recognize a module, it needs this metadata, which is why
modules can be unknown to creator but loaded properly in qmlviewer.
Here are the details:

http://doc.qt.nokia.com/qtcreator-2.4/creator-qml-modules-with-plugins.html


Best regards,

Sven
André de Castilho
2012-01-22 13:59:50 UTC
Permalink
Thank you guys for the answers!

As I was using the QtSDK, had Qt 4.7.4 and it doesn't come with the
qmlplugindump binary, so I had to compile it. To do that, I needed the
private libraries, so I uninstalled the SDK, got Qt 4.8.0 source, built it,
downloaded the QtCreator 2.4.0, installed it, and finally ran the plugin.

For starters, if I open a single .qml file, it stil didn't recognize the
module, but when I created a qmlproject, it recognized it (and I didn't
have to add any special config to the project).

I was happy, but not for long:

When I import the QtDesktop module and open the Design window, QtCreator
crashes with a segmentation fault. If I take away the "import QtDesktop
0.1" line, it opens correctly.

I ran the qtcreator.sh plugin on a terminal to catch the log.

When I open the design, it doesn't matter if I have the import QtDesktop
/usr/share/mime/application/x-executable.xml:1: parser error : Document is
empty
^
/usr/share/mime/application/xml.xml:1: parser error : Document is empty
^
/usr/share/mime/application/x-executable.xml:1: parser error : Document is
empty
^
/usr/share/mime/application/x-executable.xml:1: parser error : Document is
empty
^
/usr/share/mime/application/x-shellscript.xml:1: parser error : Document
is empty
^
/usr/share/mime/application/x-shellscript.xml:1: parser error : Document
is empty
^
/usr/share/mime/application/x-desktop.xml:1: parser error : Document is
empty
^
/usr/share/mime/application/x-executable.xml:1: parser error : Document is
empty
^
/usr/share/mime/application/x-executable.xml:1: parser error : Document is
empty
^
/usr/share/mime/application/x-executable.xml:1: parser error : Document is
empty
^
/usr/share/mime/application/x-executable.xml:1: parser error : Document is
empty
^
parser error : Document is empty
^
"/tmp/qmldesigner-logger-2012-01-22T11-51-50-ZT2866.txt"
When I insert the import QtDesktop 0.1 line, after the xml parser errors,
the program crashes with segmentation fault.

I don't know how to trace the bug, or turn the debug messages on, and would
appreciate any help pointing me in the right direction or telling me what I
am doing wrong.

Thank you one more time,


André de Castilho
Post by Alan Alpert
It can work with it, but does not by default. When using your own QML plugins
with creator theres an extra step you have to perform to make it known to
creator. I forget exactly what this step is, but it involves running the
qmlplugindump utility and placing the output somewhere creator can find it.
For Qt Creator to recognize a module, it needs this metadata, which is why
modules can be unknown to creator but loaded properly in qmlviewer.
http://doc.qt.nokia.com/qtcreator-2.4/creator-qml-modules-with-plugins.html
Best regards,
Sven
_______________________________________________
Qt-qml mailing list
http://lists.qt.nokia.com/mailman/listinfo/qt-qml
k***@public.gmane.org
2012-01-24 13:45:23 UTC
Permalink
-----Original Message-----
de Castilho
Sent: Sunday, January 22, 2012 3:00 PM
Subject: Re: [Qt-qml] QtCreator error (QML Module not Found) when
including QtDesktop 0.1
Thank you guys for the answers!
Hi Andre,

Seems you managed to run into a lot of bugs at once :)
As I was using the QtSDK, had Qt 4.7.4 and it doesn't come with the
qmlplugindump binary, so I had to compile it. To do that, I needed the private
libraries, so I uninstalled the SDK, got Qt 4.8.0 source, built it, downloaded
the QtCreator 2.4.0, installed it, and finally ran the plugin.
For starters, if I open a single .qml file, it stil didn't recognize the module, but
when I created a qmlproject, it recognized it (and I didn't have to add any
special config to the project).
This is to be expected. Qt Creator needs the notion of a 'project' to guess which Qt version and environment you'd like to use. A .qmlproject is the most lightweight way to get one ...
When I import the QtDesktop module and open the Design window,
QtCreator crashes with a segmentation fault. If I take away the "import
QtDesktop 0.1" line, it opens correctly.
The Qt Quick Designer in Qt Creator is kind of a beast. It comes down to that both the component set and the Quick Designer have to have explicit support : The component set might be used in ways not expected in normal use (like setting some bindings multiple times, unsetting them ...), while Qt Quick Designer has to know how to graphically manipulate items. So your mileage may vary, but the Qt Desktop components are not officially supported right now.

Anyhow, Qt Creator shouldn't crash, since the loading of the component set is now done in a separate process. Feel therefore free to file a bug at bugreports.qt.nokia.com.
I ran the qtcreator.sh plugin on a terminal to catch the log.
When I open the design, it doesn't matter if I have the import QtDesktop line
Document is empty
^
/usr/share/mime/application/xml.xml:1: parser error : Document is empty
^
Document is empty
^
Document is empty
^
Document is empty
^
Document is empty
^
Document is empty
^
Document is empty
^
Document is empty
^
Document is empty
^
Document is empty
^
/home/andre/.local/share/mime/application/vnd.nokia.qt.qmakepr
ofile.xml:1: parser error : Document is empty
I don't know where the parser errors come from, sorry. But I guess they're independent from Qt / Qt SDK / Qt Creator.
^
QmlDesigner: Log file is: "/tmp/qmldesigner-logger-2012-01-22T11-
51-50-ZT2866.txt"
When I insert the import QtDesktop 0.1 line, after the xml parser errors, the
program crashes with segmentation fault.
I don't know how to trace the bug, or turn the debug messages on, and
would appreciate any help pointing me in the right direction or telling me
what I am doing wrong.
The only additional hint I can give you is that the qt-creator@ is probably a better place to ask for the Qt Creator / Designer specific problems.

Regards

Kai
Thank you one more time,
André de Castilho
Post by Sven Anderson
Post by Alan Alpert
It can work with it, but does not by default. When using your own QML
plugins with creator theres an extra step you have to perform to make
it known to creator. I forget exactly what this step is, but it
involves running the qmlplugindump utility and placing the output
somewhere creator can find it.
Post by Sven Anderson
Post by Alan Alpert
For Qt Creator to recognize a module, it needs this metadata, which
is why modules can be unknown to creator but loaded properly in
qmlviewer.
Post by Sven Anderson
http://doc.qt.nokia.com/qtcreator-2.4/creator-qml-modules-with-plugins
.html
Best regards,
Sven
_______________________________________________
Qt-qml mailing list
http://lists.qt.nokia.com/mailman/listinfo/qt-qml
Loading...