#include "abstractviewinspector.h"
-#include "editor/qmltoolbar_p.h"
+#include "editor/qmltoolbar.h"
#include "qdeclarativeinspectorprotocol.h"
#include <QtDeclarative/QDeclarativeEngine>
static inline void initEditorResource() { Q_INIT_RESOURCE(editor); }
-QT_BEGIN_NAMESPACE
+namespace QmlJSDebugger {
const char * const KEY_TOOLBOX_GEOMETRY = "toolBox/geometry";
return m_stringIdForObjectId.value(id);
}
-QT_END_NAMESPACE
+} // namespace QmlJSDebugger
#include "abstractviewinspector.moc"
#include <QtGui/QColor>
#include "qdeclarativeinspectorprotocol.h"
-#include "qmlinspectorconstants_p.h"
+#include "qmlinspectorconstants.h"
QT_BEGIN_NAMESPACE
-
class QDeclarativeEngine;
class QDeclarativeInspectorService;
+QT_END_NAMESPACE
+
+namespace QmlJSDebugger {
+
class ToolBox;
/*
QDeclarativeInspectorService *m_debugService;
};
-QT_END_NAMESPACE
+} // namespace QmlJSDebugger
#endif // ABSTRACTVIEWINSPECTOR_H
**
****************************************************************************/
-#include "abstractliveedittool_p.h"
-#include "../qdeclarativeviewinspector_p_p.h"
+#include "abstractliveedittool.h"
+#include "../qdeclarativeviewinspector_p.h"
#include <QDeclarativeEngine>
#include <QGraphicsItem>
#include <QDeclarativeItem>
-QT_BEGIN_NAMESPACE
+namespace QmlJSDebugger {
AbstractLiveEditTool::AbstractLiveEditTool(QDeclarativeViewInspector *editorView)
: QObject(editorView), m_inspector(editorView)
return constructedName;
}
-QT_END_NAMESPACE
+
+} // namespace QmlJSDebugger
class QDeclarativeView;
QT_END_NAMESPACE
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Declarative)
+namespace QmlJSDebugger {
class QDeclarativeViewInspector;
QList<QGraphicsItem*> m_itemList;
};
-QT_END_NAMESPACE
-
-QT_END_HEADER
+}
#endif // ABSTRACTLIVEEDITTOOL_H
**
****************************************************************************/
-#include "boundingrecthighlighter_p.h"
+#include "boundingrecthighlighter.h"
-#include "../qdeclarativeviewinspector_p.h"
-#include "../qmlinspectorconstants_p.h"
+#include "../qdeclarativeviewinspector.h"
+#include "../qmlinspectorconstants.h"
#include <QtGui/QGraphicsPolygonItem>
#include <QtCore/QObject>
#include <QtCore/QDebug>
-QT_BEGIN_NAMESPACE
+namespace QmlJSDebugger {
BoundingBox::BoundingBox(QGraphicsObject *itemToHighlight, QGraphicsItem *parentItem,
QObject *parent)
highlightAll();
}
-QT_END_NAMESPACE
+
+} // namespace QmlJSDebugger
#ifndef BOUNDINGRECTHIGHLIGHTER_H
#define BOUNDINGRECTHIGHLIGHTER_H
-#include "livelayeritem_p.h"
+#include "livelayeritem.h"
#include <QtCore/QObject>
#include <QtCore/QWeakPointer>
QT_FORWARD_DECLARE_CLASS(QStyleOptionGraphicsItem)
QT_FORWARD_DECLARE_CLASS(QTimer)
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Declarative)
+namespace QmlJSDebugger {
class QDeclarativeViewInspector;
class BoundingBox;
int type() const;
};
-QT_END_NAMESPACE
-
-QT_END_HEADER
+} // namespace QmlJSDebugger
#endif // BOUNDINGRECTHIGHLIGHTER_H
**
****************************************************************************/
-#include "colorpickertool_p.h"
+#include "colorpickertool.h"
-#include "../qdeclarativeviewinspector_p.h"
+#include "../qdeclarativeviewinspector.h"
#include <QtGui/QMouseEvent>
#include <QtGui/QKeyEvent>
#include <QtGui/QApplication>
#include <QtGui/QPalette>
-QT_BEGIN_NAMESPACE
+namespace QmlJSDebugger {
ColorPickerTool::ColorPickerTool(QDeclarativeViewInspector *view) :
AbstractLiveEditTool(view)
emit selectedColorChanged(m_selectedColor);
}
-QT_END_NAMESPACE
+} // namespace QmlJSDebugger
#ifndef COLORPICKERTOOL_H
#define COLORPICKERTOOL_H
-#include "abstractliveedittool_p.h"
+#include "abstractliveedittool.h"
#include <QtGui/QColor>
QT_FORWARD_DECLARE_CLASS(QPoint)
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Declarative)
+namespace QmlJSDebugger {
class ColorPickerTool : public AbstractLiveEditTool
{
QColor m_selectedColor;
};
-QT_END_NAMESPACE
-
-QT_END_HEADER
+} // namespace QmlJSDebugger
#endif // COLORPICKERTOOL_H
**
****************************************************************************/
-#include "livelayeritem_p.h"
+#include "livelayeritem.h"
-#include "../qmlinspectorconstants_p.h"
+#include "../qmlinspectorconstants.h"
#include <QGraphicsScene>
-QT_BEGIN_NAMESPACE
+namespace QmlJSDebugger {
LiveLayerItem::LiveLayerItem(QGraphicsScene* scene)
: QGraphicsObject()
return itemList;
}
-QT_END_NAMESPACE
+} // namespace QmlJSDebugger
#include <QtGui/QGraphicsObject>
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Declarative)
+namespace QmlJSDebugger {
class LiveLayerItem : public QGraphicsObject
{
QList<QGraphicsItem*> findAllChildItems(const QGraphicsItem *item) const;
};
-QT_END_NAMESPACE
-
-QT_END_HEADER
+}
#endif // LIVELAYERITEM_H
**
****************************************************************************/
-#include "liverubberbandselectionmanipulator_p.h"
+#include "liverubberbandselectionmanipulator.h"
-#include "../qdeclarativeviewinspector_p_p.h"
+#include "../qdeclarativeviewinspector_p.h"
#include <QtGui/QGraphicsItem>
#include <QtCore/QDebug>
-QT_BEGIN_NAMESPACE
+namespace QmlJSDebugger {
LiveRubberBandSelectionManipulator::LiveRubberBandSelectionManipulator(QGraphicsObject *layerItem,
QDeclarativeViewInspector *editorView)
return m_isActive;
}
-QT_END_NAMESPACE
+} // namespace QmlJSDebugger
#ifndef RUBBERBANDSELECTIONMANIPULATOR_H
#define RUBBERBANDSELECTIONMANIPULATOR_H
-#include "liveselectionrectangle_p.h"
+#include "liveselectionrectangle.h"
#include <QtCore/QPointF>
QT_FORWARD_DECLARE_CLASS(QGraphicsItem)
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Declarative)
+namespace QmlJSDebugger {
class QDeclarativeViewInspector;
bool m_isActive;
};
-QT_END_NAMESPACE
-
-QT_END_HEADER
+}
#endif // RUBBERBANDSELECTIONMANIPULATOR_H
**
****************************************************************************/
-#include "liveselectionindicator_p.h"
+#include "liveselectionindicator.h"
-#include "../qdeclarativeviewinspector_p_p.h"
-#include "../qmlinspectorconstants_p.h"
+#include "../qdeclarativeviewinspector_p.h"
+#include "../qmlinspectorconstants.h"
#include <QtGui/QGraphicsRectItem>
#include <QtGui/QGraphicsObject>
#include <QtGui/QGraphicsScene>
#include <QtGui/QPen>
-QT_BEGIN_NAMESPACE
+namespace QmlJSDebugger {
LiveSelectionIndicator::LiveSelectionIndicator(QDeclarativeViewInspector *viewInspector,
QGraphicsObject *layerItem)
}
}
-QT_END_NAMESPACE
+} //namespace QmlJSDebugger
+
class QPolygonF;
QT_END_NAMESPACE
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Declarative)
+namespace QmlJSDebugger {
class QDeclarativeViewInspector;
QDeclarativeViewInspector *m_view;
};
-QT_END_NAMESPACE
-
-QT_END_HEADER
+}
#endif // LIVESELECTIONINDICATOR_H
**
****************************************************************************/
-#include "liveselectionrectangle_p.h"
+#include "liveselectionrectangle.h"
-#include "../qmlinspectorconstants_p.h"
+#include "../qmlinspectorconstants.h"
#include <QtGui/QPen>
#include <QtGui/QGraphicsRectItem>
#include <cmath>
-QT_BEGIN_NAMESPACE
+namespace QmlJSDebugger {
class SelectionRectShape : public QGraphicsRectItem
{
m_controlShape->setRect(rect);
}
-QT_END_NAMESPACE
+}
QT_FORWARD_DECLARE_CLASS(QPointF)
QT_FORWARD_DECLARE_CLASS(QRectF)
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Declarative)
+namespace QmlJSDebugger {
class LiveSelectionRectangle
{
QWeakPointer<QGraphicsObject> m_layerItem;
};
-QT_END_NAMESPACE
-
-QT_END_HEADER
+} // namespace QmlJSDebugger
#endif // LIVESELECTIONRECTANGLE_H
**
****************************************************************************/
-#include "liveselectiontool_p.h"
-#include "livelayeritem_p.h"
+#include "liveselectiontool.h"
+#include "livelayeritem.h"
-#include "../qdeclarativeviewinspector_p_p.h"
+#include "../qdeclarativeviewinspector_p.h"
#include <QtGui/QApplication>
#include <QtGui/QWheelEvent>
#include <QtCore/QDebug>
-QT_BEGIN_NAMESPACE
+namespace QmlJSDebugger {
LiveSelectionTool::LiveSelectionTool(QDeclarativeViewInspector *editorView) :
AbstractLiveEditTool(editorView),
m_singleSelectionManipulator.end(event->pos());
}
-QT_END_NAMESPACE
+} // namespace QmlJSDebugger
#ifndef LIVESELECTIONTOOL_H
#define LIVESELECTIONTOOL_H
-#include "abstractliveedittool_p.h"
-#include "liverubberbandselectionmanipulator_p.h"
-#include "livesingleselectionmanipulator_p.h"
-#include "liveselectionindicator_p.h"
+#include "abstractliveedittool.h"
+#include "liverubberbandselectionmanipulator.h"
+#include "livesingleselectionmanipulator.h"
+#include "liveselectionindicator.h"
#include <QtCore/QList>
#include <QtCore/QTime>
QT_FORWARD_DECLARE_CLASS(QKeyEvent)
QT_FORWARD_DECLARE_CLASS(QAction)
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Declarative)
+namespace QmlJSDebugger {
class LiveSelectionTool : public AbstractLiveEditTool
{
QList<QGraphicsItem*> m_contextMenuItemList;
};
-QT_END_NAMESPACE
-
-QT_END_HEADER
+} // namespace QmlJSDebugger
#endif // LIVESELECTIONTOOL_H
**
****************************************************************************/
-#include "livesingleselectionmanipulator_p.h"
+#include "livesingleselectionmanipulator.h"
-#include "../qdeclarativeviewinspector_p_p.h"
+#include "../qdeclarativeviewinspector_p.h"
#include <QtDebug>
-QT_BEGIN_NAMESPACE
+namespace QmlJSDebugger {
LiveSingleSelectionManipulator::LiveSingleSelectionManipulator(QDeclarativeViewInspector *editorView)
: m_editorView(editorView),
return m_beginPoint;
}
-QT_END_NAMESPACE
+} // namespace QmlJSDebugger
QT_FORWARD_DECLARE_CLASS(QGraphicsItem)
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Declarative)
+namespace QmlJSDebugger {
class QDeclarativeViewInspector;
bool m_isActive;
};
-QT_END_NAMESPACE
-
-QT_END_HEADER
+} // namespace QmlJSDebugger
#endif // LIVESINGLESELECTIONMANIPULATOR_H
**
****************************************************************************/
-#include "qmltoolbar_p.h"
-#include "toolbarcolorbox_p.h"
+#include "qmltoolbar.h"
+#include "toolbarcolorbox.h"
#include <QtGui/QLabel>
#include <QtGui/QIcon>
#include <QtCore/QDebug>
-QT_BEGIN_NAMESPACE
+namespace QmlJSDebugger {
QmlToolBar::QmlToolBar(QWidget *parent)
: QToolBar(parent)
emit applyChangesToQmlFileSelected();
}
-QT_END_NAMESPACE
+} // namespace QmlJSDebugger
#include <QtGui/QToolBar>
#include <QtGui/QIcon>
-#include "../qmlinspectorconstants_p.h"
+#include "../qmlinspectorconstants.h"
QT_FORWARD_DECLARE_CLASS(QActionGroup)
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Declarative)
+namespace QmlJSDebugger {
class ToolBarColorBox;
Ui *ui;
};
-QT_END_NAMESPACE
-
-QT_END_HEADER
+}
#endif // QMLTOOLBAR_H
**
****************************************************************************/
-#include "subcomponentmasklayeritem_p.h"
+#include "subcomponentmasklayeritem.h"
-#include "../qmlinspectorconstants_p.h"
-#include "../qdeclarativeviewinspector_p.h"
+#include "../qmlinspectorconstants.h"
+#include "../qdeclarativeviewinspector.h"
#include <QtGui/QPolygonF>
-QT_BEGIN_NAMESPACE
+namespace QmlJSDebugger {
SubcomponentMaskLayerItem::SubcomponentMaskLayerItem(QDeclarativeViewInspector *inspector,
QGraphicsItem *parentItem) :
return m_currentItem;
}
-QT_END_NAMESPACE
+} // namespace QmlJSDebugger
#include <QtGui/QGraphicsPolygonItem>
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Declarative)
+namespace QmlJSDebugger {
class QDeclarativeViewInspector;
QRectF m_itemPolyRect;
};
-QT_END_NAMESPACE
-
-QT_END_HEADER
+} // namespace QmlJSDebugger
#endif // SUBCOMPONENTMASKLAYERITEM_H
**
****************************************************************************/
-#include "toolbarcolorbox_p.h"
+#include "toolbarcolorbox.h"
-#include "../qmlinspectorconstants_p.h"
+#include "../qmlinspectorconstants.h"
#include <QtGui/QPixmap>
#include <QtGui/QPainter>
#include <QtCore/QMimeData>
#include <QtCore/QDebug>
-QT_BEGIN_NAMESPACE
+namespace QmlJSDebugger {
ToolBarColorBox::ToolBarColorBox(QWidget *parent) :
QLabel(parent)
clipboard->setText(m_color.name());
}
-QT_END_NAMESPACE
+} // namespace QmlJSDebugger
QT_FORWARD_DECLARE_CLASS(QContextMenuEvent)
QT_FORWARD_DECLARE_CLASS(QAction)
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Declarative)
+namespace QmlJSDebugger {
class ToolBarColorBox : public QLabel
{
QColor m_color;
};
-QT_END_NAMESPACE
-
-QT_END_HEADER
+} // namespace QmlJSDebugger
#endif // TOOLBARCOLORBOX_H
**
****************************************************************************/
-#include "zoomtool_p.h"
+#include "zoomtool.h"
-#include "../qdeclarativeviewinspector_p_p.h"
+#include "../qdeclarativeviewinspector_p.h"
#include <QtGui/QMouseEvent>
#include <QtGui/QWheelEvent>
#include <QtCore/QRectF>
#include <QtCore/QDebug>
-QT_BEGIN_NAMESPACE
+namespace QmlJSDebugger {
ZoomTool::ZoomTool(QDeclarativeViewInspector *view) :
AbstractLiveEditTool(view),
return 1.0f;
}
-QT_END_NAMESPACE
+} // namespace QmlJSDebugger
#ifndef ZOOMTOOL_H
#define ZOOMTOOL_H
-#include "abstractliveedittool_p.h"
-#include "liverubberbandselectionmanipulator_p.h"
+#include "abstractliveedittool.h"
+#include "liverubberbandselectionmanipulator.h"
QT_FORWARD_DECLARE_CLASS(QAction)
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Declarative)
+namespace QmlJSDebugger {
class ZoomTool : public AbstractLiveEditTool
{
qreal m_currentScale;
};
-QT_END_NAMESPACE
-
-QT_END_HEADER
+} // namespace QmlJSDebugger
#endif // ZOOMTOOL_H
#include <QtDeclarative/private/qdeclarativeinspectorservice_p.h>
#include <QtDeclarative/QSGView>
-QT_BEGIN_NAMESPACE
+namespace QmlJSDebugger {
QDeclarativeInspectorPlugin::QDeclarativeInspectorPlugin() :
m_inspector(0)
delete m_inspector;
}
-Q_EXPORT_PLUGIN2(declarativeinspector, QDeclarativeInspectorPlugin)
+} // namespace QmlJSDebugger
-QT_END_NAMESPACE
+Q_EXPORT_PLUGIN2(declarativeinspector, QmlJSDebugger::QDeclarativeInspectorPlugin)
#include <QtCore/QPointer>
#include <QtDeclarative/private/qdeclarativeinspectorinterface_p.h>
-QT_BEGIN_NAMESPACE
+namespace QmlJSDebugger {
class AbstractViewInspector;
QPointer<AbstractViewInspector> m_inspector;
};
-QT_END_NAMESPACE
+} // namespace QmlJSDebugger
#endif // QDECLARATIVEINSPECTORPLUGIN_H
#include <QtCore/QMetaEnum>
#include <QtCore/QObject>
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Declarative)
+namespace QmlJSDebugger {
class InspectorProtocol : public QObject
{
return dbg;
}
-QT_END_NAMESPACE
-
-QT_END_HEADER
+} // namespace QmlJSDebugger
#endif // QDECLARATIVEINSPECTORPROTOCOL_H
**
****************************************************************************/
+#include "qdeclarativeviewinspector.h"
#include "qdeclarativeviewinspector_p.h"
-#include "qdeclarativeviewinspector_p_p.h"
-#include "editor/liveselectiontool_p.h"
-#include "editor/zoomtool_p.h"
-#include "editor/colorpickertool_p.h"
-#include "editor/livelayeritem_p.h"
-#include "editor/boundingrecthighlighter_p.h"
+#include "editor/liveselectiontool.h"
+#include "editor/zoomtool.h"
+#include "editor/colorpickertool.h"
+#include "editor/livelayeritem.h"
+#include "editor/boundingrecthighlighter.h"
#include <QtDeclarative/QDeclarativeItem>
#include <QtDeclarative/QDeclarativeEngine>
#include <QtGui/QGraphicsObject>
#include <QtGui/QApplication>
-QT_BEGIN_NAMESPACE
+namespace QmlJSDebugger {
QDeclarativeViewInspectorPrivate::QDeclarativeViewInspectorPrivate(QDeclarativeViewInspector *q) :
q(q)
return boundingRect;
}
-QT_END_NAMESPACE
+} // namespace QmlJSDebugger
--- /dev/null
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVEVIEWINSPECTOR_H
+#define QDECLARATIVEVIEWINSPECTOR_H
+
+#include <private/qdeclarativeglobal_p.h>
+
+#include "qmlinspectorconstants.h"
+#include "abstractviewinspector.h"
+
+#include <QtCore/QScopedPointer>
+#include <QtDeclarative/QDeclarativeView>
+
+QT_FORWARD_DECLARE_CLASS(QDeclarativeItem)
+QT_FORWARD_DECLARE_CLASS(QMouseEvent)
+QT_FORWARD_DECLARE_CLASS(QToolBar)
+
+namespace QmlJSDebugger {
+
+class QDeclarativeViewInspectorPrivate;
+
+class QDeclarativeViewInspector : public AbstractViewInspector
+{
+ Q_OBJECT
+
+public:
+ explicit QDeclarativeViewInspector(QDeclarativeView *view, QObject *parent = 0);
+ ~QDeclarativeViewInspector();
+
+ // AbstractViewInspector
+ void changeCurrentObjects(const QList<QObject*> &objects);
+ void reloadView();
+ void reparentQmlObject(QObject *object, QObject *newParent);
+ void changeTool(InspectorProtocol::Tool tool);
+ QWidget *viewWidget() const { return declarativeView(); }
+ QDeclarativeEngine *declarativeEngine() const;
+
+ void setSelectedItems(QList<QGraphicsItem *> items);
+ QList<QGraphicsItem *> selectedItems() const;
+
+ QDeclarativeView *declarativeView() const;
+
+ QRectF adjustToScreenBoundaries(const QRectF &boundingRectInSceneSpace);
+
+protected:
+ bool eventFilter(QObject *obj, QEvent *event);
+
+ bool leaveEvent(QEvent *);
+ bool mousePressEvent(QMouseEvent *event);
+ bool mouseMoveEvent(QMouseEvent *event);
+ bool mouseReleaseEvent(QMouseEvent *event);
+ bool keyPressEvent(QKeyEvent *event);
+ bool keyReleaseEvent(QKeyEvent *keyEvent);
+ bool mouseDoubleClickEvent(QMouseEvent *event);
+ bool wheelEvent(QWheelEvent *event);
+
+ void setSelectedItemsForTools(QList<QGraphicsItem *> items);
+
+private:
+ Q_DISABLE_COPY(QDeclarativeViewInspector)
+
+ inline QDeclarativeViewInspectorPrivate *d_func() { return data.data(); }
+ QScopedPointer<QDeclarativeViewInspectorPrivate> data;
+ friend class QDeclarativeViewInspectorPrivate;
+ friend class AbstractLiveEditTool;
+};
+
+} // namespace QmlJSDebugger
+
+#endif // QDECLARATIVEVIEWINSPECTOR_H
#ifndef QDECLARATIVEVIEWINSPECTOR_P_H
#define QDECLARATIVEVIEWINSPECTOR_P_H
-#include <private/qdeclarativeglobal_p.h>
+#include "qdeclarativeviewinspector.h"
-#include "qmlinspectorconstants_p.h"
-#include "abstractviewinspector.h"
+#include <QtCore/QWeakPointer>
+#include <QtCore/QPointF>
-#include <QtCore/QScopedPointer>
-#include <QtDeclarative/QDeclarativeView>
+#include "QtDeclarative/private/qdeclarativeinspectorservice_p.h"
-QT_FORWARD_DECLARE_CLASS(QDeclarativeItem)
-QT_FORWARD_DECLARE_CLASS(QMouseEvent)
-QT_FORWARD_DECLARE_CLASS(QToolBar)
+namespace QmlJSDebugger {
-QT_BEGIN_HEADER
+class QDeclarativeViewInspector;
+class LiveSelectionTool;
+class ZoomTool;
+class ColorPickerTool;
+class LiveLayerItem;
+class BoundingRectHighlighter;
+class AbstractLiveEditTool;
-QT_BEGIN_NAMESPACE
+class QDeclarativeViewInspectorPrivate : public QObject
+{
+ Q_OBJECT
+public:
+ QDeclarativeViewInspectorPrivate(QDeclarativeViewInspector *);
+ ~QDeclarativeViewInspectorPrivate();
-QT_MODULE(Declarative)
+ QDeclarativeView *view;
+ QDeclarativeViewInspector *q;
+ QWeakPointer<QWidget> viewport;
-class QDeclarativeViewInspectorPrivate;
+ QPointF cursorPos;
+ QList<QWeakPointer<QGraphicsObject> > currentSelection;
-class QDeclarativeViewInspector : public AbstractViewInspector
-{
- Q_OBJECT
+ Constants::DesignTool currentToolMode;
+ AbstractLiveEditTool *currentTool;
-public:
- explicit QDeclarativeViewInspector(QDeclarativeView *view, QObject *parent = 0);
- ~QDeclarativeViewInspector();
-
- // AbstractViewInspector
- void changeCurrentObjects(const QList<QObject*> &objects);
- void reloadView();
- void reparentQmlObject(QObject *object, QObject *newParent);
- void changeTool(InspectorProtocol::Tool tool);
- QWidget *viewWidget() const { return declarativeView(); }
- QDeclarativeEngine *declarativeEngine() const;
-
- void setSelectedItems(QList<QGraphicsItem *> items);
- QList<QGraphicsItem *> selectedItems() const;
+ LiveSelectionTool *selectionTool;
+ ZoomTool *zoomTool;
+ ColorPickerTool *colorPickerTool;
+ LiveLayerItem *manipulatorLayer;
- QDeclarativeView *declarativeView() const;
+ BoundingRectHighlighter *boundingRectHighlighter;
- QRectF adjustToScreenBoundaries(const QRectF &boundingRectInSceneSpace);
+ void setViewport(QWidget *widget);
-protected:
- bool eventFilter(QObject *obj, QEvent *event);
+ void clearEditorItems();
+ void changeToSelectTool();
+ QList<QGraphicsItem*> filterForSelection(QList<QGraphicsItem*> &itemlist) const;
- bool leaveEvent(QEvent *);
- bool mousePressEvent(QMouseEvent *event);
- bool mouseMoveEvent(QMouseEvent *event);
- bool mouseReleaseEvent(QMouseEvent *event);
- bool keyPressEvent(QKeyEvent *event);
- bool keyReleaseEvent(QKeyEvent *keyEvent);
- bool mouseDoubleClickEvent(QMouseEvent *event);
- bool wheelEvent(QWheelEvent *event);
+ QList<QGraphicsItem*> selectableItems(const QPoint &pos) const;
+ QList<QGraphicsItem*> selectableItems(const QPointF &scenePos) const;
+ QList<QGraphicsItem*> selectableItems(const QRectF &sceneRect, Qt::ItemSelectionMode selectionMode) const;
- void setSelectedItemsForTools(QList<QGraphicsItem *> items);
+ void setSelectedItemsForTools(const QList<QGraphicsItem *> &items);
+ void setSelectedItems(const QList<QGraphicsItem *> &items);
+ QList<QGraphicsItem *> selectedItems() const;
-private:
- Q_DISABLE_COPY(QDeclarativeViewInspector)
+ void clearHighlight();
+ void highlight(const QList<QGraphicsObject *> &item);
+ inline void highlight(QGraphicsObject *item)
+ { highlight(QList<QGraphicsObject*>() << item); }
- inline QDeclarativeViewInspectorPrivate *d_func() { return data.data(); }
- QScopedPointer<QDeclarativeViewInspectorPrivate> data;
- friend class QDeclarativeViewInspectorPrivate;
- friend class AbstractLiveEditTool;
-};
+ void changeToSingleSelectTool();
+ void changeToMarqueeSelectTool();
+ void changeToZoomTool();
+ void changeToColorPickerTool();
+
+public slots:
+ void _q_onStatusChanged(QDeclarativeView::Status status);
-QT_END_NAMESPACE
+ void _q_removeFromSelection(QObject *);
+
+public:
+ static QDeclarativeViewInspectorPrivate *get(QDeclarativeViewInspector *v) { return v->d_func(); }
+};
-QT_END_HEADER
+} // namespace QmlJSDebugger
#endif // QDECLARATIVEVIEWINSPECTOR_P_H
+++ /dev/null
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtDeclarative module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QDECLARATIVEVIEWINSPECTOR_P_P_H
-#define QDECLARATIVEVIEWINSPECTOR_P_P_H
-
-#include "qdeclarativeviewinspector_p.h"
-
-#include <QtCore/QWeakPointer>
-#include <QtCore/QPointF>
-
-#include "QtDeclarative/private/qdeclarativeinspectorservice_p.h"
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Declarative)
-
-class QDeclarativeViewInspector;
-class LiveSelectionTool;
-class ZoomTool;
-class ColorPickerTool;
-class LiveLayerItem;
-class BoundingRectHighlighter;
-class AbstractLiveEditTool;
-
-class QDeclarativeViewInspectorPrivate : public QObject
-{
- Q_OBJECT
-public:
- QDeclarativeViewInspectorPrivate(QDeclarativeViewInspector *);
- ~QDeclarativeViewInspectorPrivate();
-
- QDeclarativeView *view;
- QDeclarativeViewInspector *q;
- QWeakPointer<QWidget> viewport;
-
- QPointF cursorPos;
- QList<QWeakPointer<QGraphicsObject> > currentSelection;
-
- Constants::DesignTool currentToolMode;
- AbstractLiveEditTool *currentTool;
-
- LiveSelectionTool *selectionTool;
- ZoomTool *zoomTool;
- ColorPickerTool *colorPickerTool;
- LiveLayerItem *manipulatorLayer;
-
- BoundingRectHighlighter *boundingRectHighlighter;
-
- void setViewport(QWidget *widget);
-
- void clearEditorItems();
- void changeToSelectTool();
- QList<QGraphicsItem*> filterForSelection(QList<QGraphicsItem*> &itemlist) const;
-
- QList<QGraphicsItem*> selectableItems(const QPoint &pos) const;
- QList<QGraphicsItem*> selectableItems(const QPointF &scenePos) const;
- QList<QGraphicsItem*> selectableItems(const QRectF &sceneRect, Qt::ItemSelectionMode selectionMode) const;
-
- void setSelectedItemsForTools(const QList<QGraphicsItem *> &items);
- void setSelectedItems(const QList<QGraphicsItem *> &items);
- QList<QGraphicsItem *> selectedItems() const;
-
- void clearHighlight();
- void highlight(const QList<QGraphicsObject *> &item);
- inline void highlight(QGraphicsObject *item)
- { highlight(QList<QGraphicsObject*>() << item); }
-
- void changeToSingleSelectTool();
- void changeToMarqueeSelectTool();
- void changeToZoomTool();
- void changeToColorPickerTool();
-
-public slots:
- void _q_onStatusChanged(QDeclarativeView::Status status);
-
- void _q_removeFromSelection(QObject *);
-
-public:
- static QDeclarativeViewInspectorPrivate *get(QDeclarativeViewInspector *v) { return v->d_func(); }
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif // QDECLARATIVEVIEWINSPECTOR_P_P_H
abstractviewinspector.h \
qdeclarativeinspectorplugin.h \
qdeclarativeinspectorprotocol.h \
+ qdeclarativeviewinspector.h \
qdeclarativeviewinspector_p.h \
- qdeclarativeviewinspector_p_p.h \
- qmlinspectorconstants_p.h \
- editor/abstractliveedittool_p.h \
- editor/liveselectiontool_p.h \
- editor/livelayeritem_p.h \
- editor/livesingleselectionmanipulator_p.h \
- editor/liverubberbandselectionmanipulator_p.h \
- editor/liveselectionrectangle_p.h \
- editor/liveselectionindicator_p.h \
- editor/boundingrecthighlighter_p.h \
- editor/subcomponentmasklayeritem_p.h \
- editor/zoomtool_p.h \
- editor/colorpickertool_p.h \
- editor/qmltoolbar_p.h \
- editor/toolbarcolorbox_p.h \
+ qmlinspectorconstants.h \
+ editor/abstractliveedittool.h \
+ editor/liveselectiontool.h \
+ editor/livelayeritem.h \
+ editor/livesingleselectionmanipulator.h \
+ editor/liverubberbandselectionmanipulator.h \
+ editor/liveselectionrectangle.h \
+ editor/liveselectionindicator.h \
+ editor/boundingrecthighlighter.h \
+ editor/subcomponentmasklayeritem.h \
+ editor/zoomtool.h \
+ editor/colorpickertool.h \
+ editor/qmltoolbar.h \
+ editor/toolbarcolorbox.h \
sgabstracttool.h \
sgviewinspector.h \
sgselectiontool.h
#include <QtDeclarative/private/qdeclarativeglobal_p.h>
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Declarative)
-
+namespace QmlJSDebugger {
namespace Constants {
enum DesignTool {
} // namespace Constants
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
+} // namespace QmlJSDebugger
#endif // QMLINSPECTORCONSTANTS_H
#include "sgviewinspector.h"
-QT_BEGIN_NAMESPACE
+namespace QmlJSDebugger {
SGAbstractTool::SGAbstractTool(SGViewInspector *inspector) :
QObject(inspector),
{
}
-QT_END_NAMESPACE
+} // namespace QmlJSDebugger
#include <QtCore/QObject>
QT_BEGIN_NAMESPACE
-
class QMouseEvent;
class QKeyEvent;
class QWheelEvent;
+QT_END_NAMESPACE
+
+namespace QmlJSDebugger {
class SGViewInspector;
SGViewInspector *m_inspector;
};
-QT_END_NAMESPACE
+} // namespace QmlJSDebugger
#endif // SGABSTRACTTOOL_H
#include <QtDeclarative/private/qsgitem_p.h>
#include <QtDeclarative/private/qsgrectangle_p.h>
+namespace QmlJSDebugger {
+
/*
* Returns the first visible item at the given position, or 0 when no such
* child exists.
m_hoverHighlight->setPos(root->mapFromItem(item->parentItem(), item->pos()));
m_hoverHighlight->setVisible(true);
}
+
+} // namespace QmlJSDebugger
#include <QtCore/QList>
-QT_BEGIN_NAMESPACE
+QT_FORWARD_DECLARE_CLASS(QSGRectangle)
-class QSGRectangle;
+namespace QmlJSDebugger {
class SGSelectionTool : public SGAbstractTool
{
QSGRectangle *m_hoverHighlight;
};
-QT_END_NAMESPACE
+} // namespace QmlJSDebugger
#endif // SGSELECTIONTOOL_H
#include <cfloat>
-QT_BEGIN_NAMESPACE
+namespace QmlJSDebugger {
SGViewInspector::SGViewInspector(QSGView *view, QObject *parent) :
AbstractViewInspector(parent),
return true;
}
-QT_END_NAMESPACE
+} // namespace QmlJSDebugger
#include <QtCore/QWeakPointer>
QT_BEGIN_NAMESPACE
-
class QMouseEvent;
class QKeyEvent;
class QWheelEvent;
class QSGView;
class QSGItem;
+QT_END_NAMESPACE
+
+namespace QmlJSDebugger {
class SGAbstractTool;
class SGSelectionTool;
bool m_designMode;
};
-QT_END_NAMESPACE
+} // namespace QmlJSDebugger
#endif // QSGVIEWINSPECTOR_H