error log filter

This commit is contained in:
王劲鹏 2021-02-23 15:10:19 +08:00 committed by osborn
parent dc438b135a
commit 4c0a177747
2 changed files with 6 additions and 2 deletions

View File

@ -6,7 +6,9 @@ QQuickItem *DoricStackNode::build() {
const QUrl url(QStringLiteral("qrc:/doric/qml/stack.qml")); const QUrl url(QStringLiteral("qrc:/doric/qml/stack.qml"));
component.loadUrl(url); component.loadUrl(url);
qCritical() << component.errorString(); if (component.isError()) {
qCritical() << component.errorString();
}
QQuickItem *item = qobject_cast<QQuickItem *>(component.create()); QQuickItem *item = qobject_cast<QQuickItem *>(component.create());
return item; return item;

View File

@ -6,7 +6,9 @@ QQuickItem *DoricVLayoutNode::build() {
const QUrl url(QStringLiteral("qrc:/doric/qml/vlayout.qml")); const QUrl url(QStringLiteral("qrc:/doric/qml/vlayout.qml"));
component.loadUrl(url); component.loadUrl(url);
qCritical() << component.errorString(); if (component.isError()) {
qCritical() << component.errorString();
}
QQuickItem *item = qobject_cast<QQuickItem *>(component.create()); QQuickItem *item = qobject_cast<QQuickItem *>(component.create());
return item; return item;