forked from qt-creator/qt-creator
QmlDesigner.ItemLibrary: Adding logging category
This makes it possible to debug the .metainfo files in a release build/package. Change-Id: Iceae98b0e00b9d4deba0ae3f31b1f55fca2c5cf2 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
committed by
Alessandro Portale
parent
dd2d17ed36
commit
c7ba291c68
@@ -36,11 +36,14 @@
|
||||
|
||||
#include <QVariant>
|
||||
#include <QMetaProperty>
|
||||
#include <QLoggingCategory>
|
||||
#include <QMimeData>
|
||||
#include <QPainter>
|
||||
#include <QPen>
|
||||
#include <qdebug.h>
|
||||
|
||||
static Q_LOGGING_CATEGORY(itemlibraryPopulate, "itemlibrary.populate")
|
||||
|
||||
static bool inline registerItemLibrarySortedModel() {
|
||||
qmlRegisterType<QmlDesigner::ItemLibrarySectionModel>();
|
||||
return true;
|
||||
@@ -150,12 +153,23 @@ void ItemLibraryModel::update(ItemLibraryInfo *itemLibraryInfo, Model *model)
|
||||
if (import.isLibraryImport())
|
||||
imports << import.url() + QLatin1Char(' ') + import.version();
|
||||
|
||||
|
||||
qCInfo(itemlibraryPopulate) << Q_FUNC_INFO;
|
||||
foreach (ItemLibraryEntry entry, itemLibraryInfo->entries()) {
|
||||
|
||||
qCInfo(itemlibraryPopulate) << entry.typeName() << entry.majorVersion() << entry.minorVersion();
|
||||
|
||||
NodeMetaInfo metaInfo = model->metaInfo(entry.typeName());
|
||||
|
||||
qCInfo(itemlibraryPopulate) << "valid: " << metaInfo.isValid() << metaInfo.majorVersion() << metaInfo.minorVersion();
|
||||
|
||||
bool valid = metaInfo.isValid() && metaInfo.majorVersion() == entry.majorVersion();
|
||||
bool isItem = valid && metaInfo.isSubclassOf("QtQuick.Item");
|
||||
|
||||
qCInfo(itemlibraryPopulate) << "isItem: " << isItem;
|
||||
|
||||
qCInfo(itemlibraryPopulate) << "required import: " << entry.requiredImport() << entryToImport(entry).toImportString();
|
||||
|
||||
if (!isItem && valid) {
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
qDebug() << metaInfo.typeName() << "is not a QtQuick.Item";
|
||||
@@ -167,6 +181,7 @@ void ItemLibraryModel::update(ItemLibraryInfo *itemLibraryInfo, Model *model)
|
||||
&& (entry.requiredImport().isEmpty()
|
||||
|| model->hasImport(entryToImport(entry), true, true))) {
|
||||
QString itemSectionName = entry.category();
|
||||
qCInfo(itemlibraryPopulate) << "Adding:" << entry.typeName() << "to:" << entry.category();
|
||||
ItemLibrarySection *sectionModel = sectionByName(itemSectionName);
|
||||
|
||||
if (sectionModel == 0) {
|
||||
|
||||
Reference in New Issue
Block a user