diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2009-07-02 03:11:43 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2009-07-02 03:11:43 (GMT) |
commit | 8aba610c22c44bf36eb2e539a06b65753c48bbc2 (patch) | |
tree | a09af5ec3edd87ffcf041fe030135e58d49cb520 /src/declarative/qml/qmlcomponent.cpp | |
parent | dafd625842e2c66551857810a3660c534962746e (diff) | |
parent | 305de45a8d184738dc07fb7e5c787b9dbb5b3c6b (diff) | |
download | Qt-8aba610c22c44bf36eb2e539a06b65753c48bbc2.zip Qt-8aba610c22c44bf36eb2e539a06b65753c48bbc2.tar.gz Qt-8aba610c22c44bf36eb2e539a06b65753c48bbc2.tar.bz2 |
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'src/declarative/qml/qmlcomponent.cpp')
-rw-r--r-- | src/declarative/qml/qmlcomponent.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/declarative/qml/qmlcomponent.cpp b/src/declarative/qml/qmlcomponent.cpp index 0fd65d3..d6b38c9 100644 --- a/src/declarative/qml/qmlcomponent.cpp +++ b/src/declarative/qml/qmlcomponent.cpp @@ -372,6 +372,29 @@ QList<QmlError> QmlComponent::errors() const } /*! + Return the list of errors that occured during the last compile or create + operation, as a single string. An empty string is returned if isError() + is not set. + + This function is similar to errors(), except more useful when called from + QML. C++ code should usually use errors(). + + \sa errors() +*/ +QString QmlComponent::errorsString() const +{ + Q_D(const QmlComponent); + QString ret; + if(!isError()) + return ret; + foreach(const QmlError &e, d->errors){ + ret += e.url().toString() + ":" + QString::number(e.line()) + " " + + e.description() + "\n"; + } + return ret; +} + +/*! Return the component URL. This is the URL passed to either the constructor, or the loadUrl() or setData() methods. */ |