$$PWD/qdeclarativedebugtrace.cpp \
$$PWD/qdeclarativedebughelper.cpp \
$$PWD/qdeclarativedebugserver.cpp \
- $$PWD/qdeclarativeobserverservice.cpp \
+ $$PWD/qdeclarativeinspectorservice.cpp \
$$PWD/qjsdebuggeragent.cpp \
$$PWD/qjsdebugservice.cpp
$$PWD/qdeclarativedebughelper_p.h \
$$PWD/qdeclarativedebugserver_p.h \
$$PWD/qdeclarativedebugserverconnection_p.h \
- $$PWD/qdeclarativeobserverservice_p.h \
- $$PWD/qdeclarativeobserverinterface_p.h \
+ $$PWD/qdeclarativeinspectorservice_p.h \
+ $$PWD/qdeclarativeinspectorinterface_p.h \
$$PWD/qjsdebuggeragent_p.h \
$$PWD/qjsdebugservice_p.h
QT_MODULE(Declarative)
-class Q_DECLARATIVE_EXPORT QDeclarativeObserverInterface
+class Q_DECLARATIVE_EXPORT QDeclarativeInspectorInterface
{
public:
- QDeclarativeObserverInterface() {}
- virtual ~QDeclarativeObserverInterface() {}
+ QDeclarativeInspectorInterface() {}
+ virtual ~QDeclarativeInspectorInterface() {}
virtual void activate() = 0;
virtual void deactivate() = 0;
};
-Q_DECLARE_INTERFACE(QDeclarativeObserverInterface, "com.trolltech.Qt.QDeclarativeObserverInterface/1.0")
+Q_DECLARE_INTERFACE(QDeclarativeInspectorInterface, "com.trolltech.Qt.QDeclarativeInspectorInterface/1.0")
QT_END_NAMESPACE
**
****************************************************************************/
-#include "private/qdeclarativeobserverservice_p.h"
-#include "private/qdeclarativeobserverinterface_p.h"
+#include "private/qdeclarativeinspectorservice_p.h"
+#include "private/qdeclarativeinspectorinterface_p.h"
#include <QtCore/QCoreApplication>
#include <QtCore/QDebug>
QT_BEGIN_NAMESPACE
-Q_GLOBAL_STATIC(QDeclarativeObserverService, serviceInstance)
+Q_GLOBAL_STATIC(QDeclarativeInspectorService, serviceInstance)
-QDeclarativeObserverService::QDeclarativeObserverService()
+QDeclarativeInspectorService::QDeclarativeInspectorService()
: QDeclarativeDebugService(QLatin1String("QDeclarativeObserverMode"))
- , m_observer(0)
+ , m_inspectorPlugin(0)
{
}
-QDeclarativeObserverService *QDeclarativeObserverService::instance()
+QDeclarativeInspectorService *QDeclarativeInspectorService::instance()
{
return serviceInstance();
}
-void QDeclarativeObserverService::addView(QDeclarativeView *view)
+void QDeclarativeInspectorService::addView(QDeclarativeView *view)
{
m_views.append(view);
}
-void QDeclarativeObserverService::removeView(QDeclarativeView *view)
+void QDeclarativeInspectorService::removeView(QDeclarativeView *view)
{
m_views.removeAll(view);
}
-void QDeclarativeObserverService::sendMessage(const QByteArray &message)
+void QDeclarativeInspectorService::sendMessage(const QByteArray &message)
{
if (status() != Enabled)
return;
QDeclarativeDebugService::sendMessage(message);
}
-void QDeclarativeObserverService::statusChanged(Status status)
+void QDeclarativeInspectorService::statusChanged(Status status)
{
if (m_views.isEmpty())
return;
if (status == Enabled) {
- if (!m_observer)
- m_observer = loadObserverPlugin();
+ if (!m_inspectorPlugin)
+ m_inspectorPlugin = loadInspectorPlugin();
- if (!m_observer) {
- qWarning() << "Error while loading observer plugin";
+ if (!m_inspectorPlugin) {
+ qWarning() << "Error while loading inspector plugin";
return;
}
- m_observer->activate();
+ m_inspectorPlugin->activate();
} else {
- if (m_observer)
- m_observer->deactivate();
+ if (m_inspectorPlugin)
+ m_inspectorPlugin->deactivate();
}
}
-void QDeclarativeObserverService::messageReceived(const QByteArray &message)
+void QDeclarativeInspectorService::messageReceived(const QByteArray &message)
{
emit gotMessage(message);
}
-QDeclarativeObserverInterface *QDeclarativeObserverService::loadObserverPlugin()
+QDeclarativeInspectorInterface *QDeclarativeInspectorService::loadInspectorPlugin()
{
QStringList pluginCandidates;
const QStringList paths = QCoreApplication::libraryPaths();
if (!loader.load())
continue;
- QDeclarativeObserverInterface *observer =
- qobject_cast<QDeclarativeObserverInterface*>(loader.instance());
+ QDeclarativeInspectorInterface *inspector =
+ qobject_cast<QDeclarativeInspectorInterface*>(loader.instance());
- if (observer)
- return observer;
+ if (inspector)
+ return inspector;
loader.unload();
}
return 0;
QT_MODULE(Declarative)
class QDeclarativeView;
-class QDeclarativeObserverInterface;
+class QDeclarativeInspectorInterface;
-class Q_DECLARATIVE_EXPORT QDeclarativeObserverService : public QDeclarativeDebugService
+class Q_DECLARATIVE_EXPORT QDeclarativeInspectorService : public QDeclarativeDebugService
{
Q_OBJECT
public:
- QDeclarativeObserverService();
- static QDeclarativeObserverService *instance();
+ QDeclarativeInspectorService();
+ static QDeclarativeInspectorService *instance();
void addView(QDeclarativeView *);
void removeView(QDeclarativeView *);
virtual void messageReceived(const QByteArray &);
private:
- static QDeclarativeObserverInterface *loadObserverPlugin();
+ static QDeclarativeInspectorInterface *loadInspectorPlugin();
QList<QDeclarativeView*> m_views;
- QDeclarativeObserverInterface *m_observer;
+ QDeclarativeInspectorInterface *m_inspectorPlugin;
};
QT_END_NAMESPACE
#include <qdeclarativeguard_p.h>
#include <private/qdeclarativedebugtrace_p.h>
-#include <private/qdeclarativeobserverservice_p.h>
+#include <private/qdeclarativeinspectorservice_p.h>
#include <qscriptvalueiterator.h>
#include <qdebug.h>
q->viewport()->setAttribute(Qt::WA_NoSystemBackground);
#endif
- QDeclarativeObserverService::instance()->addView(q);
+ QDeclarativeInspectorService::instance()->addView(q);
}
/*!
*/
QDeclarativeView::~QDeclarativeView()
{
- QDeclarativeObserverService::instance()->removeView(this);
+ QDeclarativeInspectorService::instance()->removeView(this);
}
/*! \property QDeclarativeView::source
****************************************************************************/
#include "abstractliveedittool_p.h"
-#include "../qdeclarativeviewobserver_p_p.h"
+#include "../qdeclarativeviewinspector_p_p.h"
#include <QDeclarativeEngine>
QT_BEGIN_NAMESPACE
-AbstractLiveEditTool::AbstractLiveEditTool(QDeclarativeViewObserver *editorView)
- : QObject(editorView), m_observer(editorView)
+AbstractLiveEditTool::AbstractLiveEditTool(QDeclarativeViewInspector *editorView)
+ : QObject(editorView), m_inspector(editorView)
{
}
{
}
-QDeclarativeViewObserver *AbstractLiveEditTool::observer() const
+QDeclarativeViewInspector *AbstractLiveEditTool::inspector() const
{
- return m_observer;
+ return m_inspector;
}
QDeclarativeView *AbstractLiveEditTool::view() const
{
- return m_observer->declarativeView();
+ return m_inspector->declarativeView();
}
QGraphicsScene* AbstractLiveEditTool::scene() const
QList<QGraphicsItem*> AbstractLiveEditTool::items() const
{
- return observer()->selectedItems();
+ return inspector()->selectedItems();
}
bool AbstractLiveEditTool::topItemIsMovable(const QList<QGraphicsItem*> & itemList)
bool AbstractLiveEditTool::topSelectedItemIsMovable(const QList<QGraphicsItem*> &itemList)
{
- QList<QGraphicsItem*> selectedItems = observer()->selectedItems();
+ QList<QGraphicsItem*> selectedItems = inspector()->selectedItems();
foreach (QGraphicsItem *item, itemList) {
QDeclarativeItem *declarativeItem = toQDeclarativeItem(item);
QDeclarativeItem *declarativeItem = qobject_cast<QDeclarativeItem*>(gfxObject);
if (declarativeItem) {
- objectStringId = m_observer->idStringForObject(declarativeItem);
+ objectStringId = m_inspector->idStringForObject(declarativeItem);
}
if (!objectStringId.isEmpty()) {
QT_MODULE(Declarative)
-class QDeclarativeViewObserver;
+class QDeclarativeViewInspector;
class AbstractLiveEditTool : public QObject
{
Q_OBJECT
public:
- AbstractLiveEditTool(QDeclarativeViewObserver *observer);
+ AbstractLiveEditTool(QDeclarativeViewInspector *inspector);
virtual ~AbstractLiveEditTool();
protected:
virtual void selectedItemsChanged(const QList<QGraphicsItem*> &objectList) = 0;
- QDeclarativeViewObserver *observer() const;
+ QDeclarativeViewInspector *inspector() const;
QDeclarativeView *view() const;
QGraphicsScene *scene() const;
private:
- QDeclarativeViewObserver *m_observer;
+ QDeclarativeViewInspector *m_inspector;
QList<QGraphicsItem*> m_itemList;
};
#include "boundingrecthighlighter_p.h"
-#include "../qdeclarativeviewobserver_p.h"
-#include "../qmlobserverconstants_p.h"
+#include "../qdeclarativeviewinspector_p.h"
+#include "../qmlinspectorconstants_p.h"
#include <QtGui/QGraphicsPolygonItem>
return Constants::EditorItemType;
}
-BoundingRectHighlighter::BoundingRectHighlighter(QDeclarativeViewObserver *view) :
+BoundingRectHighlighter::BoundingRectHighlighter(QDeclarativeViewInspector *view) :
LiveLayerItem(view->declarativeView()->scene()),
m_view(view),
m_animFrame(0)
QT_MODULE(Declarative)
-class QDeclarativeViewObserver;
+class QDeclarativeViewInspector;
class BoundingBox;
class BoundingRectHighlighter : public LiveLayerItem
{
Q_OBJECT
public:
- explicit BoundingRectHighlighter(QDeclarativeViewObserver *view);
+ explicit BoundingRectHighlighter(QDeclarativeViewInspector *view);
~BoundingRectHighlighter();
void clear();
void highlight(QList<QGraphicsObject*> items);
private:
Q_DISABLE_COPY(BoundingRectHighlighter)
- QDeclarativeViewObserver *m_view;
+ QDeclarativeViewInspector *m_view;
QList<BoundingBox* > m_boxes;
QList<BoundingBox* > m_freeBoxes;
QTimer *m_animTimer;
#include "colorpickertool_p.h"
-#include "../qdeclarativeviewobserver_p.h"
+#include "../qdeclarativeviewinspector_p.h"
#include <QtGui/QMouseEvent>
#include <QtGui/QKeyEvent>
QT_BEGIN_NAMESPACE
-ColorPickerTool::ColorPickerTool(QDeclarativeViewObserver *view) :
+ColorPickerTool::ColorPickerTool(QDeclarativeViewInspector *view) :
AbstractLiveEditTool(view)
{
m_selectedColor.setRgb(0,0,0);
{
Q_OBJECT
public:
- explicit ColorPickerTool(QDeclarativeViewObserver *view);
+ explicit ColorPickerTool(QDeclarativeViewInspector *view);
virtual ~ColorPickerTool();
<file>images/zoom-24.png</file>
<file>images/select-24.png</file>
<file>images/select-marquee-24.png</file>
- <file>images/observermode.png</file>
- <file>images/observermode-24.png</file>
+ <file>images/inspectormode.png</file>
+ <file>images/inspectormode-24.png</file>
</qresource>
</RCC>
#include "livelayeritem_p.h"
-#include "../qmlobserverconstants_p.h"
+#include "../qmlinspectorconstants_p.h"
#include <QGraphicsScene>
#include "liverubberbandselectionmanipulator_p.h"
-#include "../qdeclarativeviewobserver_p_p.h"
+#include "../qdeclarativeviewinspector_p_p.h"
#include <QtGui/QGraphicsItem>
QT_BEGIN_NAMESPACE
LiveRubberBandSelectionManipulator::LiveRubberBandSelectionManipulator(QGraphicsObject *layerItem,
- QDeclarativeViewObserver *editorView)
+ QDeclarativeViewInspector *editorView)
: m_selectionRectangleElement(layerItem),
m_editorView(editorView),
m_beginFormEditorItem(0),
m_selectionRectangleElement.setRect(m_beginPoint, m_beginPoint);
m_selectionRectangleElement.show();
m_isActive = true;
- QDeclarativeViewObserverPrivate *observerPrivate
- = QDeclarativeViewObserverPrivate::get(m_editorView);
- m_beginFormEditorItem = topFormEditorItem(observerPrivate->selectableItems(beginPoint));
+ QDeclarativeViewInspectorPrivate *inspectorPrivate
+ = QDeclarativeViewInspectorPrivate::get(m_editorView);
+ m_beginFormEditorItem = topFormEditorItem(inspectorPrivate->selectableItems(beginPoint));
m_oldSelectionList = m_editorView->selectedItems();
}
void LiveRubberBandSelectionManipulator::select(SelectionType selectionType)
{
- QDeclarativeViewObserverPrivate *observerPrivate
- = QDeclarativeViewObserverPrivate::get(m_editorView);
+ QDeclarativeViewInspectorPrivate *inspectorPrivate
+ = QDeclarativeViewInspectorPrivate::get(m_editorView);
QList<QGraphicsItem*> itemList
- = observerPrivate->selectableItems(m_selectionRectangleElement.rect(),
+ = inspectorPrivate->selectableItems(m_selectionRectangleElement.rect(),
Qt::IntersectsItemShape);
QList<QGraphicsItem*> newSelectionList;
QT_MODULE(Declarative)
-class QDeclarativeViewObserver;
+class QDeclarativeViewInspector;
class LiveRubberBandSelectionManipulator
{
};
LiveRubberBandSelectionManipulator(QGraphicsObject *layerItem,
- QDeclarativeViewObserver *editorView);
+ QDeclarativeViewInspector *editorView);
void setItems(const QList<QGraphicsItem*> &itemList);
QList<QGraphicsItem*> m_oldSelectionList;
LiveSelectionRectangle m_selectionRectangleElement;
QPointF m_beginPoint;
- QDeclarativeViewObserver *m_editorView;
+ QDeclarativeViewInspector *m_editorView;
QGraphicsItem *m_beginFormEditorItem;
bool m_isActive;
};
#include "liveselectionindicator_p.h"
-#include "../qdeclarativeviewobserver_p_p.h"
-#include "../qmlobserverconstants_p.h"
+#include "../qdeclarativeviewinspector_p_p.h"
+#include "../qmlinspectorconstants_p.h"
#include <QtGui/QGraphicsRectItem>
#include <QtGui/QGraphicsObject>
QT_BEGIN_NAMESPACE
-LiveSelectionIndicator::LiveSelectionIndicator(QDeclarativeViewObserver *viewObserver,
+LiveSelectionIndicator::LiveSelectionIndicator(QDeclarativeViewInspector *viewInspector,
QGraphicsObject *layerItem)
: m_layerItem(layerItem)
- , m_view(viewObserver)
+ , m_view(viewInspector)
{
}
QT_MODULE(Declarative)
-class QDeclarativeViewObserver;
+class QDeclarativeViewInspector;
class LiveSelectionIndicator
{
public:
- LiveSelectionIndicator(QDeclarativeViewObserver *viewObserver, QGraphicsObject *layerItem);
+ LiveSelectionIndicator(QDeclarativeViewInspector *viewInspector, QGraphicsObject *layerItem);
~LiveSelectionIndicator();
void show();
private:
QHash<QGraphicsItem*, QGraphicsRectItem *> m_indicatorShapeHash;
QWeakPointer<QGraphicsObject> m_layerItem;
- QDeclarativeViewObserver *m_view;
+ QDeclarativeViewInspector *m_view;
};
QT_END_NAMESPACE
#include "liveselectionrectangle_p.h"
-#include "../qmlobserverconstants_p.h"
+#include "../qmlinspectorconstants_p.h"
#include <QtGui/QPen>
#include <QtGui/QGraphicsRectItem>
#include "liveselectiontool_p.h"
#include "livelayeritem_p.h"
-#include "../qdeclarativeviewobserver_p_p.h"
+#include "../qdeclarativeviewinspector_p_p.h"
#include <QtGui/QApplication>
#include <QtGui/QWheelEvent>
QT_BEGIN_NAMESPACE
-LiveSelectionTool::LiveSelectionTool(QDeclarativeViewObserver *editorView) :
+LiveSelectionTool::LiveSelectionTool(QDeclarativeViewInspector *editorView) :
AbstractLiveEditTool(editorView),
m_rubberbandSelectionMode(false),
m_rubberbandSelectionManipulator(
- QDeclarativeViewObserverPrivate::get(editorView)->manipulatorLayer, editorView),
+ QDeclarativeViewInspectorPrivate::get(editorView)->manipulatorLayer, editorView),
m_singleSelectionManipulator(editorView),
m_selectionIndicator(editorView,
- QDeclarativeViewObserverPrivate::get(editorView)->manipulatorLayer),
+ QDeclarativeViewInspectorPrivate::get(editorView)->manipulatorLayer),
//m_resizeIndicator(editorView->manipulatorLayer()),
m_selectOnlyContentItems(true)
{
bool LiveSelectionTool::alreadySelected(const QList<QGraphicsItem*> &itemList) const
{
- QDeclarativeViewObserverPrivate *observerPrivate
- = QDeclarativeViewObserverPrivate::get(observer());
- const QList<QGraphicsItem*> selectedItems = observerPrivate->selectedItems();
+ QDeclarativeViewInspectorPrivate *inspectorPrivate
+ = QDeclarativeViewInspectorPrivate::get(inspector());
+ const QList<QGraphicsItem*> selectedItems = inspectorPrivate->selectedItems();
if (selectedItems.isEmpty())
return false;
void LiveSelectionTool::mousePressEvent(QMouseEvent *event)
{
- QDeclarativeViewObserverPrivate *observerPrivate
- = QDeclarativeViewObserverPrivate::get(observer());
- QList<QGraphicsItem*> itemList = observerPrivate->selectableItems(event->pos());
+ QDeclarativeViewInspectorPrivate *inspectorPrivate
+ = QDeclarativeViewInspectorPrivate::get(inspector());
+ QList<QGraphicsItem*> itemList = inspectorPrivate->selectableItems(event->pos());
LiveSingleSelectionManipulator::SelectionType selectionType = getSelectionType(event->modifiers());
if (event->buttons() & Qt::LeftButton) {
QAction *elementAction = contextMenu.addAction(itemTitle, this,
SLOT(contextMenuElementSelected()));
- if (observer()->selectedItems().contains(item)) {
+ if (inspector()->selectedItems().contains(item)) {
QFont boldFont = elementAction->font();
boldFont.setBold(true);
elementAction->setFont(boldFont);
int itemListIndex = action->data().toInt();
if (itemListIndex >= 0 && itemListIndex < m_contextMenuItemList.length()) {
QGraphicsObject *item = m_contextMenuItemList.at(itemListIndex)->toGraphicsObject();
- QDeclarativeViewObserverPrivate::get(observer())->highlight(item);
+ QDeclarativeViewInspectorPrivate::get(inspector())->highlight(item);
}
}
// if (topSelectedItemIsMovable(itemList))
// view()->changeTool(Constants::MoveToolMode);
// }
- QDeclarativeViewObserverPrivate *observerPrivate
- = QDeclarativeViewObserverPrivate::get(observer());
+ QDeclarativeViewInspectorPrivate *inspectorPrivate
+ = QDeclarativeViewInspectorPrivate::get(inspector());
- QList<QGraphicsItem*> selectableItemList = observerPrivate->selectableItems(event->pos());
+ QList<QGraphicsItem*> selectableItemList = inspectorPrivate->selectableItems(event->pos());
if (!selectableItemList.isEmpty()) {
QGraphicsObject *item = selectableItemList.first()->toGraphicsObject();
if (item)
- QDeclarativeViewObserverPrivate::get(observer())->highlight(item);
+ QDeclarativeViewInspectorPrivate::get(inspector())->highlight(item);
return;
}
- QDeclarativeViewObserverPrivate::get(observer())->clearHighlight();
+ QDeclarativeViewInspectorPrivate::get(inspector())->clearHighlight();
}
void LiveSelectionTool::mouseReleaseEvent(QMouseEvent *event)
if (event->orientation() == Qt::Horizontal || m_rubberbandSelectionMode)
return;
- QDeclarativeViewObserverPrivate *observerPrivate
- = QDeclarativeViewObserverPrivate::get(observer());
- QList<QGraphicsItem*> itemList = observerPrivate->selectableItems(event->pos());
+ QDeclarativeViewInspectorPrivate *inspectorPrivate
+ = QDeclarativeViewInspectorPrivate::get(inspector());
+ QList<QGraphicsItem*> itemList = inspectorPrivate->selectableItems(event->pos());
if (itemList.isEmpty())
return;
int selectedIdx = 0;
- if (!observer()->selectedItems().isEmpty()) {
- selectedIdx = itemList.indexOf(observer()->selectedItems().first());
+ if (!inspector()->selectedItems().isEmpty()) {
+ selectedIdx = itemList.indexOf(inspector()->selectedItems().first());
if (selectedIdx >= 0) {
if (event->delta() > 0) {
selectedIdx++;
Q_OBJECT
public:
- LiveSelectionTool(QDeclarativeViewObserver* editorView);
+ LiveSelectionTool(QDeclarativeViewInspector* editorView);
~LiveSelectionTool();
void mousePressEvent(QMouseEvent *event);
#include "livesingleselectionmanipulator_p.h"
-#include "../qdeclarativeviewobserver_p_p.h"
+#include "../qdeclarativeviewinspector_p_p.h"
#include <QtDebug>
QT_BEGIN_NAMESPACE
-LiveSingleSelectionManipulator::LiveSingleSelectionManipulator(QDeclarativeViewObserver *editorView)
+LiveSingleSelectionManipulator::LiveSingleSelectionManipulator(QDeclarativeViewInspector *editorView)
: m_editorView(editorView),
m_isActive(false)
{
{
m_beginPoint = beginPoint;
m_isActive = true;
- m_oldSelectionList = QDeclarativeViewObserverPrivate::get(m_editorView)->selectedItems();
+ m_oldSelectionList = QDeclarativeViewInspectorPrivate::get(m_editorView)->selectedItems();
}
void LiveSingleSelectionManipulator::update(const QPointF &/*updatePoint*/)
void LiveSingleSelectionManipulator::select(SelectionType selectionType, bool selectOnlyContentItems)
{
- QDeclarativeViewObserverPrivate *observerPrivate =
- QDeclarativeViewObserverPrivate::get(m_editorView);
- QList<QGraphicsItem*> itemList = observerPrivate->selectableItems(m_beginPoint);
+ QDeclarativeViewInspectorPrivate *inspectorPrivate =
+ QDeclarativeViewInspectorPrivate::get(m_editorView);
+ QList<QGraphicsItem*> itemList = inspectorPrivate->selectableItems(m_beginPoint);
select(selectionType, itemList, selectOnlyContentItems);
}
QT_MODULE(Declarative)
-class QDeclarativeViewObserver;
+class QDeclarativeViewInspector;
class LiveSingleSelectionManipulator
{
public:
- LiveSingleSelectionManipulator(QDeclarativeViewObserver *editorView);
+ LiveSingleSelectionManipulator(QDeclarativeViewInspector *editorView);
enum SelectionType {
ReplaceSelection,
private:
QList<QGraphicsItem*> m_oldSelectionList;
QPointF m_beginPoint;
- QDeclarativeViewObserver *m_editorView;
+ QDeclarativeViewInspector *m_editorView;
bool m_isActive;
};
ui->playIcon = QIcon(QLatin1String(":/qml/images/play-24.png"));
ui->pauseIcon = QIcon(QLatin1String(":/qml/images/pause-24.png"));
- ui->designmode = new QAction(QIcon(QLatin1String(":/qml/images/observermode-24.png")),
- tr("Observer Mode"), this);
+ ui->designmode = new QAction(QIcon(QLatin1String(":/qml/images/inspectormode-24.png")),
+ tr("Inspector Mode"), this);
ui->play = new QAction(ui->pauseIcon, tr("Play/Pause Animations"), this);
ui->select = new QAction(QIcon(QLatin1String(":/qml/images/select-24.png")), tr("Select"), this);
ui->selectMarquee = new QAction(QIcon(QLatin1String(":/qml/images/select-marquee-24.png")),
#include <QtGui/QToolBar>
#include <QtGui/QIcon>
-#include "../qmlobserverconstants_p.h"
+#include "../qmlinspectorconstants_p.h"
QT_FORWARD_DECLARE_CLASS(QActionGroup)
#include "subcomponentmasklayeritem_p.h"
-#include "../qmlobserverconstants_p.h"
-#include "../qdeclarativeviewobserver_p.h"
+#include "../qmlinspectorconstants_p.h"
+#include "../qdeclarativeviewinspector_p.h"
#include <QtGui/QPolygonF>
QT_BEGIN_NAMESPACE
-SubcomponentMaskLayerItem::SubcomponentMaskLayerItem(QDeclarativeViewObserver *observer,
+SubcomponentMaskLayerItem::SubcomponentMaskLayerItem(QDeclarativeViewInspector *inspector,
QGraphicsItem *parentItem) :
QGraphicsPolygonItem(parentItem),
- m_observer(observer),
+ m_inspector(inspector),
m_currentItem(0),
m_borderRect(new QGraphicsRectItem(this))
{
if (!m_currentItem)
return;
- QRect viewRect = m_observer->declarativeView()->rect();
- viewRect = m_observer->declarativeView()->mapToScene(viewRect).boundingRect().toRect();
+ QRect viewRect = m_inspector->declarativeView()->rect();
+ viewRect = m_inspector->declarativeView()->mapToScene(viewRect).boundingRect().toRect();
QRectF itemRect = item->boundingRect() | item->childrenBoundingRect();
itemRect = item->mapRectToScene(itemRect);
QT_MODULE(Declarative)
-class QDeclarativeViewObserver;
+class QDeclarativeViewInspector;
class SubcomponentMaskLayerItem : public QGraphicsPolygonItem
{
public:
- explicit SubcomponentMaskLayerItem(QDeclarativeViewObserver *observer,
+ explicit SubcomponentMaskLayerItem(QDeclarativeViewInspector *inspector,
QGraphicsItem *parentItem = 0);
int type() const;
void setCurrentItem(QGraphicsItem *item);
QRectF itemRect() const;
private:
- QDeclarativeViewObserver *m_observer;
+ QDeclarativeViewInspector *m_inspector;
QGraphicsItem *m_currentItem;
QGraphicsRectItem *m_borderRect;
QRectF m_itemPolyRect;
#include "toolbarcolorbox_p.h"
-#include "../qmlobserverconstants_p.h"
+#include "../qmlinspectorconstants_p.h"
#include <QtGui/QPixmap>
#include <QtGui/QPainter>
#include "zoomtool_p.h"
-#include "../qdeclarativeviewobserver_p_p.h"
+#include "../qdeclarativeviewinspector_p_p.h"
#include <QtGui/QMouseEvent>
#include <QtGui/QWheelEvent>
QT_BEGIN_NAMESPACE
-ZoomTool::ZoomTool(QDeclarativeViewObserver *view) :
+ZoomTool::ZoomTool(QDeclarativeViewInspector *view) :
AbstractLiveEditTool(view),
m_rubberbandManipulator(),
m_smoothZoomMultiplier(0.05f),
m_zoomOutAction->setShortcut(QKeySequence(Qt::Key_Minus));
- LiveLayerItem *layerItem = QDeclarativeViewObserverPrivate::get(view)->manipulatorLayer;
+ LiveLayerItem *layerItem = QDeclarativeViewInspectorPrivate::get(view)->manipulatorLayer;
QGraphicsObject *layerObject = reinterpret_cast<QGraphicsObject *>(layerItem);
m_rubberbandManipulator = new LiveRubberBandSelectionManipulator(layerObject, view);
ZoomOut
};
- explicit ZoomTool(QDeclarativeViewObserver *view);
+ explicit ZoomTool(QDeclarativeViewInspector *view);
virtual ~ZoomTool();
**
****************************************************************************/
-#include "qdeclarativeobserverplugin.h"
+#include "qdeclarativeinspectorplugin.h"
-#include "qdeclarativeviewobserver_p.h"
+#include "qdeclarativeviewinspector_p.h"
#include <QtCore/qplugin.h>
-#include <QtDeclarative/private/qdeclarativeobserverservice_p.h>
+#include <QtDeclarative/private/qdeclarativeinspectorservice_p.h>
QT_BEGIN_NAMESPACE
-QDeclarativeObserverPlugin::QDeclarativeObserverPlugin() :
- m_observer(0)
+QDeclarativeInspectorPlugin::QDeclarativeInspectorPlugin() :
+ m_inspector(0)
{
}
-QDeclarativeObserverPlugin::~QDeclarativeObserverPlugin()
+QDeclarativeInspectorPlugin::~QDeclarativeInspectorPlugin()
{
- delete m_observer;
+ delete m_inspector;
}
-void QDeclarativeObserverPlugin::activate()
+void QDeclarativeInspectorPlugin::activate()
{
- QDeclarativeObserverService *service = QDeclarativeObserverService::instance();
+ QDeclarativeInspectorService *service = QDeclarativeInspectorService::instance();
QList<QDeclarativeView*> views = service->views();
if (views.isEmpty())
return;
// TODO: Support multiple views
QDeclarativeView *view = service->views().at(0);
- m_observer = new QDeclarativeViewObserver(view, view);
+ m_inspector = new QDeclarativeViewInspector(view, view);
}
-void QDeclarativeObserverPlugin::deactivate()
+void QDeclarativeInspectorPlugin::deactivate()
{
- delete m_observer;
+ delete m_inspector;
}
-Q_EXPORT_PLUGIN2(declarativeobserver, QDeclarativeObserverPlugin)
+Q_EXPORT_PLUGIN2(declarativeinspector, QDeclarativeInspectorPlugin)
QT_END_NAMESPACE
**
****************************************************************************/
-#ifndef QDECLARATIVEOBSERVERPLUGIN_H
-#define QDECLARATIVEOBSERVERPLUGIN_H
+#ifndef QDECLARATIVEINSPECTORPLUGIN_H
+#define QDECLARATIVEINSPECTORPLUGIN_H
#include <QtCore/QPointer>
-#include <QtDeclarative/private/qdeclarativeobserverinterface_p.h>
+#include <QtDeclarative/private/qdeclarativeinspectorinterface_p.h>
QT_BEGIN_NAMESPACE
-class QDeclarativeViewObserver;
+class QDeclarativeViewInspector;
-class QDeclarativeObserverPlugin : public QObject, public QDeclarativeObserverInterface
+class QDeclarativeInspectorPlugin : public QObject, public QDeclarativeInspectorInterface
{
Q_OBJECT
- Q_DISABLE_COPY(QDeclarativeObserverPlugin)
- Q_INTERFACES(QDeclarativeObserverInterface)
+ Q_DISABLE_COPY(QDeclarativeInspectorPlugin)
+ Q_INTERFACES(QDeclarativeInspectorInterface)
public:
- QDeclarativeObserverPlugin();
- ~QDeclarativeObserverPlugin();
+ QDeclarativeInspectorPlugin();
+ ~QDeclarativeInspectorPlugin();
void activate();
void deactivate();
private:
- QPointer<QDeclarativeViewObserver> m_observer;
+ QPointer<QDeclarativeViewInspector> m_inspector;
};
QT_END_NAMESPACE
-#endif // QDECLARATIVEOBSERVERPLUGIN_H
+#endif // QDECLARATIVEINSPECTORPLUGIN_H
**
****************************************************************************/
-#ifndef QDECLARATIVEOBSERVERPROTOCOL_H
-#define QDECLARATIVEOBSERVERPROTOCOL_H
+#ifndef QDECLARATIVEINSPECTORPROTOCOL_H
+#define QDECLARATIVEINSPECTORPROTOCOL_H
#include <QtCore/QDebug>
#include <QtCore/QMetaType>
QT_MODULE(Declarative)
-class ObserverProtocol : public QObject
+class InspectorProtocol : public QObject
{
Q_OBJECT
Q_ENUMS(Message Tool)
}
};
-inline QDataStream & operator<< (QDataStream &stream, ObserverProtocol::Message message)
+inline QDataStream & operator<< (QDataStream &stream, InspectorProtocol::Message message)
{
return stream << static_cast<quint32>(message);
}
-inline QDataStream & operator>> (QDataStream &stream, ObserverProtocol::Message &message)
+inline QDataStream & operator>> (QDataStream &stream, InspectorProtocol::Message &message)
{
quint32 i;
stream >> i;
- message = static_cast<ObserverProtocol::Message>(i);
+ message = static_cast<InspectorProtocol::Message>(i);
return stream;
}
-inline QDebug operator<< (QDebug dbg, ObserverProtocol::Message message)
+inline QDebug operator<< (QDebug dbg, InspectorProtocol::Message message)
{
- dbg << ObserverProtocol::toString(message);
+ dbg << InspectorProtocol::toString(message);
return dbg;
}
-inline QDataStream & operator<< (QDataStream &stream, ObserverProtocol::Tool tool)
+inline QDataStream & operator<< (QDataStream &stream, InspectorProtocol::Tool tool)
{
return stream << static_cast<quint32>(tool);
}
-inline QDataStream & operator>> (QDataStream &stream, ObserverProtocol::Tool &tool)
+inline QDataStream & operator>> (QDataStream &stream, InspectorProtocol::Tool &tool)
{
quint32 i;
stream >> i;
- tool = static_cast<ObserverProtocol::Tool>(i);
+ tool = static_cast<InspectorProtocol::Tool>(i);
return stream;
}
-inline QDebug operator<< (QDebug dbg, ObserverProtocol::Tool tool)
+inline QDebug operator<< (QDebug dbg, InspectorProtocol::Tool tool)
{
- dbg << ObserverProtocol::toString(tool);
+ dbg << InspectorProtocol::toString(tool);
return dbg;
}
QT_END_HEADER
-#endif // QDECLARATIVEOBSERVERPROTOCOL_H
+#endif // QDECLARATIVEINSPECTORPROTOCOL_H
**
****************************************************************************/
-#include "QtDeclarative/private/qdeclarativeobserverservice_p.h"
+#include "QtDeclarative/private/qdeclarativeinspectorservice_p.h"
#include "QtDeclarative/private/qdeclarativedebughelper_p.h"
-#include "qdeclarativeviewobserver_p.h"
-#include "qdeclarativeviewobserver_p_p.h"
-#include "qdeclarativeobserverprotocol.h"
+#include "qdeclarativeviewinspector_p.h"
+#include "qdeclarativeviewinspector_p_p.h"
+#include "qdeclarativeinspectorprotocol.h"
#include "editor/liveselectiontool_p.h"
#include "editor/zoomtool_p.h"
ToolBox::ToolBox(QWidget *parent)
: QWidget(parent, Qt::Tool)
- , m_settings(QLatin1String("Nokia"), QLatin1String("QmlObserver"), this)
+ , m_settings(QLatin1String("Nokia"), QLatin1String("QmlInspector"), this)
, m_toolBar(new QmlToolBar)
{
setWindowFlags((windowFlags() & ~Qt::WindowCloseButtonHint) | Qt::CustomizeWindowHint);
}
-QDeclarativeViewObserverPrivate::QDeclarativeViewObserverPrivate(QDeclarativeViewObserver *q) :
+QDeclarativeViewInspectorPrivate::QDeclarativeViewInspectorPrivate(QDeclarativeViewInspector *q) :
q(q),
designModeBehavior(false),
showAppOnTop(false),
{
}
-QDeclarativeViewObserverPrivate::~QDeclarativeViewObserverPrivate()
+QDeclarativeViewInspectorPrivate::~QDeclarativeViewInspectorPrivate()
{
}
-QDeclarativeViewObserver::QDeclarativeViewObserver(QDeclarativeView *view,
+QDeclarativeViewInspector::QDeclarativeViewInspector(QDeclarativeView *view,
QObject *parent) :
QObject(parent),
- data(new QDeclarativeViewObserverPrivate(this))
+ data(new QDeclarativeViewInspectorPrivate(this))
{
initEditorResource();
data->setViewport(data->view->viewport());
- data->debugService = QDeclarativeObserverService::instance();
+ data->debugService = QDeclarativeInspectorService::instance();
connect(data->debugService, SIGNAL(gotMessage(QByteArray)),
this, SLOT(handleMessage(QByteArray)));
data->_q_changeToSingleSelectTool();
}
-QDeclarativeViewObserver::~QDeclarativeViewObserver()
+QDeclarativeViewInspector::~QDeclarativeViewInspector()
{
}
-void QDeclarativeViewObserverPrivate::_q_setToolBoxVisible(bool visible)
+void QDeclarativeViewInspectorPrivate::_q_setToolBoxVisible(bool visible)
{
#if !defined(Q_OS_SYMBIAN) && !defined(Q_WS_MAEMO_5) && !defined(Q_WS_SIMULATOR)
if (!toolBox && visible)
#endif
}
-void QDeclarativeViewObserverPrivate::_q_reloadView()
+void QDeclarativeViewInspectorPrivate::_q_reloadView()
{
clearHighlight();
emit q->reloadRequested();
}
-void QDeclarativeViewObserverPrivate::setViewport(QWidget *widget)
+void QDeclarativeViewInspectorPrivate::setViewport(QWidget *widget)
{
if (viewport.data() == widget)
return;
}
}
-void QDeclarativeViewObserverPrivate::clearEditorItems()
+void QDeclarativeViewInspectorPrivate::clearEditorItems()
{
clearHighlight();
setSelectedItems(QList<QGraphicsItem*>());
}
-bool QDeclarativeViewObserver::eventFilter(QObject *obj, QEvent *event)
+bool QDeclarativeViewInspector::eventFilter(QObject *obj, QEvent *event)
{
if (obj == data->view) {
// Event from view
return QObject::eventFilter(obj, event);
}
-bool QDeclarativeViewObserver::leaveEvent(QEvent * /*event*/)
+bool QDeclarativeViewInspector::leaveEvent(QEvent * /*event*/)
{
if (!data->designModeBehavior)
return false;
return true;
}
-bool QDeclarativeViewObserver::mousePressEvent(QMouseEvent *event)
+bool QDeclarativeViewInspector::mousePressEvent(QMouseEvent *event)
{
if (!data->designModeBehavior)
return false;
return true;
}
-bool QDeclarativeViewObserver::mouseMoveEvent(QMouseEvent *event)
+bool QDeclarativeViewInspector::mouseMoveEvent(QMouseEvent *event)
{
if (!data->designModeBehavior) {
data->clearEditorItems();
return true;
}
-bool QDeclarativeViewObserver::mouseReleaseEvent(QMouseEvent *event)
+bool QDeclarativeViewInspector::mouseReleaseEvent(QMouseEvent *event)
{
if (!data->designModeBehavior)
return false;
return true;
}
-bool QDeclarativeViewObserver::keyPressEvent(QKeyEvent *event)
+bool QDeclarativeViewInspector::keyPressEvent(QKeyEvent *event)
{
if (!data->designModeBehavior)
return false;
return true;
}
-bool QDeclarativeViewObserver::keyReleaseEvent(QKeyEvent *event)
+bool QDeclarativeViewInspector::keyReleaseEvent(QKeyEvent *event)
{
if (!data->designModeBehavior)
return false;
return true;
}
-void QDeclarativeViewObserverPrivate::_q_createQmlObject(const QString &qml, QObject *parent,
+void QDeclarativeViewInspectorPrivate::_q_createQmlObject(const QString &qml, QObject *parent,
const QStringList &importList,
const QString &filename)
{
}
}
-void QDeclarativeViewObserverPrivate::_q_reparentQmlObject(QObject *object, QObject *newParent)
+void QDeclarativeViewInspectorPrivate::_q_reparentQmlObject(QObject *object, QObject *newParent)
{
if (!newParent)
return;
item->setParentItem(newParentItem);
}
-void QDeclarativeViewObserverPrivate::_q_clearComponentCache()
+void QDeclarativeViewInspectorPrivate::_q_clearComponentCache()
{
view->engine()->clearComponentCache();
}
-void QDeclarativeViewObserverPrivate::_q_removeFromSelection(QObject *obj)
+void QDeclarativeViewInspectorPrivate::_q_removeFromSelection(QObject *obj)
{
QList<QGraphicsItem*> items = selectedItems();
if (QGraphicsItem *item = qobject_cast<QGraphicsObject*>(obj))
setSelectedItems(items);
}
-bool QDeclarativeViewObserver::mouseDoubleClickEvent(QMouseEvent * /*event*/)
+bool QDeclarativeViewInspector::mouseDoubleClickEvent(QMouseEvent * /*event*/)
{
if (!data->designModeBehavior)
return false;
return true;
}
-bool QDeclarativeViewObserver::wheelEvent(QWheelEvent *event)
+bool QDeclarativeViewInspector::wheelEvent(QWheelEvent *event)
{
if (!data->designModeBehavior)
return false;
return true;
}
-void QDeclarativeViewObserver::setDesignModeBehavior(bool value)
+void QDeclarativeViewInspector::setDesignModeBehavior(bool value)
{
emit designModeBehaviorChanged(value);
data->clearEditorItems();
}
-bool QDeclarativeViewObserver::designModeBehavior()
+bool QDeclarativeViewInspector::designModeBehavior()
{
return data->designModeBehavior;
}
-bool QDeclarativeViewObserver::showAppOnTop() const
+bool QDeclarativeViewInspector::showAppOnTop() const
{
return data->showAppOnTop;
}
-void QDeclarativeViewObserver::setShowAppOnTop(bool appOnTop)
+void QDeclarativeViewInspector::setShowAppOnTop(bool appOnTop)
{
if (data->view) {
QWidget *window = data->view->window();
emit showAppOnTopChanged(appOnTop);
}
-void QDeclarativeViewObserverPrivate::changeTool(Constants::DesignTool tool,
+void QDeclarativeViewInspectorPrivate::changeTool(Constants::DesignTool tool,
Constants::ToolFlags /*flags*/)
{
switch (tool) {
}
}
-void QDeclarativeViewObserverPrivate::setSelectedItemsForTools(const QList<QGraphicsItem *> &items)
+void QDeclarativeViewInspectorPrivate::setSelectedItemsForTools(const QList<QGraphicsItem *> &items)
{
foreach (const QWeakPointer<QGraphicsObject> &obj, currentSelection) {
if (QGraphicsItem *item = obj.data()) {
currentTool->updateSelectedItems();
}
-void QDeclarativeViewObserverPrivate::setSelectedItems(const QList<QGraphicsItem *> &items)
+void QDeclarativeViewInspectorPrivate::setSelectedItems(const QList<QGraphicsItem *> &items)
{
QList<QWeakPointer<QGraphicsObject> > oldList = currentSelection;
setSelectedItemsForTools(items);
}
}
-QList<QGraphicsItem *> QDeclarativeViewObserverPrivate::selectedItems() const
+QList<QGraphicsItem *> QDeclarativeViewInspectorPrivate::selectedItems() const
{
QList<QGraphicsItem *> selection;
foreach (const QWeakPointer<QGraphicsObject> &selectedObject, currentSelection) {
return selection;
}
-void QDeclarativeViewObserver::setSelectedItems(QList<QGraphicsItem *> items)
+void QDeclarativeViewInspector::setSelectedItems(QList<QGraphicsItem *> items)
{
data->setSelectedItems(items);
}
-QList<QGraphicsItem *> QDeclarativeViewObserver::selectedItems() const
+QList<QGraphicsItem *> QDeclarativeViewInspector::selectedItems() const
{
return data->selectedItems();
}
-QDeclarativeView *QDeclarativeViewObserver::declarativeView()
+QDeclarativeView *QDeclarativeViewInspector::declarativeView()
{
return data->view;
}
-void QDeclarativeViewObserverPrivate::clearHighlight()
+void QDeclarativeViewInspectorPrivate::clearHighlight()
{
boundingRectHighlighter->clear();
}
-void QDeclarativeViewObserverPrivate::highlight(const QList<QGraphicsObject *> &items)
+void QDeclarativeViewInspectorPrivate::highlight(const QList<QGraphicsObject *> &items)
{
if (items.isEmpty())
return;
boundingRectHighlighter->highlight(objectList);
}
-QList<QGraphicsItem*> QDeclarativeViewObserverPrivate::selectableItems(
+QList<QGraphicsItem*> QDeclarativeViewInspectorPrivate::selectableItems(
const QPointF &scenePos) const
{
QList<QGraphicsItem*> itemlist = view->scene()->items(scenePos);
return filterForSelection(itemlist);
}
-QList<QGraphicsItem*> QDeclarativeViewObserverPrivate::selectableItems(const QPoint &pos) const
+QList<QGraphicsItem*> QDeclarativeViewInspectorPrivate::selectableItems(const QPoint &pos) const
{
QList<QGraphicsItem*> itemlist = view->items(pos);
return filterForSelection(itemlist);
}
-QList<QGraphicsItem*> QDeclarativeViewObserverPrivate::selectableItems(
+QList<QGraphicsItem*> QDeclarativeViewInspectorPrivate::selectableItems(
const QRectF &sceneRect, Qt::ItemSelectionMode selectionMode) const
{
QList<QGraphicsItem*> itemlist = view->scene()->items(sceneRect, selectionMode);
return filterForSelection(itemlist);
}
-void QDeclarativeViewObserverPrivate::_q_changeToSingleSelectTool()
+void QDeclarativeViewInspectorPrivate::_q_changeToSingleSelectTool()
{
currentToolMode = Constants::SelectionToolMode;
selectionTool->setRubberbandSelectionMode(false);
q->sendCurrentTool(Constants::SelectionToolMode);
}
-void QDeclarativeViewObserverPrivate::changeToSelectTool()
+void QDeclarativeViewInspectorPrivate::changeToSelectTool()
{
if (currentTool == selectionTool)
return;
currentTool->updateSelectedItems();
}
-void QDeclarativeViewObserverPrivate::_q_changeToMarqueeSelectTool()
+void QDeclarativeViewInspectorPrivate::_q_changeToMarqueeSelectTool()
{
changeToSelectTool();
currentToolMode = Constants::MarqueeSelectionToolMode;
q->sendCurrentTool(Constants::MarqueeSelectionToolMode);
}
-void QDeclarativeViewObserverPrivate::_q_changeToZoomTool()
+void QDeclarativeViewInspectorPrivate::_q_changeToZoomTool()
{
currentToolMode = Constants::ZoomMode;
currentTool->clear();
q->sendCurrentTool(Constants::ZoomMode);
}
-void QDeclarativeViewObserverPrivate::_q_changeToColorPickerTool()
+void QDeclarativeViewInspectorPrivate::_q_changeToColorPickerTool()
{
if (currentTool == colorPickerTool)
return;
q->sendCurrentTool(Constants::ColorPickerMode);
}
-void QDeclarativeViewObserver::setAnimationSpeed(qreal slowDownFactor)
+void QDeclarativeViewInspector::setAnimationSpeed(qreal slowDownFactor)
{
Q_ASSERT(slowDownFactor > 0);
if (data->slowDownFactor == slowDownFactor)
sendAnimationSpeed(slowDownFactor);
}
-void QDeclarativeViewObserver::setAnimationPaused(bool paused)
+void QDeclarativeViewInspector::setAnimationPaused(bool paused)
{
if (data->animationPaused == paused)
return;
sendAnimationPaused(paused);
}
-void QDeclarativeViewObserver::animationSpeedChangeRequested(qreal factor)
+void QDeclarativeViewInspector::animationSpeedChangeRequested(qreal factor)
{
if (data->slowDownFactor != factor) {
data->slowDownFactor = factor;
QDeclarativeDebugHelper::setAnimationSlowDownFactor(effectiveFactor);
}
-void QDeclarativeViewObserver::animationPausedChangeRequested(bool paused)
+void QDeclarativeViewInspector::animationPausedChangeRequested(bool paused)
{
if (data->animationPaused != paused) {
data->animationPaused = paused;
}
-void QDeclarativeViewObserverPrivate::_q_applyChangesFromClient()
+void QDeclarativeViewInspectorPrivate::_q_applyChangesFromClient()
{
}
-QList<QGraphicsItem*> QDeclarativeViewObserverPrivate::filterForSelection(
+QList<QGraphicsItem*> QDeclarativeViewInspectorPrivate::filterForSelection(
QList<QGraphicsItem*> &itemlist) const
{
foreach (QGraphicsItem *item, itemlist) {
return itemlist;
}
-bool QDeclarativeViewObserverPrivate::isEditorItem(QGraphicsItem *item) const
+bool QDeclarativeViewInspectorPrivate::isEditorItem(QGraphicsItem *item) const
{
return (item->type() == Constants::EditorItemType
|| item->type() == Constants::ResizeHandleItemType
|| item->data(Constants::EditorItemDataKey).toBool());
}
-void QDeclarativeViewObserverPrivate::_q_onStatusChanged(QDeclarativeView::Status status)
+void QDeclarativeViewInspectorPrivate::_q_onStatusChanged(QDeclarativeView::Status status)
{
if (status == QDeclarativeView::Ready)
q->sendReloaded();
}
-void QDeclarativeViewObserverPrivate::_q_onCurrentObjectsChanged(QList<QObject*> objects)
+void QDeclarativeViewInspectorPrivate::_q_onCurrentObjectsChanged(QList<QObject*> objects)
{
QList<QGraphicsItem*> items;
QList<QGraphicsObject*> gfxObjects;
}
// adjusts bounding boxes on edges of screen to be visible
-QRectF QDeclarativeViewObserver::adjustToScreenBoundaries(const QRectF &boundingRectInSceneSpace)
+QRectF QDeclarativeViewInspector::adjustToScreenBoundaries(const QRectF &boundingRectInSceneSpace)
{
int marginFromEdge = 1;
QRectF boundingRect(boundingRectInSceneSpace);
return boundingRect;
}
-void QDeclarativeViewObserverPrivate::createToolBox()
+void QDeclarativeViewInspectorPrivate::createToolBox()
{
toolBox = new ToolBox(q->declarativeView());
toolBar, SLOT(activateMarqueeSelectTool()));
}
-void QDeclarativeViewObserver::handleMessage(const QByteArray &message)
+void QDeclarativeViewInspector::handleMessage(const QByteArray &message)
{
QDataStream ds(message);
- ObserverProtocol::Message type;
+ InspectorProtocol::Message type;
ds >> type;
switch (type) {
- case ObserverProtocol::SetCurrentObjects: {
+ case InspectorProtocol::SetCurrentObjects: {
int itemCount = 0;
ds >> itemCount;
data->_q_onCurrentObjectsChanged(selectedObjects);
break;
}
- case ObserverProtocol::Reload: {
+ case InspectorProtocol::Reload: {
data->_q_reloadView();
break;
}
- case ObserverProtocol::SetAnimationSpeed: {
+ case InspectorProtocol::SetAnimationSpeed: {
qreal speed;
ds >> speed;
animationSpeedChangeRequested(speed);
break;
}
- case ObserverProtocol::SetAnimationPaused: {
+ case InspectorProtocol::SetAnimationPaused: {
bool paused;
ds >> paused;
animationPausedChangeRequested(paused);
break;
}
- case ObserverProtocol::ChangeTool: {
- ObserverProtocol::Tool tool;
+ case InspectorProtocol::ChangeTool: {
+ InspectorProtocol::Tool tool;
ds >> tool;
switch (tool) {
- case ObserverProtocol::ColorPickerTool:
+ case InspectorProtocol::ColorPickerTool:
data->_q_changeToColorPickerTool();
break;
- case ObserverProtocol::SelectTool:
+ case InspectorProtocol::SelectTool:
data->_q_changeToSingleSelectTool();
break;
- case ObserverProtocol::SelectMarqueeTool:
+ case InspectorProtocol::SelectMarqueeTool:
data->_q_changeToMarqueeSelectTool();
break;
- case ObserverProtocol::ZoomTool:
+ case InspectorProtocol::ZoomTool:
data->_q_changeToZoomTool();
break;
default:
}
break;
}
- case ObserverProtocol::SetDesignMode: {
+ case InspectorProtocol::SetDesignMode: {
bool inDesignMode;
ds >> inDesignMode;
setDesignModeBehavior(inDesignMode);
break;
}
- case ObserverProtocol::ShowAppOnTop: {
+ case InspectorProtocol::ShowAppOnTop: {
bool showOnTop;
ds >> showOnTop;
setShowAppOnTop(showOnTop);
break;
}
- case ObserverProtocol::CreateObject: {
+ case InspectorProtocol::CreateObject: {
QString qml;
int parentId;
QString filename;
imports, filename);
break;
}
- case ObserverProtocol::DestroyObject: {
+ case InspectorProtocol::DestroyObject: {
int debugId;
ds >> debugId;
if (QObject* obj = QDeclarativeDebugService::objectForId(debugId))
obj->deleteLater();
break;
}
- case ObserverProtocol::MoveObject: {
+ case InspectorProtocol::MoveObject: {
int debugId, newParent;
ds >> debugId >> newParent;
data->_q_reparentQmlObject(QDeclarativeDebugService::objectForId(debugId),
QDeclarativeDebugService::objectForId(newParent));
break;
}
- case ObserverProtocol::ObjectIdList: {
+ case InspectorProtocol::ObjectIdList: {
int itemCount;
ds >> itemCount;
data->stringIdForObjectId.clear();
}
break;
}
- case ObserverProtocol::ClearComponentCache: {
+ case InspectorProtocol::ClearComponentCache: {
data->_q_clearComponentCache();
break;
}
}
}
-void QDeclarativeViewObserver::sendDesignModeBehavior(bool inDesignMode)
+void QDeclarativeViewInspector::sendDesignModeBehavior(bool inDesignMode)
{
QByteArray message;
QDataStream ds(&message, QIODevice::WriteOnly);
- ds << ObserverProtocol::SetDesignMode
+ ds << InspectorProtocol::SetDesignMode
<< inDesignMode;
data->debugService->sendMessage(message);
}
-void QDeclarativeViewObserver::sendCurrentObjects(const QList<QObject*> &objects)
+void QDeclarativeViewInspector::sendCurrentObjects(const QList<QObject*> &objects)
{
QByteArray message;
QDataStream ds(&message, QIODevice::WriteOnly);
- ds << ObserverProtocol::CurrentObjectsChanged
+ ds << InspectorProtocol::CurrentObjectsChanged
<< objects.length();
foreach (QObject *object, objects) {
data->debugService->sendMessage(message);
}
-void QDeclarativeViewObserver::sendCurrentTool(Constants::DesignTool toolId)
+void QDeclarativeViewInspector::sendCurrentTool(Constants::DesignTool toolId)
{
QByteArray message;
QDataStream ds(&message, QIODevice::WriteOnly);
- ds << ObserverProtocol::ToolChanged
+ ds << InspectorProtocol::ToolChanged
<< toolId;
data->debugService->sendMessage(message);
}
-void QDeclarativeViewObserver::sendAnimationSpeed(qreal slowDownFactor)
+void QDeclarativeViewInspector::sendAnimationSpeed(qreal slowDownFactor)
{
QByteArray message;
QDataStream ds(&message, QIODevice::WriteOnly);
- ds << ObserverProtocol::AnimationSpeedChanged
+ ds << InspectorProtocol::AnimationSpeedChanged
<< slowDownFactor;
data->debugService->sendMessage(message);
}
-void QDeclarativeViewObserver::sendAnimationPaused(bool paused)
+void QDeclarativeViewInspector::sendAnimationPaused(bool paused)
{
QByteArray message;
QDataStream ds(&message, QIODevice::WriteOnly);
- ds << ObserverProtocol::AnimationPausedChanged
+ ds << InspectorProtocol::AnimationPausedChanged
<< paused;
data->debugService->sendMessage(message);
}
-void QDeclarativeViewObserver::sendReloaded()
+void QDeclarativeViewInspector::sendReloaded()
{
QByteArray message;
QDataStream ds(&message, QIODevice::WriteOnly);
- ds << ObserverProtocol::Reloaded;
+ ds << InspectorProtocol::Reloaded;
data->debugService->sendMessage(message);
}
-void QDeclarativeViewObserver::sendShowAppOnTop(bool showAppOnTop)
+void QDeclarativeViewInspector::sendShowAppOnTop(bool showAppOnTop)
{
QByteArray message;
QDataStream ds(&message, QIODevice::WriteOnly);
- ds << ObserverProtocol::ShowAppOnTop << showAppOnTop;
+ ds << InspectorProtocol::ShowAppOnTop << showAppOnTop;
data->debugService->sendMessage(message);
}
-void QDeclarativeViewObserver::sendColorChanged(const QColor &color)
+void QDeclarativeViewInspector::sendColorChanged(const QColor &color)
{
QByteArray message;
QDataStream ds(&message, QIODevice::WriteOnly);
- ds << ObserverProtocol::ColorChanged
+ ds << InspectorProtocol::ColorChanged
<< color;
data->debugService->sendMessage(message);
}
-QString QDeclarativeViewObserver::idStringForObject(QObject *obj) const
+QString QDeclarativeViewInspector::idStringForObject(QObject *obj) const
{
int id = QDeclarativeDebugService::idForObject(obj);
QString idString = data->stringIdForObjectId.value(id, QString());
QT_END_NAMESPACE
-#include "qdeclarativeviewobserver.moc"
+#include "qdeclarativeviewinspector.moc"
**
****************************************************************************/
-#ifndef QDECLARATIVEVIEWOBSERVER_P_H
-#define QDECLARATIVEVIEWOBSERVER_P_H
+#ifndef QDECLARATIVEVIEWINSPECTOR_P_H
+#define QDECLARATIVEVIEWINSPECTOR_P_H
#include <private/qdeclarativeglobal_p.h>
-#include "qmlobserverconstants_p.h"
+#include "qmlinspectorconstants_p.h"
#include <QtCore/QScopedPointer>
#include <QtDeclarative/QDeclarativeView>
QT_MODULE(Declarative)
-class QDeclarativeViewObserverPrivate;
+class QDeclarativeViewInspectorPrivate;
-class QDeclarativeViewObserver : public QObject
+class QDeclarativeViewInspector : public QObject
{
Q_OBJECT
public:
- explicit QDeclarativeViewObserver(QDeclarativeView *view, QObject *parent = 0);
- ~QDeclarativeViewObserver();
+ explicit QDeclarativeViewInspector(QDeclarativeView *view, QObject *parent = 0);
+ ~QDeclarativeViewInspector();
void setSelectedItems(QList<QGraphicsItem *> items);
QList<QGraphicsItem *> selectedItems() const;
void animationPausedChangeRequested(bool paused);
private:
- Q_DISABLE_COPY(QDeclarativeViewObserver)
+ Q_DISABLE_COPY(QDeclarativeViewInspector)
- inline QDeclarativeViewObserverPrivate *d_func() { return data.data(); }
- QScopedPointer<QDeclarativeViewObserverPrivate> data;
- friend class QDeclarativeViewObserverPrivate;
+ inline QDeclarativeViewInspectorPrivate *d_func() { return data.data(); }
+ QScopedPointer<QDeclarativeViewInspectorPrivate> data;
+ friend class QDeclarativeViewInspectorPrivate;
friend class AbstractLiveEditTool;
};
QT_END_HEADER
-#endif // QDECLARATIVEVIEWOBSERVER_P_H
+#endif // QDECLARATIVEVIEWINSPECTOR_P_H
**
****************************************************************************/
-#ifndef QDECLARATIVEVIEWOBSERVER_P_P_H
-#define QDECLARATIVEVIEWOBSERVER_P_P_H
+#ifndef QDECLARATIVEVIEWINSPECTOR_P_P_H
+#define QDECLARATIVEVIEWINSPECTOR_P_P_H
-#include "qdeclarativeviewobserver_p.h"
+#include "qdeclarativeviewinspector_p.h"
#include <QtCore/QWeakPointer>
#include <QtCore/QPointF>
-#include "QtDeclarative/private/qdeclarativeobserverservice_p.h"
+#include "QtDeclarative/private/qdeclarativeinspectorservice_p.h"
QT_BEGIN_HEADER
QT_MODULE(Declarative)
-class QDeclarativeViewObserver;
+class QDeclarativeViewInspector;
class LiveSelectionTool;
class ZoomTool;
class ColorPickerTool;
class ToolBox;
class AbstractLiveEditTool;
-class QDeclarativeViewObserverPrivate : public QObject
+class QDeclarativeViewInspectorPrivate : public QObject
{
Q_OBJECT
public:
- QDeclarativeViewObserverPrivate(QDeclarativeViewObserver *);
- ~QDeclarativeViewObserverPrivate();
+ QDeclarativeViewInspectorPrivate(QDeclarativeViewInspector *);
+ ~QDeclarativeViewInspectorPrivate();
QDeclarativeView *view;
- QDeclarativeViewObserver *q;
- QDeclarativeObserverService *debugService;
+ QDeclarativeViewInspector *q;
+ QDeclarativeInspectorService *debugService;
QWeakPointer<QWidget> viewport;
QHash<int, QString> stringIdForObjectId;
void _q_removeFromSelection(QObject *);
public:
- static QDeclarativeViewObserverPrivate *get(QDeclarativeViewObserver *v) { return v->d_func(); }
+ static QDeclarativeViewInspectorPrivate *get(QDeclarativeViewInspector *v) { return v->d_func(); }
};
QT_END_NAMESPACE
QT_END_HEADER
-#endif // QDECLARATIVEVIEWOBSERVER_P_P_H
+#endif // QDECLARATIVEVIEWINSPECTOR_P_P_H
load(qt_module)
-TARGET = declarativeobserver
+TARGET = qmldbg_inspector
QT += declarative-private
include($$QT_SOURCE_TREE/src/plugins/qpluginbase.pri)
QTDIR_build:REQUIRES += "contains(QT_CONFIG, declarative)"
SOURCES += \
- qdeclarativeobserverplugin.cpp \
- qdeclarativeviewobserver.cpp \
+ qdeclarativeinspectorplugin.cpp \
+ qdeclarativeviewinspector.cpp \
editor/abstractliveedittool.cpp \
editor/liveselectiontool.cpp \
editor/livelayeritem.cpp \
editor/toolbarcolorbox.cpp
HEADERS += \
- qdeclarativeobserverplugin.h \
- qdeclarativeobserverprotocol.h \
- qdeclarativeviewobserver_p.h \
- qdeclarativeviewobserver_p_p.h \
- qmlobserverconstants_p.h \
+ qdeclarativeinspectorplugin.h \
+ qdeclarativeinspectorprotocol.h \
+ qdeclarativeviewinspector_p.h \
+ qdeclarativeviewinspector_p_p.h \
+ qmlinspectorconstants_p.h \
editor/abstractliveedittool_p.h \
editor/liveselectiontool_p.h \
editor/livelayeritem_p.h \
**
****************************************************************************/
-#ifndef QMLOBSERVERCONSTANTS_H
-#define QMLOBSERVERCONSTANTS_H
+#ifndef QMLINSPECTORCONSTANTS_H
+#define QMLINSPECTORCONSTANTS_H
#include <QtDeclarative/private/qdeclarativeglobal_p.h>
QT_END_HEADER
-#endif // QMLOBSERVERCONSTANTS_H
+#endif // QMLINSPECTORCONSTANTS_H
TEMPLATE = subdirs
-SUBDIRS = qmldbg_tcp declarativeobserver
+SUBDIRS = qmldbg_tcp qmldbg_inspector
symbian:SUBDIRS += qmldbg_ost