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

Hartmann Thomas Thomas.Hartmann at theqtcompany.com
Wed Dec 16 09:55:23 CET 2015


I changed the .metainfo file to just this:

import QtQuick.tooling 1.2

// This file describes the plugin-supplied types contained in the library.
// It is used for QML tooling purposes only.
// This file was auto-generated by:
// 'qmlplugindump.exe -v bug.qmlfun 1.0'

Module {
    Component {
        name: "QmlFun"
        defaultProperty: "data"
        prototype: "QQuickItem"
        exports: ["CoreFun 1.0"]
        exportMetaObjectRevisions: [0]
        Property { name: "text"; type: "string" }
        Signal {
            name: "textChanged"
            Parameter { name: "aText"; type: "string" }
        Method {
            name: "setText"
            Parameter { name: "aText"; type: "string" }
        Method { name: "update" }

The raise condition seems to be gone then and Fun always shows up in the navigator.
If you do not want to install the QML plugin to Qt you can define QML_IMPORT_PATH in the .pro file instead and deploy/build your plugin accordingly.
You can e.g. add QML_IMPORT_PATH = $$PWD/imports to the .pro file and build/deploy the plugin to imports/bug/qmlfun.

Kind Regards,
Thomas Hartmann

From: Wolfgang Baron <wolfgang.baron at gmx.net>
Sent: Tuesday, December 15, 2015 3:24 PM
To: Hartmann Thomas
Cc: qt-creator at qt-project.org
Subject: Re: Re: [Qt-creator] Qml Designer does not always show QQuickItem


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

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:


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

More information about the Qt-creator mailing list