[Qt-creator] Qml Designer does not always show QQuickItem

Wolfgang Baron wolfgang.baron at gmx.net
Tue Dec 15 15:24:49 CET 2015


Hi,

concerning the presentation problem of QmlDesigner in Qt-Creator, I have created an isolated project with just that problem in it, a few screen shots and instructions as an attachment. Please have a look and tell me I am seeing ghosts. I have tried this on a number of systems with the same result everywhere.

> since your object does not show up in the navigator, but does show up
> in the state editor, I am pretty sure the meta information for your
> class is somehow messed up.
> Typically the meta info (type hierarchy properties etc...) is provided
> by a plugins.qmltypes file as part of a QML plugin.
> To me it looks like the code model/meta info system does not know your
> object is actually an item. We only show items in the navigator
> and also the form editor will only contain items that are identified
> as items by the code model.

I have included the metainfo in the attachment and it look ok to me.

In order for everyone on the list to see what the problem is about without having to open the attacment (QmlFun.7z), I copied the README here:

Demo project for showing a bug in QmlDesigner/qml2puppet in Qt-Creator-3.5.1
based on Qt-5.5.1 and an unknown number of releases before. I have tested
the project on Ubuntu Wily Werewolf and Microsoft Windows 7 (32 bit) using
msvc2010.

Compile the project and install the plugin. This seems to mean, that you have
to install it in $QT_DIR/bin/qml/bug/qmlfun in most cases. Look at
"install.sh" for ideas.

One would think it should not matter where to install the plugin, however
most setups will fail on this (Qt on the development machine vs. copying
installation files to a client machine, running the downloaded Qt-Creator
vs a custom built Qt-Creator etc.). This is problem to talk about some
other time, though.

On Windows, the installed plugin should look like the following list:

bug/qmlfun/designer/fun.metainfo
bug/qmlfun/designer/images/fun.png
bug/qmlfun/designer/images/noFun.png
bug/qmlfun/Fun.qml
bug/qmlfun/FunRep.qml
bug/qmlfun/plugins.qmltypes
bug/qmlfun/QFun.qml
bug/qmlfun/qmldir
bug/qmlfun/QmlFun.dll

The generated plugins.qmltypes on Linux is different from the one generated
on Microsoft Windows. The Linux version references QtQuick, whereas the
Microsoft Windows version contains a copy of used parent classes. Exchanging
the versions does not alter the behaviour (works either way). I prefer the
Linux version, but I wonder, why the other version exists at all...

Restart Qt-Creator. Load TestQmlFun.qml and press "Design". Now you will
probably see what can be found in the screenshots/ folder. Continue quitting,
restarting Qt-Creator and loading the document, until all items are shown
correctly (may take 3-10 times or more). Now you start to consider, that
there might be a glitch in Qt-Creator or qml2puppet (I don't know,
I have not looked into the sources yet, it may aswell be something
completely different). You will almost always see all items in the state
view. If the central area shows all item, they will be visible in the
navigator as well and vice versa.

Qmlscene will always show all items correctly.

Thanks a lot for any insight or maybe even a fix,

Wolfgang Baron
-------------- next part --------------
A non-text attachment was scrubbed...
Name: QmlFun.7z
Type: application/octet-stream
Size: 59664 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/qt-creator/attachments/20151215/4206d482/attachment.obj>


More information about the Qt-creator mailing list