summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2009-12-18 01:56:39 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2009-12-18 01:56:39 (GMT)
commit3ed9d92ac183eb4415523d95c9eef4454c473c53 (patch)
tree657db5faaadb40fd8892879551f1fbbe069eb155 /src/declarative
parent88751e0dcad05cc68cf5160660151287db6e6273 (diff)
parent7cb8f90c27f29cee09bd81d747142842d809d775 (diff)
downloadQt-3ed9d92ac183eb4415523d95c9eef4454c473c53.zip
Qt-3ed9d92ac183eb4415523d95c9eef4454c473c53.tar.gz
Qt-3ed9d92ac183eb4415523d95c9eef4454c473c53.tar.bz2
Merge branch 'kinetic-declarativeui' of scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'src/declarative')
-rw-r--r--src/declarative/qml/qmlinfo.cpp22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/declarative/qml/qmlinfo.cpp b/src/declarative/qml/qmlinfo.cpp
index 27f5426..dabf944 100644
--- a/src/declarative/qml/qmlinfo.cpp
+++ b/src/declarative/qml/qmlinfo.cpp
@@ -43,6 +43,7 @@
#include "qmldeclarativedata_p.h"
#include "qmlcontext.h"
+#include "qmlmetatype.h"
#include <QCoreApplication>
@@ -53,7 +54,7 @@ QT_BEGIN_NAMESPACE
\brief Prints warnings messages that include the file and line number for QML types.
- When QML types display warning messages, it improves tracibility
+ When QML types display warning messages, it improves traceability
if they include the QML file and line number on which the
particular instance was instantiated.
@@ -71,7 +72,7 @@ QT_BEGIN_NAMESPACE
prints
\code
- QML ComponentInstance (unknown location): component property is a write-once property
+ QML MyCustomType (unknown location): component property is a write-once property
\endcode
*/
@@ -81,7 +82,22 @@ QmlInfo::QmlInfo(const QObject *object)
QString pos = QLatin1String("QML");
if (object) {
pos += QLatin1Char(' ');
- pos += QLatin1String(object->metaObject()->className());
+
+ QString typeName;
+ QmlType *type = QmlMetaType::qmlType(object->metaObject());
+ if (type) {
+ typeName = QLatin1String(type->qmlTypeName());
+ int lastSlash = typeName.lastIndexOf(QLatin1Char('/'));
+ if (lastSlash != -1)
+ typeName = typeName.mid(lastSlash+1);
+ } else {
+ typeName = QString::fromUtf8(object->metaObject()->className());
+ int marker = typeName.indexOf(QLatin1String("_QMLTYPE_"));
+ if (marker != -1)
+ typeName = typeName.left(marker);
+ }
+
+ pos += typeName;
}
QmlDeclarativeData *ddata = object?QmlDeclarativeData::get(object):0;
pos += QLatin1String(" (");