forked from qt-creator/qt-creator
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.
This commit is contained in:
@@ -30,8 +30,7 @@ SOURCES += \
|
|||||||
$$PWD/zoomtool.cpp \
|
$$PWD/zoomtool.cpp \
|
||||||
$$PWD/colorpickertool.cpp \
|
$$PWD/colorpickertool.cpp \
|
||||||
$$PWD/qmltoolbar.cpp \
|
$$PWD/qmltoolbar.cpp \
|
||||||
$$PWD/toolbarcolorbox.cpp \
|
$$PWD/toolbarcolorbox.cpp
|
||||||
$$PWD/crumblepath.cpp
|
|
||||||
|
|
||||||
RESOURCES += $$PWD/editor.qrc
|
RESOURCES += $$PWD/editor.qrc
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
#include "qdeclarativedesignview.h"
|
#include "qdeclarativedesignview.h"
|
||||||
#include "subcomponentmasklayeritem.h"
|
#include "subcomponentmasklayeritem.h"
|
||||||
#include "layeritem.h"
|
#include "layeritem.h"
|
||||||
#include "crumblepath.h"
|
|
||||||
|
|
||||||
#include <QGraphicsItem>
|
#include <QGraphicsItem>
|
||||||
#include <QGraphicsObject>
|
#include <QGraphicsObject>
|
||||||
@@ -20,8 +19,7 @@ const qreal MaxOpacity = 0.5f;
|
|||||||
SubcomponentEditorTool::SubcomponentEditorTool(QDeclarativeDesignView *view)
|
SubcomponentEditorTool::SubcomponentEditorTool(QDeclarativeDesignView *view)
|
||||||
: AbstractFormEditorTool(view),
|
: AbstractFormEditorTool(view),
|
||||||
m_animIncrement(0.05f),
|
m_animIncrement(0.05f),
|
||||||
m_animTimer(new QTimer(this)),
|
m_animTimer(new QTimer(this))
|
||||||
m_crumblePathWidget(0)
|
|
||||||
{
|
{
|
||||||
m_mask = new SubcomponentMaskLayerItem(view, view->manipulatorLayer());
|
m_mask = new SubcomponentMaskLayerItem(view, view->manipulatorLayer());
|
||||||
connect(m_animTimer, SIGNAL(timeout()), SLOT(animate()));
|
connect(m_animTimer, SIGNAL(timeout()), SLOT(animate()));
|
||||||
@@ -125,8 +123,7 @@ void SubcomponentEditorTool::clear()
|
|||||||
m_animTimer->stop();
|
m_animTimer->stop();
|
||||||
m_mask->hide();
|
m_mask->hide();
|
||||||
|
|
||||||
if (m_crumblePathWidget)
|
emit cleared();
|
||||||
m_crumblePathWidget->clear();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SubcomponentEditorTool::graphicsObjectsChanged(const QList<QGraphicsObject*> &/*itemList*/)
|
void SubcomponentEditorTool::graphicsObjectsChanged(const QList<QGraphicsObject*> &/*itemList*/)
|
||||||
@@ -230,8 +227,7 @@ void SubcomponentEditorTool::pushContext(QGraphicsObject *contextItem)
|
|||||||
{
|
{
|
||||||
connect(contextItem, SIGNAL(destroyed(QObject*)), SLOT(contextDestroyed(QObject*)));
|
connect(contextItem, SIGNAL(destroyed(QObject*)), SLOT(contextDestroyed(QObject*)));
|
||||||
m_currentContext.push(contextItem);
|
m_currentContext.push(contextItem);
|
||||||
if (m_crumblePathWidget)
|
emit contextPushed(titleForItem(contextItem));
|
||||||
m_crumblePathWidget->pushElement(titleForItem(contextItem));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SubcomponentEditorTool::aboutToPopContext()
|
void SubcomponentEditorTool::aboutToPopContext()
|
||||||
@@ -248,8 +244,7 @@ QGraphicsObject *SubcomponentEditorTool::popContext()
|
|||||||
{
|
{
|
||||||
QGraphicsObject *popped = m_currentContext.pop();
|
QGraphicsObject *popped = m_currentContext.pop();
|
||||||
|
|
||||||
if (m_crumblePathWidget)
|
emit contextPopped();
|
||||||
m_crumblePathWidget->popElement();
|
|
||||||
|
|
||||||
disconnect(popped, SIGNAL(xChanged()), this, SLOT(refresh()));
|
disconnect(popped, SIGNAL(xChanged()), this, SLOT(refresh()));
|
||||||
disconnect(popped, SIGNAL(yChanged()), this, SLOT(refresh()));
|
disconnect(popped, SIGNAL(yChanged()), this, SLOT(refresh()));
|
||||||
@@ -285,24 +280,13 @@ void SubcomponentEditorTool::contextDestroyed(QObject *contextToDestroy)
|
|||||||
// pop out the whole context - it might not be safe anymore.
|
// pop out the whole context - it might not be safe anymore.
|
||||||
while (m_currentContext.size() > 1) {
|
while (m_currentContext.size() > 1) {
|
||||||
m_currentContext.pop();
|
m_currentContext.pop();
|
||||||
if (m_crumblePathWidget)
|
emit contextPopped();
|
||||||
m_crumblePathWidget->popElement();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
m_mask->setVisible(false);
|
m_mask->setVisible(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SubcomponentEditorTool::setCrumblePathWidget(CrumblePath *pathWidget)
|
|
||||||
{
|
|
||||||
m_crumblePathWidget = pathWidget;
|
|
||||||
|
|
||||||
if (m_crumblePathWidget) {
|
|
||||||
connect(m_crumblePathWidget, SIGNAL(elementClicked(int)), SLOT(setContext(int)));
|
|
||||||
connect(m_crumblePathWidget, SIGNAL(elementContextMenuRequested(int)), SLOT(openContextMenuForContext(int)));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void SubcomponentEditorTool::setContext(int contextIndex)
|
void SubcomponentEditorTool::setContext(int contextIndex)
|
||||||
{
|
{
|
||||||
Q_ASSERT(contextIndex >= 0);
|
Q_ASSERT(contextIndex >= 0);
|
||||||
@@ -317,10 +301,5 @@ void SubcomponentEditorTool::setContext(int contextIndex)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SubcomponentEditorTool::openContextMenuForContext(int /*contextIndex*/)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace QmlViewer
|
} // namespace QmlViewer
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ QT_FORWARD_DECLARE_CLASS(QTimer)
|
|||||||
|
|
||||||
namespace QmlViewer {
|
namespace QmlViewer {
|
||||||
|
|
||||||
class CrumblePath;
|
|
||||||
class SubcomponentMaskLayerItem;
|
class SubcomponentMaskLayerItem;
|
||||||
|
|
||||||
class SubcomponentEditorTool : public AbstractFormEditorTool
|
class SubcomponentEditorTool : public AbstractFormEditorTool
|
||||||
@@ -49,10 +48,14 @@ public:
|
|||||||
QGraphicsObject *popContext();
|
QGraphicsObject *popContext();
|
||||||
QGraphicsObject *currentRootItem() const;
|
QGraphicsObject *currentRootItem() const;
|
||||||
|
|
||||||
void setCrumblePathWidget(CrumblePath *pathWidget);
|
public slots:
|
||||||
|
void setContext(int contextIndex);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void exitContextRequested();
|
void exitContextRequested();
|
||||||
|
void cleared();
|
||||||
|
void contextPushed(const QString &contextTitle);
|
||||||
|
void contextPopped();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void selectedItemsChanged(const QList<QGraphicsItem*> &itemList);
|
void selectedItemsChanged(const QList<QGraphicsItem*> &itemList);
|
||||||
@@ -61,8 +64,6 @@ private slots:
|
|||||||
void animate();
|
void animate();
|
||||||
void contextDestroyed(QObject *context);
|
void contextDestroyed(QObject *context);
|
||||||
void refresh();
|
void refresh();
|
||||||
void setContext(int contextIndex);
|
|
||||||
void openContextMenuForContext(int contextIndex);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void aboutToPopContext();
|
void aboutToPopContext();
|
||||||
@@ -73,9 +74,6 @@ private:
|
|||||||
qreal m_animIncrement;
|
qreal m_animIncrement;
|
||||||
SubcomponentMaskLayerItem *m_mask;
|
SubcomponentMaskLayerItem *m_mask;
|
||||||
QTimer *m_animTimer;
|
QTimer *m_animTimer;
|
||||||
|
|
||||||
CrumblePath *m_crumblePathWidget;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace QmlViewer
|
} // namespace QmlViewer
|
||||||
|
|||||||
@@ -75,7 +75,6 @@ public:
|
|||||||
QList<QGraphicsItem*> selectableItems(const QRectF &sceneRect, Qt::ItemSelectionMode selectionMode) const;
|
QList<QGraphicsItem*> selectableItems(const QRectF &sceneRect, Qt::ItemSelectionMode selectionMode) const;
|
||||||
QGraphicsItem *currentRootItem() const;
|
QGraphicsItem *currentRootItem() const;
|
||||||
|
|
||||||
CrumblePath *crumblePathWidget() const;
|
|
||||||
QToolBar *toolbar() const;
|
QToolBar *toolbar() const;
|
||||||
static QString idStringForObject(QObject *obj);
|
static QString idStringForObject(QObject *obj);
|
||||||
QRectF adjustToScreenBoundaries(const QRectF &boundingRectInSceneSpace);
|
QRectF adjustToScreenBoundaries(const QRectF &boundingRectInSceneSpace);
|
||||||
@@ -92,6 +91,8 @@ public Q_SLOTS:
|
|||||||
void continueExecution(qreal slowdownFactor = 1.0f);
|
void continueExecution(qreal slowdownFactor = 1.0f);
|
||||||
void pauseExecution();
|
void pauseExecution();
|
||||||
|
|
||||||
|
void setInspectorContext(int contextIndex);
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void designModeBehaviorChanged(bool inDesignMode);
|
void designModeBehaviorChanged(bool inDesignMode);
|
||||||
void reloadRequested();
|
void reloadRequested();
|
||||||
@@ -104,6 +105,10 @@ Q_SIGNALS:
|
|||||||
void executionStarted(qreal slowdownFactor);
|
void executionStarted(qreal slowdownFactor);
|
||||||
void executionPaused();
|
void executionPaused();
|
||||||
|
|
||||||
|
void inspectorContextCleared();
|
||||||
|
void inspectorContextPushed(const QString &contextTitle);
|
||||||
|
void inspectorContextPopped();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void leaveEvent(QEvent *);
|
void leaveEvent(QEvent *);
|
||||||
void mousePressEvent(QMouseEvent *event);
|
void mousePressEvent(QMouseEvent *event);
|
||||||
|
|||||||
@@ -8,7 +8,6 @@
|
|||||||
#include "boundingrecthighlighter.h"
|
#include "boundingrecthighlighter.h"
|
||||||
#include "subcomponenteditortool.h"
|
#include "subcomponenteditortool.h"
|
||||||
#include "qmltoolbar.h"
|
#include "qmltoolbar.h"
|
||||||
#include "crumblepath.h"
|
|
||||||
|
|
||||||
#include <QDeclarativeItem>
|
#include <QDeclarativeItem>
|
||||||
#include <QDeclarativeEngine>
|
#include <QDeclarativeEngine>
|
||||||
@@ -44,15 +43,12 @@ QDeclarativeDesignView::QDeclarativeDesignView(QWidget *parent) :
|
|||||||
{
|
{
|
||||||
data = new QDeclarativeDesignViewPrivate;
|
data = new QDeclarativeDesignViewPrivate;
|
||||||
|
|
||||||
data->crumblePath = new CrumblePath(0);
|
|
||||||
|
|
||||||
data->manipulatorLayer = new LayerItem(scene());
|
data->manipulatorLayer = new LayerItem(scene());
|
||||||
data->selectionTool = new SelectionTool(this);
|
data->selectionTool = new SelectionTool(this);
|
||||||
data->zoomTool = new ZoomTool(this);
|
data->zoomTool = new ZoomTool(this);
|
||||||
data->colorPickerTool = new ColorPickerTool(this);
|
data->colorPickerTool = new ColorPickerTool(this);
|
||||||
data->boundingRectHighlighter = new BoundingRectHighlighter(this);
|
data->boundingRectHighlighter = new BoundingRectHighlighter(this);
|
||||||
data->subcomponentEditorTool = new SubcomponentEditorTool(this);
|
data->subcomponentEditorTool = new SubcomponentEditorTool(this);
|
||||||
data->subcomponentEditorTool->setCrumblePathWidget(data->crumblePath);
|
|
||||||
data->currentTool = data->selectionTool;
|
data->currentTool = data->selectionTool;
|
||||||
|
|
||||||
setMouseTracking(true);
|
setMouseTracking(true);
|
||||||
@@ -77,6 +73,10 @@ QDeclarativeDesignView::QDeclarativeDesignView(QWidget *parent) :
|
|||||||
connect(data->colorPickerTool, SIGNAL(selectedColorChanged(QColor)),
|
connect(data->colorPickerTool, SIGNAL(selectedColorChanged(QColor)),
|
||||||
qmlDesignDebugServer(), SLOT(selectedColorChanged(QColor)));
|
qmlDesignDebugServer(), SLOT(selectedColorChanged(QColor)));
|
||||||
|
|
||||||
|
connect(data->subcomponentEditorTool, SIGNAL(cleared()), SIGNAL(inspectorContextCleared()));
|
||||||
|
connect(data->subcomponentEditorTool, SIGNAL(contextPushed(QString)), SIGNAL(inspectorContextPushed(QString)));
|
||||||
|
connect(data->subcomponentEditorTool, SIGNAL(contextPopped()), SIGNAL(inspectorContextPopped()));
|
||||||
|
|
||||||
createToolbar();
|
createToolbar();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,6 +84,11 @@ QDeclarativeDesignView::~QDeclarativeDesignView()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QDeclarativeDesignView::setInspectorContext(int contextIndex)
|
||||||
|
{
|
||||||
|
data->subcomponentEditorTool->setContext(contextIndex);
|
||||||
|
}
|
||||||
|
|
||||||
void QDeclarativeDesignView::reloadView()
|
void QDeclarativeDesignView::reloadView()
|
||||||
{
|
{
|
||||||
data->subcomponentEditorTool->clear();
|
data->subcomponentEditorTool->clear();
|
||||||
@@ -593,11 +598,6 @@ QRectF QDeclarativeDesignView::adjustToScreenBoundaries(const QRectF &boundingRe
|
|||||||
return boundingRect;
|
return boundingRect;
|
||||||
}
|
}
|
||||||
|
|
||||||
CrumblePath *QDeclarativeDesignView::crumblePathWidget() const
|
|
||||||
{
|
|
||||||
return data->crumblePath;
|
|
||||||
}
|
|
||||||
|
|
||||||
QToolBar *QDeclarativeDesignView::toolbar() const
|
QToolBar *QDeclarativeDesignView::toolbar() const
|
||||||
{
|
{
|
||||||
return data->toolbar;
|
return data->toolbar;
|
||||||
|
|||||||
@@ -73,7 +73,6 @@ public:
|
|||||||
qreal slowdownFactor;
|
qreal slowdownFactor;
|
||||||
|
|
||||||
QmlToolbar *toolbar;
|
QmlToolbar *toolbar;
|
||||||
CrumblePath *crumblePath;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ HEADERS += \
|
|||||||
include/jsdebuggeragent.h \
|
include/jsdebuggeragent.h \
|
||||||
include/qdeclarativedesignview.h \
|
include/qdeclarativedesignview.h \
|
||||||
include/qdeclarativedesigndebugserver.h \
|
include/qdeclarativedesigndebugserver.h \
|
||||||
include/crumblepath.h \
|
|
||||||
include/qmlviewerconstants.h \
|
include/qmlviewerconstants.h \
|
||||||
include/qmljsdebugger_global.h \
|
include/qmljsdebugger_global.h \
|
||||||
qdeclarativedesignview_p.h
|
qdeclarativedesignview_p.h
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
#include <QStyle>
|
#include <QStyle>
|
||||||
#include <QResizeEvent>
|
#include <QResizeEvent>
|
||||||
|
|
||||||
namespace QmlViewer {
|
namespace Utils {
|
||||||
|
|
||||||
static const int ArrowBorderSize = 12;
|
static const int ArrowBorderSize = 12;
|
||||||
|
|
||||||
@@ -32,20 +32,22 @@
|
|||||||
|
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
#include <QList>
|
#include <QList>
|
||||||
#include "qmljsdebugger_global.h"
|
#include "utils_global.h"
|
||||||
|
|
||||||
QT_FORWARD_DECLARE_CLASS(QResizeEvent);
|
QT_FORWARD_DECLARE_CLASS(QResizeEvent);
|
||||||
|
|
||||||
namespace QmlViewer {
|
namespace Utils {
|
||||||
|
|
||||||
class CrumblePathButton;
|
class CrumblePathButton;
|
||||||
|
|
||||||
class QMLJSDEBUGGER_EXPORT CrumblePath : public QWidget
|
class QTCREATOR_UTILS_EXPORT CrumblePath : public QWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit CrumblePath(QWidget *parent = 0);
|
explicit CrumblePath(QWidget *parent = 0);
|
||||||
~CrumblePath();
|
~CrumblePath();
|
||||||
|
|
||||||
|
public slots:
|
||||||
void pushElement(const QString &title);
|
void pushElement(const QString &title);
|
||||||
void popElement();
|
void popElement();
|
||||||
void clear();
|
void clear();
|
||||||
@@ -42,7 +42,8 @@ SOURCES += reloadpromptutils.cpp \
|
|||||||
filterlineedit.cpp \
|
filterlineedit.cpp \
|
||||||
faketooltip.cpp \
|
faketooltip.cpp \
|
||||||
htmldocextractor.cpp \
|
htmldocextractor.cpp \
|
||||||
navigationtreeview.cpp
|
navigationtreeview.cpp \
|
||||||
|
crumblepath.cpp
|
||||||
win32 {
|
win32 {
|
||||||
SOURCES += abstractprocess_win.cpp \
|
SOURCES += abstractprocess_win.cpp \
|
||||||
consoleprocess_win.cpp \
|
consoleprocess_win.cpp \
|
||||||
@@ -97,7 +98,8 @@ HEADERS += utils_global.h \
|
|||||||
filterlineedit.h \
|
filterlineedit.h \
|
||||||
faketooltip.h \
|
faketooltip.h \
|
||||||
htmldocextractor.h \
|
htmldocextractor.h \
|
||||||
navigationtreeview.h
|
navigationtreeview.h \
|
||||||
|
crumblepath.h
|
||||||
FORMS += filewizardpage.ui \
|
FORMS += filewizardpage.ui \
|
||||||
projectintropage.ui \
|
projectintropage.ui \
|
||||||
newclasswidget.ui \
|
newclasswidget.ui \
|
||||||
|
|||||||
@@ -8,8 +8,10 @@ SOURCES += main.cpp
|
|||||||
# hack to get qtLibraryTarget macro working
|
# hack to get qtLibraryTarget macro working
|
||||||
TEMPLATE +=lib
|
TEMPLATE +=lib
|
||||||
include(../../../libs/qmljsdebugger/qmljsdebugger.pri)
|
include(../../../libs/qmljsdebugger/qmljsdebugger.pri)
|
||||||
|
include(../../../libs/utils/utils.pri)
|
||||||
mac {
|
mac {
|
||||||
libraryTarget = $$qtLibraryTarget(QmlJSDebugger)
|
qmljsLibraryTarget = $$qtLibraryTarget(QmlJSDebugger)
|
||||||
|
utilsLibraryTarget = $$qtLibraryTarget(Utils)
|
||||||
}
|
}
|
||||||
TEMPLATE -=lib
|
TEMPLATE -=lib
|
||||||
|
|
||||||
@@ -22,7 +24,8 @@ mac {
|
|||||||
QMAKE_INFO_PLIST=Info_mac.plist
|
QMAKE_INFO_PLIST=Info_mac.plist
|
||||||
TARGET=QMLObserver
|
TARGET=QMLObserver
|
||||||
ICON=qml.icns
|
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 {
|
} else {
|
||||||
TARGET=qmlobserver
|
TARGET=qmlobserver
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,7 +55,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <qdeclarativedesignview.h>
|
#include <qdeclarativedesignview.h>
|
||||||
#include <crumblepath.h>
|
#include <utils/crumblepath.h>
|
||||||
|
|
||||||
#include "qmlruntime.h"
|
#include "qmlruntime.h"
|
||||||
#include <qdeclarativecontext.h>
|
#include <qdeclarativecontext.h>
|
||||||
@@ -551,6 +551,7 @@ QDeclarativeViewer::QDeclarativeViewer(QWidget *parent, Qt::WindowFlags flags)
|
|||||||
, tester(0)
|
, tester(0)
|
||||||
, useQmlFileBrowser(true)
|
, useQmlFileBrowser(true)
|
||||||
, m_centralWidget(0)
|
, m_centralWidget(0)
|
||||||
|
, m_crumblePathWidget(0)
|
||||||
, translator(0)
|
, translator(0)
|
||||||
{
|
{
|
||||||
QDeclarativeViewer::registerTypes();
|
QDeclarativeViewer::registerTypes();
|
||||||
@@ -590,18 +591,19 @@ QDeclarativeViewer::QDeclarativeViewer(QWidget *parent, Qt::WindowFlags flags)
|
|||||||
canvas->toolbar()->setFloatable(false);
|
canvas->toolbar()->setFloatable(false);
|
||||||
canvas->toolbar()->setMovable(false);
|
canvas->toolbar()->setMovable(false);
|
||||||
|
|
||||||
|
m_crumblePathWidget = new Utils::CrumblePath(this);
|
||||||
m_centralWidget = new QWidget(this);
|
m_centralWidget = new QWidget(this);
|
||||||
QVBoxLayout *layout = new QVBoxLayout(m_centralWidget);
|
QVBoxLayout *layout = new QVBoxLayout(m_centralWidget);
|
||||||
layout->setMargin(0);
|
layout->setMargin(0);
|
||||||
layout->setSpacing(0);
|
layout->setSpacing(0);
|
||||||
layout->addWidget(canvas->crumblePathWidget());
|
layout->addWidget(m_crumblePathWidget);
|
||||||
|
|
||||||
#ifndef Q_WS_MAC
|
#ifndef Q_WS_MAC
|
||||||
QFile file(":/toolbarstyle.css");
|
QFile file(":/toolbarstyle.css");
|
||||||
file.open(QFile::ReadOnly);
|
file.open(QFile::ReadOnly);
|
||||||
QString toolbarStylesheet = QLatin1String(file.readAll());
|
QString toolbarStylesheet = QLatin1String(file.readAll());
|
||||||
canvas->toolbar()->setStyleSheet(toolbarStylesheet);
|
canvas->toolbar()->setStyleSheet(toolbarStylesheet);
|
||||||
canvas->crumblePathWidget()->setStyleSheet("QWidget { border-bottom: 1px solid black; }");
|
m_crumblePathWidget->setStyleSheet("QWidget { border-bottom: 1px solid black; }");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
layout->addWidget(canvas);
|
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(reloadRequested()), this, SLOT(reload()));
|
||||||
QObject::connect(canvas, SIGNAL(sceneResized(QSize)), this, SLOT(sceneResized(QSize)));
|
QObject::connect(canvas, SIGNAL(sceneResized(QSize)), this, SLOT(sceneResized(QSize)));
|
||||||
QObject::connect(canvas, SIGNAL(statusChanged(QDeclarativeView::Status)), this, SLOT(statusChanged()));
|
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(canvas->engine(), SIGNAL(quit()), QCoreApplication::instance (), SLOT(quit()));
|
||||||
|
|
||||||
QObject::connect(warningsWidget(), SIGNAL(opened()), this, SLOT(warningsWidgetOpened()));
|
QObject::connect(warningsWidget(), SIGNAL(opened()), this, SLOT(warningsWidgetOpened()));
|
||||||
|
|||||||
@@ -52,6 +52,9 @@
|
|||||||
namespace QmlViewer {
|
namespace QmlViewer {
|
||||||
class QDeclarativeDesignView;
|
class QDeclarativeDesignView;
|
||||||
}
|
}
|
||||||
|
namespace Utils {
|
||||||
|
class CrumblePath;
|
||||||
|
}
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
@@ -202,6 +205,7 @@ private:
|
|||||||
bool useQmlFileBrowser;
|
bool useQmlFileBrowser;
|
||||||
|
|
||||||
QWidget *m_centralWidget;
|
QWidget *m_centralWidget;
|
||||||
|
Utils::CrumblePath *m_crumblePathWidget;
|
||||||
|
|
||||||
QTranslator *translator;
|
QTranslator *translator;
|
||||||
void loadTranslationFile(const QString& directory);
|
void loadTranslationFile(const QString& directory);
|
||||||
|
|||||||
Reference in New Issue
Block a user