Namespaces

Variants
Actions

Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

How to enable QML Import Traces

From Wiki
Jump to: navigation, search
Article Metadata
Compatibility
Platform(s):
Symbian
Article
Created: vasant21 (05 Feb 2011)
Last edited: hamishwillee (11 Oct 2012)

Contents

Introduction

When developing with Qt Quick, it is possible to enable the QML's import traces to improve debug traces and get more information on what components are loaded in and their respective order.


Using Environment Variable

QML_IMPORT_TRACE environment variable can be set to enable QML's import traces


QML_IMPORT_TRACE with Qt

int main(int argc, char *argv[])
{
QApplication app(argc, argv);
 
 
// set the value of the environment variable QML_IMPORT_TRACE as 1
QByteArray data = "1";
qputenv("QML_IMPORT_TRACE", data);
 
QmlApplicationViewer viewer;
...
return app.exec();
}

Output

Now you would see traces for you QML snippet, below its shows QtQuick1.0 is loaded and then respective components are resolved in order of Rectangle, Text and MouseArea respectively

QDeclarativeImportDatabase::addImportPath: "C:\QtSDK\Simulator\Qt\mingw\imports"
QDeclarativeImportDatabase::addImportPath: "C:/Documents and Settings/Owner/helloworld1-build-simulator/debug"
QDeclarativeImports(file:///.../helloworld1-build-simulator/qml/helloworld1/main.qml)::addImport: "." -1.-1 File as ""
QDeclarativeImports(file:///.../helloworld1-build-simulator/qml/helloworld1/main.qml)::addImport: "QtQuick" 1.0 Library as ""
QDeclarativeImports(file:///.../helloworld1-build-simulator/qml/helloworld1/main.qml)::resolveType: "Rectangle" => "QDeclarativeRectangle"
QDeclarativeImports(file:///.../helloworld1-build-simulator/qml/helloworld1/main.qml)::resolveType: "Text" => "QDeclarativeText"
QDeclarativeImports(file:///.../helloworld1-build-simulator/qml/helloworld1/main.qml)::resolveType: "MouseArea" => "QDeclarativeMouseArea"
This page was last modified on 11 October 2012, at 01:17.
148 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×