forked from qt-creator/qt-creator
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: Tim Jenssen <tim.jenssen@theqtcompany.com>
This commit is contained in:
@@ -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();
|
||||
|
Reference in New Issue
Block a user