Commit 184a9d15 authored by Thomas Hartmann's avatar Thomas Hartmann

QmlDesigner: Hide items in the item library which are not a QtQuick.Item

Typically this is the result of a bug in the QML code model.
There is no reason to show those items in the library.

Once we start support pure QObjects we can add a flag to the .metainfo
file which shows pure QObjects.

Change-Id: Id3688ff23161a410dde421406eada3be4982151e
Reviewed-by: default avatarTim Jenssen <>
parent 26dd6027
......@@ -152,8 +152,17 @@ void ItemLibraryModel::update(ItemLibraryInfo *itemLibraryInfo, Model *model)
NodeMetaInfo metaInfo = model->metaInfo(entry.typeName());
bool valid = metaInfo.isValid() && metaInfo.majorVersion() == entry.majorVersion();
bool isItem = metaInfo.isSubclassOf("QtQuick.Item");
if (valid && isItem) {
qDebug() << Q_FUNC_INFO << metaInfo.typeName() << "is not a QtQuick.Item";
foreach (const NodeMetaInfo &superClass, metaInfo.superClasses()) {
qDebug() << superClass.typeName();
if (valid
&& isItem //We can change if the navigator does support pure QObjects
&& (entry.requiredImport().isEmpty()
|| model->hasImport(entryToImport(entry), true, true))) {
QString itemSectionName = entry.category();
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment