[Qt-creator] Qml Designer does not always show QQuickItem derived C++ classes

Hartmann Thomas Thomas.Hartmann at theqtcompany.com
Tue Nov 24 18:15:33 CET 2015


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.

Kind Regards,
Thomas Hartmann

From: Qt-creator <qt-creator-bounces at qt-project.org> on behalf of Wolfgang Baron <wolfgang.baron at gmx.net>
Sent: Friday, November 20, 2015 8:45 AM
To: qt-creator at qt-project.org
Subject: [Qt-creator] Qml Designer does not always show QQuickItem derived      C++ classes


when I create a Qml exposed C++ class inheriting from QQuickItem in a Qml plugin, Objects of this class do not show up in the navigator window, nor in the central displaying area of the Qml Designer. There is a small chance, that restarting Qt-Creator will get the objects to be shown. They always show up in the state editor, no matter whether they show up in the navigator or the central displaying area.

This is so, even if the C++ class is just a dummy class without any properties of its own. Items nested in the C++ based items only show up, when the containing C++ based item is displayed. Debugging messages show, that all methods get properly called (constructor, destructor) in all 3 qml2puppet processes, even when the item is not displayed.

This does somehow look like QTCREATORBUG-11377, although just importing a module containing a C++ based class does not seem to matter and Qml based items in the module work just fine. Also, the fact that restarting Qt-Creator may cause the Designer to display all items as it should is not mentioned. The problem described in QTCREATORBUG-11377 does not mention the state editor either.

I find this very strange, because QtQuick classes do the same, only they are implemented in the same library as QQuickItem. Is there a way around this or do I have to file a bug (or add information to QTCREATORBUG-11377)? Does anybody know of a workaround?

Thanks for any insights!
Qt-creator mailing list
Qt-creator at qt-project.org

More information about the Qt-creator mailing list