aboutsummaryrefslogtreecommitdiffstats
path: root/src/tools/qml
diff options
context:
space:
mode:
authorLasse Holmstedt <[email protected]>2010-07-30 16:09:17 +0200
committerLasse Holmstedt <[email protected]>2010-07-30 16:09:29 +0200
commit8918cff941a9a75d2444e9803ac9b16ef3630b65 (patch)
tree94c232756e99dc2762e29e66ce4a9b7b8ae0b8c2 /src/tools/qml
parentf4b1c441aae6ba1d433c29229dac6eda2ff60b76 (diff)
Moved CrumblePath to Utils
This widget has little to do with the QML debugging library, and will be reused inside the QML JS Inspector UI as well.
Diffstat (limited to 'src/tools/qml')
-rw-r--r--src/tools/qml/qmlobserver/qmlobserver.pro7
-rw-r--r--src/tools/qml/qmlobserver/qmlruntime.cpp12
-rw-r--r--src/tools/qml/qmlobserver/qmlruntime.h4
3 files changed, 18 insertions, 5 deletions
diff --git a/src/tools/qml/qmlobserver/qmlobserver.pro b/src/tools/qml/qmlobserver/qmlobserver.pro
index 501776fc6ca..919a1a028f2 100644
--- a/src/tools/qml/qmlobserver/qmlobserver.pro
+++ b/src/tools/qml/qmlobserver/qmlobserver.pro
@@ -8,8 +8,10 @@ SOURCES += main.cpp
# hack to get qtLibraryTarget macro working
TEMPLATE +=lib
include(../../../libs/qmljsdebugger/qmljsdebugger.pri)
+include(../../../libs/utils/utils.pri)
mac {
- libraryTarget = $$qtLibraryTarget(QmlJSDebugger)
+ qmljsLibraryTarget = $$qtLibraryTarget(QmlJSDebugger)
+ utilsLibraryTarget = $$qtLibraryTarget(Utils)
}
TEMPLATE -=lib
@@ -22,7 +24,8 @@ mac {
QMAKE_INFO_PLIST=Info_mac.plist
TARGET=QMLObserver
ICON=qml.icns
- QMAKE_POST_LINK=install_name_tool -change @executable_path/../PlugIns/lib$${libraryTarget}.1.dylib @executable_path/../../../../PlugIns/lib$${libraryTarget}.1.dylib \'$$DESTDIR/$${TARGET}.app/Contents/MacOS/$$TARGET\'
+ QMAKE_POST_LINK=install_name_tool -change @executable_path/../PlugIns/lib$${qmljsLibraryTarget}.1.dylib @executable_path/../../../../PlugIns/lib$${qmljsLibraryTarget}.1.dylib \'$$DESTDIR/$${TARGET}.app/Contents/MacOS/$$TARGET\' \
+ && install_name_tool -change @executable_path/../PlugIns/lib$${utilsLibraryTarget}.1.dylib @executable_path/../../../../PlugIns/lib$${utilsLibraryTarget}.1.dylib \'$$DESTDIR/$${TARGET}.app/Contents/MacOS/$$TARGET\'
} else {
TARGET=qmlobserver
}
diff --git a/src/tools/qml/qmlobserver/qmlruntime.cpp b/src/tools/qml/qmlobserver/qmlruntime.cpp
index af65ceeac7a..422b89f531c 100644
--- a/src/tools/qml/qmlobserver/qmlruntime.cpp
+++ b/src/tools/qml/qmlobserver/qmlruntime.cpp
@@ -55,7 +55,7 @@
#endif
#include <qdeclarativedesignview.h>
-#include <crumblepath.h>
+#include <utils/crumblepath.h>
#include "qmlruntime.h"
#include <qdeclarativecontext.h>
@@ -551,6 +551,7 @@ QDeclarativeViewer::QDeclarativeViewer(QWidget *parent, Qt::WindowFlags flags)
, tester(0)
, useQmlFileBrowser(true)
, m_centralWidget(0)
+ , m_crumblePathWidget(0)
, translator(0)
{
QDeclarativeViewer::registerTypes();
@@ -590,18 +591,19 @@ QDeclarativeViewer::QDeclarativeViewer(QWidget *parent, Qt::WindowFlags flags)
canvas->toolbar()->setFloatable(false);
canvas->toolbar()->setMovable(false);
+ m_crumblePathWidget = new Utils::CrumblePath(this);
m_centralWidget = new QWidget(this);
QVBoxLayout *layout = new QVBoxLayout(m_centralWidget);
layout->setMargin(0);
layout->setSpacing(0);
- layout->addWidget(canvas->crumblePathWidget());
+ layout->addWidget(m_crumblePathWidget);
#ifndef Q_WS_MAC
QFile file(":/toolbarstyle.css");
file.open(QFile::ReadOnly);
QString toolbarStylesheet = QLatin1String(file.readAll());
canvas->toolbar()->setStyleSheet(toolbarStylesheet);
- canvas->crumblePathWidget()->setStyleSheet("QWidget { border-bottom: 1px solid black; }");
+ m_crumblePathWidget->setStyleSheet("QWidget { border-bottom: 1px solid black; }");
#endif
layout->addWidget(canvas);
@@ -615,6 +617,10 @@ QDeclarativeViewer::QDeclarativeViewer(QWidget *parent, Qt::WindowFlags flags)
QObject::connect(canvas, SIGNAL(reloadRequested()), this, SLOT(reload()));
QObject::connect(canvas, SIGNAL(sceneResized(QSize)), this, SLOT(sceneResized(QSize)));
QObject::connect(canvas, SIGNAL(statusChanged(QDeclarativeView::Status)), this, SLOT(statusChanged()));
+ QObject::connect(canvas, SIGNAL(inspectorContextCleared()), m_crumblePathWidget, SLOT(clear()));
+ QObject::connect(canvas, SIGNAL(inspectorContextPushed(QString)), m_crumblePathWidget, SLOT(pushElement(QString)));
+ QObject::connect(canvas, SIGNAL(inspectorContextPopped()), m_crumblePathWidget, SLOT(popElement()));
+ QObject::connect(m_crumblePathWidget, SIGNAL(elementClicked(int)), canvas, SLOT(setInspectorContext(int)));
QObject::connect(canvas->engine(), SIGNAL(quit()), QCoreApplication::instance (), SLOT(quit()));
QObject::connect(warningsWidget(), SIGNAL(opened()), this, SLOT(warningsWidgetOpened()));
diff --git a/src/tools/qml/qmlobserver/qmlruntime.h b/src/tools/qml/qmlobserver/qmlruntime.h
index b63a17f4bb8..e330fa1185a 100644
--- a/src/tools/qml/qmlobserver/qmlruntime.h
+++ b/src/tools/qml/qmlobserver/qmlruntime.h
@@ -52,6 +52,9 @@
namespace QmlViewer {
class QDeclarativeDesignView;
}
+namespace Utils {
+ class CrumblePath;
+}
QT_BEGIN_NAMESPACE
@@ -202,6 +205,7 @@ private:
bool useQmlFileBrowser;
QWidget *m_centralWidget;
+ Utils::CrumblePath *m_crumblePathWidget;
QTranslator *translator;
void loadTranslationFile(const QString& directory);