diff options
author | Kai Koehne <kai.koehne@nokia.com> | 2009-08-14 11:08:27 (GMT) |
---|---|---|
committer | Kai Koehne <kai.koehne@nokia.com> | 2009-08-14 11:09:44 (GMT) |
commit | 3e9d47531aa0d521b0724646642a95ffca780907 (patch) | |
tree | ff80728c340d43f0edb8e9cdcca650d7acc6855b /tools/qmldebugger | |
parent | a64acdd50452678f368688d19631ef2c1fd31ec8 (diff) | |
download | Qt-3e9d47531aa0d521b0724646642a95ffca780907.zip Qt-3e9d47531aa0d521b0724646642a95ffca780907.tar.gz Qt-3e9d47531aa0d521b0724646642a95ffca780907.tar.bz2 |
Fix qmldebugger not finding engines.qml 2
Also load images from resources
Diffstat (limited to 'tools/qmldebugger')
-rw-r--r-- | tools/qmldebugger/engine.cpp | 7 | ||||
-rw-r--r-- | tools/qmldebugger/engines.qml | 6 | ||||
-rw-r--r-- | tools/qmldebugger/qmldebugger.pro | 3 | ||||
-rw-r--r-- | tools/qmldebugger/qmldebugger.qrc | 2 |
4 files changed, 14 insertions, 4 deletions
diff --git a/tools/qmldebugger/engine.cpp b/tools/qmldebugger/engine.cpp index 229cd3f..16d7f02 100644 --- a/tools/qmldebugger/engine.cpp +++ b/tools/qmldebugger/engine.cpp @@ -6,6 +6,7 @@ #include <QLineEdit> #include <QTreeWidget> #include <QTableWidget> +#include <QFile> #include <private/qmlenginedebug_p.h> #include <QtDeclarative/qmlcomponent.h> #include <QtDeclarative/qfxitem.h> @@ -38,10 +39,14 @@ EnginePane::EnginePane(QmlDebugConnection *client, QWidget *parent) setLayout(layout); + QFile enginesFile(":/engines.qml"); + enginesFile.open(QFile::ReadOnly); + Q_ASSERT(enginesFile.isOpen()); + m_engineView = new QFxView(this); m_engineView->rootContext()->setContextProperty("engines", qVariantFromValue(&m_engineItems)); m_engineView->setContentResizable(true); - m_engineView->setUrl(QUrl::fromLocalFile("engines.qml")); + m_engineView->setQml(enginesFile.readAll()); m_engineView->execute(); m_engineView->setFixedHeight(100); QObject::connect(m_engineView->root(), SIGNAL(engineClicked(int)), diff --git a/tools/qmldebugger/engines.qml b/tools/qmldebugger/engines.qml index ad12aa6..9a96c4b 100644 --- a/tools/qmldebugger/engines.qml +++ b/tools/qmldebugger/engines.qml @@ -11,10 +11,10 @@ Item { Repeater { dataSource: engines Item { - width: 100; height: 100; + width: 100; height: 100; Image { id: Image; - source: "engine.png" + source: "qrc:/engine.png" anchors.horizontalCenter: parent.horizontalCenter } Text { @@ -33,7 +33,7 @@ Item { Image { y: 15 - source: "refresh.png"; + source: "qrc:/refresh.png"; width: 75; height: 63; smooth: true diff --git a/tools/qmldebugger/qmldebugger.pro b/tools/qmldebugger/qmldebugger.pro index 532fd2a..3935351 100644 --- a/tools/qmldebugger/qmldebugger.pro +++ b/tools/qmldebugger/qmldebugger.pro @@ -5,6 +5,9 @@ contains(QT_CONFIG, opengles2)|contains(QT_CONFIG, opengles1): QT += opengl # Input HEADERS += canvasframerate.h engine.h SOURCES += main.cpp canvasframerate.cpp engine.cpp +RESOURCES += qmldebugger.qrc + +OTHER_FILES += engines.qml target.path=$$[QT_INSTALL_BINS] INSTALLS += target diff --git a/tools/qmldebugger/qmldebugger.qrc b/tools/qmldebugger/qmldebugger.qrc index 5820558..cb53ad5 100644 --- a/tools/qmldebugger/qmldebugger.qrc +++ b/tools/qmldebugger/qmldebugger.qrc @@ -1,5 +1,7 @@ <RCC> <qresource prefix="/"> <file>engines.qml</file> + <file>engine.png</file> + <file>refresh.png</file> </qresource> </RCC> |