From f9e65028fd2227b7d1560ed793ee66f499a0d49b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= Date: Wed, 9 Feb 2011 16:59:43 +0100 Subject: [PATCH] QmlJSDebugger: Prefix live editor related classes AbstractFormEditorTool -> AbstractLiveEditTool LayerItem -> LiveLayerItem SelectionIndicator -> LiveSelectionIndicator SelectionRectangle -> LiveSelectionRectangle SelectionTool -> LiveSelectionTool SingleSelectionManipulator -> LiveSingleSelectionManipulator RubberBandSelectionManipulator -> LiveRubberBandSelectionManipulator --- ...ditortool.cpp => abstractliveedittool.cpp} | 38 ++++++------ ...ormeditortool.h => abstractliveedittool.h} | 12 ++-- .../editor/boundingrecthighlighter.cpp | 2 +- .../editor/boundingrecthighlighter.h | 2 +- .../qmljsdebugger/editor/colorpickertool.cpp | 2 +- .../qmljsdebugger/editor/colorpickertool.h | 5 +- .../editor/images/toolbarcolorbox.h | 41 ------------- .../{layeritem.cpp => livelayeritem.cpp} | 18 +++--- .../editor/{layeritem.h => livelayeritem.h} | 14 ++--- ...=> liverubberbandselectionmanipulator.cpp} | 26 ++++---- ...h => liverubberbandselectionmanipulator.h} | 8 +-- ...dicator.cpp => liveselectionindicator.cpp} | 16 ++--- ...onindicator.h => liveselectionindicator.h} | 12 ++-- ...ctangle.cpp => liveselectionrectangle.cpp} | 16 ++--- ...onrectangle.h => liveselectionrectangle.h} | 14 ++--- ...electiontool.cpp => liveselectiontool.cpp} | 60 +++++++++---------- .../{selectiontool.h => liveselectiontool.h} | 18 +++--- ...cpp => livesingleselectionmanipulator.cpp} | 24 ++++---- ...tor.h => livesingleselectionmanipulator.h} | 12 ++-- .../qml/qmljsdebugger/editor/qmltoolbar.cpp | 2 +- .../editor/subcomponenteditortool.cpp | 2 +- .../editor/subcomponenteditortool.h | 2 +- .../qmljsdebugger/editor/toolbarcolorbox.h | 7 +-- .../qml/qmljsdebugger/editor/zoomtool.cpp | 6 +- .../qml/qmljsdebugger/editor/zoomtool.h | 4 +- .../qdeclarativeviewobserver.cpp | 6 +- .../qdeclarativeviewobserver_p.h | 12 ++-- .../qml/qmljsdebugger/qmljsdebugger-lib.pri | 28 ++++----- .../qmljsinspector/qmljstoolbarcolorbox.h | 1 - 29 files changed, 182 insertions(+), 228 deletions(-) rename share/qtcreator/qml/qmljsdebugger/editor/{abstractformeditortool.cpp => abstractliveedittool.cpp} (78%) rename share/qtcreator/qml/qmljsdebugger/editor/{abstractformeditortool.h => abstractliveedittool.h} (93%) delete mode 100644 share/qtcreator/qml/qmljsdebugger/editor/images/toolbarcolorbox.h rename share/qtcreator/qml/qmljsdebugger/editor/{layeritem.cpp => livelayeritem.cpp} (80%) rename share/qtcreator/qml/qmljsdebugger/editor/{layeritem.h => livelayeritem.h} (90%) rename share/qtcreator/qml/qmljsdebugger/editor/{rubberbandselectionmanipulator.cpp => liverubberbandselectionmanipulator.cpp} (82%) rename share/qtcreator/qml/qmljsdebugger/editor/{rubberbandselectionmanipulator.h => liverubberbandselectionmanipulator.h} (90%) rename share/qtcreator/qml/qmljsdebugger/editor/{selectionindicator.cpp => liveselectionindicator.cpp} (89%) rename share/qtcreator/qml/qmljsdebugger/editor/{selectionindicator.h => liveselectionindicator.h} (88%) rename share/qtcreator/qml/qmljsdebugger/editor/{selectionrectangle.cpp => liveselectionrectangle.cpp} (88%) rename share/qtcreator/qml/qmljsdebugger/editor/{selectionrectangle.h => liveselectionrectangle.h} (88%) rename share/qtcreator/qml/qmljsdebugger/editor/{selectiontool.cpp => liveselectiontool.cpp} (87%) rename share/qtcreator/qml/qmljsdebugger/editor/{selectiontool.h => liveselectiontool.h} (90%) rename share/qtcreator/qml/qmljsdebugger/editor/{singleselectionmanipulator.cpp => livesingleselectionmanipulator.cpp} (80%) rename share/qtcreator/qml/qmljsdebugger/editor/{singleselectionmanipulator.h => livesingleselectionmanipulator.h} (89%) diff --git a/share/qtcreator/qml/qmljsdebugger/editor/abstractformeditortool.cpp b/share/qtcreator/qml/qmljsdebugger/editor/abstractliveedittool.cpp similarity index 78% rename from share/qtcreator/qml/qmljsdebugger/editor/abstractformeditortool.cpp rename to share/qtcreator/qml/qmljsdebugger/editor/abstractliveedittool.cpp index e83d9a73e51..037af0d07b5 100644 --- a/share/qtcreator/qml/qmljsdebugger/editor/abstractformeditortool.cpp +++ b/share/qtcreator/qml/qmljsdebugger/editor/abstractliveedittool.cpp @@ -31,7 +31,7 @@ ** **************************************************************************/ -#include "abstractformeditortool.h" +#include "abstractliveedittool.h" #include "qdeclarativeviewobserver.h" #include "../qdeclarativeviewobserver_p.h" @@ -43,48 +43,48 @@ namespace QmlJSDebugger { -AbstractFormEditorTool::AbstractFormEditorTool(QDeclarativeViewObserver *editorView) +AbstractLiveEditTool::AbstractLiveEditTool(QDeclarativeViewObserver *editorView) : QObject(editorView), m_observer(editorView) { } -AbstractFormEditorTool::~AbstractFormEditorTool() +AbstractLiveEditTool::~AbstractLiveEditTool() { } -QDeclarativeViewObserver *AbstractFormEditorTool::observer() const +QDeclarativeViewObserver *AbstractLiveEditTool::observer() const { return m_observer; } -QDeclarativeView *AbstractFormEditorTool::view() const +QDeclarativeView *AbstractLiveEditTool::view() const { return m_observer->declarativeView(); } -QGraphicsScene* AbstractFormEditorTool::scene() const +QGraphicsScene* AbstractLiveEditTool::scene() const { return view()->scene(); } -void AbstractFormEditorTool::updateSelectedItems() +void AbstractLiveEditTool::updateSelectedItems() { selectedItemsChanged(items()); } -QList AbstractFormEditorTool::items() const +QList AbstractLiveEditTool::items() const { return observer()->selectedItems(); } -void AbstractFormEditorTool::enterContext(QGraphicsItem *itemToEnter) +void AbstractLiveEditTool::enterContext(QGraphicsItem *itemToEnter) { observer()->data->enterContext(itemToEnter); } -bool AbstractFormEditorTool::topItemIsMovable(const QList & itemList) +bool AbstractLiveEditTool::topItemIsMovable(const QList & itemList) { QGraphicsItem *firstSelectableItem = topMovableGraphicsItem(itemList); if (firstSelectableItem == 0) @@ -100,7 +100,7 @@ bool AbstractFormEditorTool::topItemIsMovable(const QList & item } -bool AbstractFormEditorTool::topSelectedItemIsMovable(const QList &itemList) +bool AbstractLiveEditTool::topSelectedItemIsMovable(const QList &itemList) { QList selectedItems = observer()->selectedItems(); @@ -116,17 +116,17 @@ bool AbstractFormEditorTool::topSelectedItemIsMovable(const QList &/*itemList*/) +bool AbstractLiveEditTool::topItemIsResizeHandle(const QList &/*itemList*/) { return false; } -QDeclarativeItem *AbstractFormEditorTool::toQDeclarativeItem(QGraphicsItem *item) +QDeclarativeItem *AbstractLiveEditTool::toQDeclarativeItem(QGraphicsItem *item) { return dynamic_cast(item->toGraphicsObject()); } -QGraphicsItem *AbstractFormEditorTool::topMovableGraphicsItem(const QList &itemList) +QGraphicsItem *AbstractLiveEditTool::topMovableGraphicsItem(const QList &itemList) { foreach (QGraphicsItem *item, itemList) { if (item->flags().testFlag(QGraphicsItem::ItemIsMovable)) @@ -135,8 +135,8 @@ QGraphicsItem *AbstractFormEditorTool::topMovableGraphicsItem(const QList - &itemList) +QDeclarativeItem *AbstractLiveEditTool::topMovableDeclarativeItem(const QList + &itemList) { foreach (QGraphicsItem *item, itemList) { QDeclarativeItem *declarativeItem = toQDeclarativeItem(item); @@ -147,8 +147,8 @@ QDeclarativeItem *AbstractFormEditorTool::topMovableDeclarativeItem(const QList< return 0; } -QList AbstractFormEditorTool::toGraphicsObjectList(const QList - &itemList) +QList AbstractLiveEditTool::toGraphicsObjectList(const QList + &itemList) { QList gfxObjects; foreach(QGraphicsItem *item, itemList) { @@ -160,7 +160,7 @@ QList AbstractFormEditorTool::toGraphicsObjectList(const QList return gfxObjects; } -QString AbstractFormEditorTool::titleForItem(QGraphicsItem *item) +QString AbstractLiveEditTool::titleForItem(QGraphicsItem *item) { QString className("QGraphicsItem"); QString objectStringId; diff --git a/share/qtcreator/qml/qmljsdebugger/editor/abstractformeditortool.h b/share/qtcreator/qml/qmljsdebugger/editor/abstractliveedittool.h similarity index 93% rename from share/qtcreator/qml/qmljsdebugger/editor/abstractformeditortool.h rename to share/qtcreator/qml/qmljsdebugger/editor/abstractliveedittool.h index 38651f2de46..cade09fde91 100644 --- a/share/qtcreator/qml/qmljsdebugger/editor/abstractformeditortool.h +++ b/share/qtcreator/qml/qmljsdebugger/editor/abstractliveedittool.h @@ -31,8 +31,8 @@ ** **************************************************************************/ -#ifndef ABSTRACTFORMEDITORTOOL_H -#define ABSTRACTFORMEDITORTOOL_H +#ifndef ABSTRACTLIVEEDITTOOL_H +#define ABSTRACTLIVEEDITTOOL_H #include #include @@ -54,13 +54,13 @@ class QDeclarativeViewObserver; class FormEditorView; -class AbstractFormEditorTool : public QObject +class AbstractLiveEditTool : public QObject { Q_OBJECT public: - AbstractFormEditorTool(QDeclarativeViewObserver* observer); + AbstractLiveEditTool(QDeclarativeViewObserver *observer); - virtual ~AbstractFormEditorTool(); + virtual ~AbstractLiveEditTool(); virtual void mousePressEvent(QMouseEvent *event) = 0; virtual void mouseMoveEvent(QMouseEvent *event) = 0; @@ -105,4 +105,4 @@ private: } -#endif // ABSTRACTFORMEDITORTOOL_H +#endif // ABSTRACTLIVEEDITTOOL_H diff --git a/share/qtcreator/qml/qmljsdebugger/editor/boundingrecthighlighter.cpp b/share/qtcreator/qml/qmljsdebugger/editor/boundingrecthighlighter.cpp index 3961957421d..cc01ddd3270 100644 --- a/share/qtcreator/qml/qmljsdebugger/editor/boundingrecthighlighter.cpp +++ b/share/qtcreator/qml/qmljsdebugger/editor/boundingrecthighlighter.cpp @@ -83,7 +83,7 @@ int BoundingBoxPolygonItem::type() const } BoundingRectHighlighter::BoundingRectHighlighter(QDeclarativeViewObserver *view) : - LayerItem(view->declarativeView()->scene()), + LiveLayerItem(view->declarativeView()->scene()), m_view(view), m_animFrame(0) { diff --git a/share/qtcreator/qml/qmljsdebugger/editor/boundingrecthighlighter.h b/share/qtcreator/qml/qmljsdebugger/editor/boundingrecthighlighter.h index 8ce7a6d8e3f..23b3f10babe 100644 --- a/share/qtcreator/qml/qmljsdebugger/editor/boundingrecthighlighter.h +++ b/share/qtcreator/qml/qmljsdebugger/editor/boundingrecthighlighter.h @@ -50,7 +50,7 @@ namespace QmlJSDebugger { class QDeclarativeViewObserver; class BoundingBox; -class BoundingRectHighlighter : public LayerItem +class BoundingRectHighlighter : public LiveLayerItem { Q_OBJECT public: diff --git a/share/qtcreator/qml/qmljsdebugger/editor/colorpickertool.cpp b/share/qtcreator/qml/qmljsdebugger/editor/colorpickertool.cpp index 22187626946..a9bac2f0320 100644 --- a/share/qtcreator/qml/qmljsdebugger/editor/colorpickertool.cpp +++ b/share/qtcreator/qml/qmljsdebugger/editor/colorpickertool.cpp @@ -45,7 +45,7 @@ namespace QmlJSDebugger { ColorPickerTool::ColorPickerTool(QDeclarativeViewObserver *view) : - AbstractFormEditorTool(view) + AbstractLiveEditTool(view) { m_selectedColor.setRgb(0,0,0); } diff --git a/share/qtcreator/qml/qmljsdebugger/editor/colorpickertool.h b/share/qtcreator/qml/qmljsdebugger/editor/colorpickertool.h index 8ef2e027c48..8326c189489 100644 --- a/share/qtcreator/qml/qmljsdebugger/editor/colorpickertool.h +++ b/share/qtcreator/qml/qmljsdebugger/editor/colorpickertool.h @@ -34,7 +34,7 @@ #ifndef COLORPICKERTOOL_H #define COLORPICKERTOOL_H -#include "abstractformeditortool.h" +#include "abstractliveedittool.h" #include @@ -42,7 +42,7 @@ QT_FORWARD_DECLARE_CLASS(QPoint) namespace QmlJSDebugger { -class ColorPickerTool : public AbstractFormEditorTool +class ColorPickerTool : public AbstractLiveEditTool { Q_OBJECT public: @@ -78,7 +78,6 @@ private: private: QColor m_selectedColor; - }; } // namespace QmlJSDebugger diff --git a/share/qtcreator/qml/qmljsdebugger/editor/images/toolbarcolorbox.h b/share/qtcreator/qml/qmljsdebugger/editor/images/toolbarcolorbox.h deleted file mode 100644 index d4be7921bb8..00000000000 --- a/share/qtcreator/qml/qmljsdebugger/editor/images/toolbarcolorbox.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef ToolBarColorBox_H -#define ToolBarColorBox_H - -#include -#include -#include - -QT_FORWARD_DECLARE_CLASS(QContextMenuEvent); -QT_FORWARD_DECLARE_CLASS(QAction); - -namespace QmlJSDebugger { - -class ToolBarColorBox : public QLabel -{ - Q_OBJECT -public: - explicit ToolBarColorBox(QWidget *parent = 0); - void setColor(const QColor &color); - -protected: - void contextMenuEvent(QContextMenuEvent *ev); - void mouseDoubleClickEvent(QMouseEvent *); - void mousePressEvent(QMouseEvent *ev); - void mouseMoveEvent(QMouseEvent *ev); -private slots: - void copyColorToClipboard(); - -private: - QPixmap createDragPixmap(int size = 24) const; - -private: - bool m_dragStarted; - QPoint m_dragBeginPoint; - QAction *m_copyHexColor; - QColor m_color; - -}; - -} // namespace QmlJSDebugger - -#endif // ToolBarColorBox_H diff --git a/share/qtcreator/qml/qmljsdebugger/editor/layeritem.cpp b/share/qtcreator/qml/qmljsdebugger/editor/livelayeritem.cpp similarity index 80% rename from share/qtcreator/qml/qmljsdebugger/editor/layeritem.cpp rename to share/qtcreator/qml/qmljsdebugger/editor/livelayeritem.cpp index a8cc3be9c9d..52d33fb9138 100644 --- a/share/qtcreator/qml/qmljsdebugger/editor/layeritem.cpp +++ b/share/qtcreator/qml/qmljsdebugger/editor/livelayeritem.cpp @@ -31,14 +31,14 @@ ** **************************************************************************/ -#include "layeritem.h" +#include "livelayeritem.h" #include "qmlobserverconstants.h" #include namespace QmlJSDebugger { -LayerItem::LayerItem(QGraphicsScene* scene) +LiveLayerItem::LiveLayerItem(QGraphicsScene* scene) : QGraphicsObject() { scene->addItem(this); @@ -46,31 +46,31 @@ LayerItem::LayerItem(QGraphicsScene* scene) setFlag(QGraphicsItem::ItemIsMovable, false); } -LayerItem::~LayerItem() +LiveLayerItem::~LiveLayerItem() { } -void LayerItem::paint(QPainter * /*painter*/, const QStyleOptionGraphicsItem * /*option*/, - QWidget * /*widget*/) +void LiveLayerItem::paint(QPainter * /*painter*/, const QStyleOptionGraphicsItem * /*option*/, + QWidget * /*widget*/) { } -int LayerItem::type() const +int LiveLayerItem::type() const { return Constants::EditorItemType; } -QRectF LayerItem::boundingRect() const +QRectF LiveLayerItem::boundingRect() const { return childrenBoundingRect(); } -QList LayerItem::findAllChildItems() const +QList LiveLayerItem::findAllChildItems() const { return findAllChildItems(this); } -QList LayerItem::findAllChildItems(const QGraphicsItem *item) const +QList LiveLayerItem::findAllChildItems(const QGraphicsItem *item) const { QList itemList(item->childItems()); diff --git a/share/qtcreator/qml/qmljsdebugger/editor/layeritem.h b/share/qtcreator/qml/qmljsdebugger/editor/livelayeritem.h similarity index 90% rename from share/qtcreator/qml/qmljsdebugger/editor/layeritem.h rename to share/qtcreator/qml/qmljsdebugger/editor/livelayeritem.h index 4b4bf0b60fd..3ef3a9f835d 100644 --- a/share/qtcreator/qml/qmljsdebugger/editor/layeritem.h +++ b/share/qtcreator/qml/qmljsdebugger/editor/livelayeritem.h @@ -31,20 +31,18 @@ ** **************************************************************************/ -#ifndef LAYERITEM_H -#define LAYERITEM_H +#ifndef LIVELAYERITEM_H +#define LIVELAYERITEM_H #include namespace QmlJSDebugger { -class FormEditorScene; - -class LayerItem : public QGraphicsObject +class LiveLayerItem : public QGraphicsObject { public: - LayerItem(QGraphicsScene *scene); - ~LayerItem(); + LiveLayerItem(QGraphicsScene *scene); + ~LiveLayerItem(); void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); QRectF boundingRect() const; @@ -58,4 +56,4 @@ protected: } -#endif // LAYERITEM_H +#endif // LIVELAYERITEM_H diff --git a/share/qtcreator/qml/qmljsdebugger/editor/rubberbandselectionmanipulator.cpp b/share/qtcreator/qml/qmljsdebugger/editor/liverubberbandselectionmanipulator.cpp similarity index 82% rename from share/qtcreator/qml/qmljsdebugger/editor/rubberbandselectionmanipulator.cpp rename to share/qtcreator/qml/qmljsdebugger/editor/liverubberbandselectionmanipulator.cpp index 9ca11e008ac..04a97f9ee1b 100644 --- a/share/qtcreator/qml/qmljsdebugger/editor/rubberbandselectionmanipulator.cpp +++ b/share/qtcreator/qml/qmljsdebugger/editor/liverubberbandselectionmanipulator.cpp @@ -31,7 +31,7 @@ ** **************************************************************************/ -#include "rubberbandselectionmanipulator.h" +#include "liverubberbandselectionmanipulator.h" #include "../qdeclarativeviewobserver_p.h" #include @@ -40,8 +40,8 @@ namespace QmlJSDebugger { -RubberBandSelectionManipulator::RubberBandSelectionManipulator(QGraphicsObject *layerItem, - QDeclarativeViewObserver *editorView) +LiveRubberBandSelectionManipulator::LiveRubberBandSelectionManipulator(QGraphicsObject *layerItem, + QDeclarativeViewObserver *editorView) : m_selectionRectangleElement(layerItem), m_editorView(editorView), m_beginFormEditorItem(0), @@ -50,7 +50,7 @@ RubberBandSelectionManipulator::RubberBandSelectionManipulator(QGraphicsObject * m_selectionRectangleElement.hide(); } -void RubberBandSelectionManipulator::clear() +void LiveRubberBandSelectionManipulator::clear() { m_selectionRectangleElement.clear(); m_isActive = false; @@ -59,8 +59,8 @@ void RubberBandSelectionManipulator::clear() m_oldSelectionList.clear(); } -QGraphicsItem *RubberBandSelectionManipulator::topFormEditorItem(const QList - &itemList) +QGraphicsItem *LiveRubberBandSelectionManipulator::topFormEditorItem(const QList + &itemList) { if (itemList.isEmpty()) return 0; @@ -68,7 +68,7 @@ QGraphicsItem *RubberBandSelectionManipulator::topFormEditorItem(const QListselectedItems(); } -void RubberBandSelectionManipulator::update(const QPointF& updatePoint) +void LiveRubberBandSelectionManipulator::update(const QPointF &updatePoint) { m_selectionRectangleElement.setRect(m_beginPoint, updatePoint); } -void RubberBandSelectionManipulator::end() +void LiveRubberBandSelectionManipulator::end() { m_oldSelectionList.clear(); m_selectionRectangleElement.hide(); m_isActive = false; } -void RubberBandSelectionManipulator::select(SelectionType selectionType) +void LiveRubberBandSelectionManipulator::select(SelectionType selectionType) { QDeclarativeViewObserverPrivate *observerPrivate = QDeclarativeViewObserverPrivate::get(m_editorView); @@ -138,17 +138,17 @@ void RubberBandSelectionManipulator::select(SelectionType selectionType) } -void RubberBandSelectionManipulator::setItems(const QList &itemList) +void LiveRubberBandSelectionManipulator::setItems(const QList &itemList) { m_itemList = itemList; } -QPointF RubberBandSelectionManipulator::beginPoint() const +QPointF LiveRubberBandSelectionManipulator::beginPoint() const { return m_beginPoint; } -bool RubberBandSelectionManipulator::isActive() const +bool LiveRubberBandSelectionManipulator::isActive() const { return m_isActive; } diff --git a/share/qtcreator/qml/qmljsdebugger/editor/rubberbandselectionmanipulator.h b/share/qtcreator/qml/qmljsdebugger/editor/liverubberbandselectionmanipulator.h similarity index 90% rename from share/qtcreator/qml/qmljsdebugger/editor/rubberbandselectionmanipulator.h rename to share/qtcreator/qml/qmljsdebugger/editor/liverubberbandselectionmanipulator.h index 025c22712b2..7ead4726d0a 100644 --- a/share/qtcreator/qml/qmljsdebugger/editor/rubberbandselectionmanipulator.h +++ b/share/qtcreator/qml/qmljsdebugger/editor/liverubberbandselectionmanipulator.h @@ -45,7 +45,7 @@ namespace QmlJSDebugger { class QDeclarativeViewObserver; -class RubberBandSelectionManipulator +class LiveRubberBandSelectionManipulator { public: enum SelectionType { @@ -54,8 +54,8 @@ public: RemoveFromSelection }; - RubberBandSelectionManipulator(QGraphicsObject *layerItem, - QDeclarativeViewObserver *editorView); + LiveRubberBandSelectionManipulator(QGraphicsObject *layerItem, + QDeclarativeViewObserver *editorView); void setItems(const QList &itemList); @@ -77,7 +77,7 @@ protected: private: QList m_itemList; QList m_oldSelectionList; - SelectionRectangle m_selectionRectangleElement; + LiveSelectionRectangle m_selectionRectangleElement; QPointF m_beginPoint; QDeclarativeViewObserver *m_editorView; QGraphicsItem *m_beginFormEditorItem; diff --git a/share/qtcreator/qml/qmljsdebugger/editor/selectionindicator.cpp b/share/qtcreator/qml/qmljsdebugger/editor/liveselectionindicator.cpp similarity index 89% rename from share/qtcreator/qml/qmljsdebugger/editor/selectionindicator.cpp rename to share/qtcreator/qml/qmljsdebugger/editor/liveselectionindicator.cpp index 6b77ad7d815..11936ed9f1b 100644 --- a/share/qtcreator/qml/qmljsdebugger/editor/selectionindicator.cpp +++ b/share/qtcreator/qml/qmljsdebugger/editor/liveselectionindicator.cpp @@ -31,7 +31,7 @@ ** **************************************************************************/ -#include "selectionindicator.h" +#include "liveselectionindicator.h" #include "../qdeclarativeviewobserver_p.h" #include "qmlobserverconstants.h" @@ -46,30 +46,30 @@ namespace QmlJSDebugger { -SelectionIndicator::SelectionIndicator(QDeclarativeViewObserver *editorView, +LiveSelectionIndicator::LiveSelectionIndicator(QDeclarativeViewObserver *editorView, QGraphicsObject *layerItem) : m_layerItem(layerItem), m_view(editorView) { } -SelectionIndicator::~SelectionIndicator() +LiveSelectionIndicator::~LiveSelectionIndicator() { clear(); } -void SelectionIndicator::show() +void LiveSelectionIndicator::show() { foreach (QGraphicsPolygonItem *item, m_indicatorShapeHash.values()) item->show(); } -void SelectionIndicator::hide() +void LiveSelectionIndicator::hide() { foreach (QGraphicsPolygonItem *item, m_indicatorShapeHash.values()) item->hide(); } -void SelectionIndicator::clear() +void LiveSelectionIndicator::clear() { if (!m_layerItem.isNull()) { QHashIterator iter(m_indicatorShapeHash); @@ -84,7 +84,7 @@ void SelectionIndicator::clear() } -QPolygonF SelectionIndicator::addBoundingRectToPolygon(QGraphicsItem *item, QPolygonF &polygon) +QPolygonF LiveSelectionIndicator::addBoundingRectToPolygon(QGraphicsItem *item, QPolygonF &polygon) { // ### remove this if statement when QTBUG-12172 gets fixed if (item->boundingRect() != QRectF(0,0,0,0)) { @@ -100,7 +100,7 @@ QPolygonF SelectionIndicator::addBoundingRectToPolygon(QGraphicsItem *item, QPol return polygon; } -void SelectionIndicator::setItems(const QList > &itemList) +void LiveSelectionIndicator::setItems(const QList > &itemList) { clear(); diff --git a/share/qtcreator/qml/qmljsdebugger/editor/selectionindicator.h b/share/qtcreator/qml/qmljsdebugger/editor/liveselectionindicator.h similarity index 88% rename from share/qtcreator/qml/qmljsdebugger/editor/selectionindicator.h rename to share/qtcreator/qml/qmljsdebugger/editor/liveselectionindicator.h index 94316b6e7fe..d9b28cf150f 100644 --- a/share/qtcreator/qml/qmljsdebugger/editor/selectionindicator.h +++ b/share/qtcreator/qml/qmljsdebugger/editor/liveselectionindicator.h @@ -31,8 +31,8 @@ ** **************************************************************************/ -#ifndef SELECTIONINDICATOR_H -#define SELECTIONINDICATOR_H +#ifndef LIVESELECTIONINDICATOR_H +#define LIVESELECTIONINDICATOR_H #include #include @@ -48,11 +48,11 @@ namespace QmlJSDebugger { class QDeclarativeViewObserver; -class SelectionIndicator +class LiveSelectionIndicator { public: - SelectionIndicator(QDeclarativeViewObserver* editorView, QGraphicsObject *layerItem); - ~SelectionIndicator(); + LiveSelectionIndicator(QDeclarativeViewObserver* editorView, QGraphicsObject *layerItem); + ~LiveSelectionIndicator(); void show(); void hide(); @@ -73,4 +73,4 @@ private: } -#endif // SELECTIONINDICATOR_H +#endif // LIVESELECTIONINDICATOR_H diff --git a/share/qtcreator/qml/qmljsdebugger/editor/selectionrectangle.cpp b/share/qtcreator/qml/qmljsdebugger/editor/liveselectionrectangle.cpp similarity index 88% rename from share/qtcreator/qml/qmljsdebugger/editor/selectionrectangle.cpp rename to share/qtcreator/qml/qmljsdebugger/editor/liveselectionrectangle.cpp index b5972bd3927..df91abd6a3d 100644 --- a/share/qtcreator/qml/qmljsdebugger/editor/selectionrectangle.cpp +++ b/share/qtcreator/qml/qmljsdebugger/editor/liveselectionrectangle.cpp @@ -31,7 +31,7 @@ ** **************************************************************************/ -#include "selectionrectangle.h" +#include "liveselectionrectangle.h" #include "qmlobserverconstants.h" #include @@ -52,7 +52,7 @@ public: int type() const { return Constants::EditorItemType; } }; -SelectionRectangle::SelectionRectangle(QGraphicsObject *layerItem) +LiveSelectionRectangle::LiveSelectionRectangle(QGraphicsObject *layerItem) : m_controlShape(new SelectionRectShape(layerItem)), m_layerItem(layerItem) { @@ -60,32 +60,32 @@ SelectionRectangle::SelectionRectangle(QGraphicsObject *layerItem) m_controlShape->setBrush(QColor(128, 128, 128, 50)); } -SelectionRectangle::~SelectionRectangle() +LiveSelectionRectangle::~LiveSelectionRectangle() { if (m_layerItem) m_layerItem.data()->scene()->removeItem(m_controlShape); } -void SelectionRectangle::clear() +void LiveSelectionRectangle::clear() { hide(); } -void SelectionRectangle::show() +void LiveSelectionRectangle::show() { m_controlShape->show(); } -void SelectionRectangle::hide() +void LiveSelectionRectangle::hide() { m_controlShape->hide(); } -QRectF SelectionRectangle::rect() const +QRectF LiveSelectionRectangle::rect() const { return m_controlShape->mapFromScene(m_controlShape->rect()).boundingRect(); } -void SelectionRectangle::setRect(const QPointF &firstPoint, +void LiveSelectionRectangle::setRect(const QPointF &firstPoint, const QPointF &secondPoint) { double firstX = std::floor(firstPoint.x()) + 0.5; diff --git a/share/qtcreator/qml/qmljsdebugger/editor/selectionrectangle.h b/share/qtcreator/qml/qmljsdebugger/editor/liveselectionrectangle.h similarity index 88% rename from share/qtcreator/qml/qmljsdebugger/editor/selectionrectangle.h rename to share/qtcreator/qml/qmljsdebugger/editor/liveselectionrectangle.h index 43b1dc54275..f4542b9b5a2 100644 --- a/share/qtcreator/qml/qmljsdebugger/editor/selectionrectangle.h +++ b/share/qtcreator/qml/qmljsdebugger/editor/liveselectionrectangle.h @@ -31,8 +31,8 @@ ** **************************************************************************/ -#ifndef SELECTIONRECTANGLE_H -#define SELECTIONRECTANGLE_H +#ifndef LIVESELECTIONRECTANGLE_H +#define LIVESELECTIONRECTANGLE_H #include @@ -43,11 +43,11 @@ QT_FORWARD_DECLARE_CLASS(QRectF) namespace QmlJSDebugger { -class SelectionRectangle +class LiveSelectionRectangle { public: - SelectionRectangle(QGraphicsObject *layerItem); - ~SelectionRectangle(); + LiveSelectionRectangle(QGraphicsObject *layerItem); + ~LiveSelectionRectangle(); void show(); void hide(); @@ -64,6 +64,6 @@ private: QWeakPointer m_layerItem; }; -} +} // namespace QmlJSDebugger -#endif // SELECTIONRECTANGLE_H +#endif // LIVESELECTIONRECTANGLE_H diff --git a/share/qtcreator/qml/qmljsdebugger/editor/selectiontool.cpp b/share/qtcreator/qml/qmljsdebugger/editor/liveselectiontool.cpp similarity index 87% rename from share/qtcreator/qml/qmljsdebugger/editor/selectiontool.cpp rename to share/qtcreator/qml/qmljsdebugger/editor/liveselectiontool.cpp index 78af954b18a..be6e692952c 100644 --- a/share/qtcreator/qml/qmljsdebugger/editor/selectiontool.cpp +++ b/share/qtcreator/qml/qmljsdebugger/editor/liveselectiontool.cpp @@ -31,7 +31,7 @@ ** **************************************************************************/ -#include "selectiontool.h" +#include "liveselectiontool.h" #include "layeritem.h" #include "../qdeclarativeviewobserver_p.h" @@ -51,8 +51,8 @@ namespace QmlJSDebugger { -SelectionTool::SelectionTool(QDeclarativeViewObserver *editorView) : - AbstractFormEditorTool(editorView), +LiveSelectionTool::LiveSelectionTool(QDeclarativeViewObserver *editorView) : + AbstractLiveEditTool(editorView), m_rubberbandSelectionMode(false), m_rubberbandSelectionManipulator( QDeclarativeViewObserverPrivate::get(editorView)->manipulatorLayer, editorView), @@ -65,16 +65,16 @@ SelectionTool::SelectionTool(QDeclarativeViewObserver *editorView) : } -SelectionTool::~SelectionTool() +LiveSelectionTool::~LiveSelectionTool() { } -void SelectionTool::setRubberbandSelectionMode(bool value) +void LiveSelectionTool::setRubberbandSelectionMode(bool value) { m_rubberbandSelectionMode = value; } -SingleSelectionManipulator::SelectionType SelectionTool::getSelectionType(Qt::KeyboardModifiers +SingleSelectionManipulator::SelectionType LiveSelectionTool::getSelectionType(Qt::KeyboardModifiers modifiers) { SingleSelectionManipulator::SelectionType selectionType @@ -87,7 +87,7 @@ SingleSelectionManipulator::SelectionType SelectionTool::getSelectionType(Qt::Ke return selectionType; } -bool SelectionTool::alreadySelected(const QList &itemList) const +bool LiveSelectionTool::alreadySelected(const QList &itemList) const { QDeclarativeViewObserverPrivate *observerPrivate = QDeclarativeViewObserverPrivate::get(observer()); @@ -105,7 +105,7 @@ bool SelectionTool::alreadySelected(const QList &itemList) const return false; } -void SelectionTool::mousePressEvent(QMouseEvent *event) +void LiveSelectionTool::mousePressEvent(QMouseEvent *event) { QDeclarativeViewObserverPrivate *observerPrivate = QDeclarativeViewObserverPrivate::get(observer()); @@ -126,7 +126,7 @@ void SelectionTool::mousePressEvent(QMouseEvent *event) } } -void SelectionTool::createContextMenu(QList itemList, QPoint globalPos) +void LiveSelectionTool::createContextMenu(QList itemList, QPoint globalPos) { if (!QDeclarativeViewObserverPrivate::get(observer())->mouseInsideContextItem()) return; @@ -173,7 +173,7 @@ void SelectionTool::createContextMenu(QList itemList, QPoint glo m_contextMenuItemList.clear(); } -void SelectionTool::contextMenuElementSelected() +void LiveSelectionTool::contextMenuElementSelected() { QAction *senderAction = static_cast(sender()); int itemListIndex = senderAction->data().toInt(); @@ -190,7 +190,7 @@ void SelectionTool::contextMenuElementSelected() } } -void SelectionTool::contextMenuElementHovered(QAction *action) +void LiveSelectionTool::contextMenuElementHovered(QAction *action) { int itemListIndex = action->data().toInt(); if (itemListIndex >= 0 && itemListIndex < m_contextMenuItemList.length()) { @@ -199,7 +199,7 @@ void SelectionTool::contextMenuElementHovered(QAction *action) } } -void SelectionTool::mouseMoveEvent(QMouseEvent *event) +void LiveSelectionTool::mouseMoveEvent(QMouseEvent *event) { if (m_singleSelectionManipulator.isActive()) { QPointF mouseMovementVector = m_singleSelectionManipulator.beginPoint() - event->pos(); @@ -220,18 +220,18 @@ void SelectionTool::mouseMoveEvent(QMouseEvent *event) if (event->modifiers().testFlag(Qt::ControlModifier)) m_rubberbandSelectionManipulator.select( - RubberBandSelectionManipulator::RemoveFromSelection); + LiveRubberBandSelectionManipulator::RemoveFromSelection); else if (event->modifiers().testFlag(Qt::ShiftModifier)) m_rubberbandSelectionManipulator.select( - RubberBandSelectionManipulator::AddToSelection); + LiveRubberBandSelectionManipulator::AddToSelection); else m_rubberbandSelectionManipulator.select( - RubberBandSelectionManipulator::ReplaceSelection); + LiveRubberBandSelectionManipulator::ReplaceSelection); } } } -void SelectionTool::hoverMoveEvent(QMouseEvent * event) +void LiveSelectionTool::hoverMoveEvent(QMouseEvent * event) { // ### commented out until move tool is re-enabled // QList itemList = view()->items(event->pos()); @@ -263,7 +263,7 @@ void SelectionTool::hoverMoveEvent(QMouseEvent * event) QDeclarativeViewObserverPrivate::get(observer())->clearHighlight(); } -void SelectionTool::mouseReleaseEvent(QMouseEvent *event) +void LiveSelectionTool::mouseReleaseEvent(QMouseEvent *event) { if (m_singleSelectionManipulator.isActive()) { m_singleSelectionManipulator.end(event->pos()); @@ -290,25 +290,25 @@ void SelectionTool::mouseReleaseEvent(QMouseEvent *event) if (event->modifiers().testFlag(Qt::ControlModifier)) m_rubberbandSelectionManipulator.select( - RubberBandSelectionManipulator::RemoveFromSelection); + LiveRubberBandSelectionManipulator::RemoveFromSelection); else if (event->modifiers().testFlag(Qt::ShiftModifier)) m_rubberbandSelectionManipulator.select( - RubberBandSelectionManipulator::AddToSelection); + LiveRubberBandSelectionManipulator::AddToSelection); else m_rubberbandSelectionManipulator.select( - RubberBandSelectionManipulator::ReplaceSelection); + LiveRubberBandSelectionManipulator::ReplaceSelection); m_rubberbandSelectionManipulator.end(); } } } -void SelectionTool::mouseDoubleClickEvent(QMouseEvent * /*event*/) +void LiveSelectionTool::mouseDoubleClickEvent(QMouseEvent * /*event*/) { } -void SelectionTool::keyPressEvent(QKeyEvent *event) +void LiveSelectionTool::keyPressEvent(QKeyEvent *event) { switch(event->key()) { case Qt::Key_Left: @@ -322,12 +322,12 @@ void SelectionTool::keyPressEvent(QKeyEvent *event) } } -void SelectionTool::keyReleaseEvent(QKeyEvent * /*keyEvent*/) +void LiveSelectionTool::keyReleaseEvent(QKeyEvent * /*keyEvent*/) { } -void SelectionTool::wheelEvent(QWheelEvent *event) +void LiveSelectionTool::wheelEvent(QWheelEvent *event) { if (event->orientation() == Qt::Horizontal || m_rubberbandSelectionMode) return; @@ -366,17 +366,17 @@ void SelectionTool::wheelEvent(QWheelEvent *event) } -void SelectionTool::setSelectOnlyContentItems(bool selectOnlyContentItems) +void LiveSelectionTool::setSelectOnlyContentItems(bool selectOnlyContentItems) { m_selectOnlyContentItems = selectOnlyContentItems; } -void SelectionTool::itemsAboutToRemoved(const QList &/*itemList*/) +void LiveSelectionTool::itemsAboutToRemoved(const QList &/*itemList*/) { } -void SelectionTool::clear() +void LiveSelectionTool::clear() { view()->setCursor(Qt::ArrowCursor); m_rubberbandSelectionManipulator.clear(), @@ -385,7 +385,7 @@ void SelectionTool::clear() //m_resizeIndicator.clear(); } -void SelectionTool::selectedItemsChanged(const QList &itemList) +void LiveSelectionTool::selectedItemsChanged(const QList &itemList) { foreach(QWeakPointer obj, m_selectedItemList) { if (!obj.isNull()) { @@ -413,12 +413,12 @@ void SelectionTool::selectedItemsChanged(const QList &itemList) //m_resizeIndicator.setItems(toGraphicsObjectList(itemList)); } -void SelectionTool::repaintBoundingRects() +void LiveSelectionTool::repaintBoundingRects() { m_selectionIndicator.setItems(m_selectedItemList); } -void SelectionTool::selectUnderPoint(QMouseEvent *event) +void LiveSelectionTool::selectUnderPoint(QMouseEvent *event) { m_singleSelectionManipulator.begin(event->pos()); diff --git a/share/qtcreator/qml/qmljsdebugger/editor/selectiontool.h b/share/qtcreator/qml/qmljsdebugger/editor/liveselectiontool.h similarity index 90% rename from share/qtcreator/qml/qmljsdebugger/editor/selectiontool.h rename to share/qtcreator/qml/qmljsdebugger/editor/liveselectiontool.h index 6f5a5a418a1..4248df5a5a6 100644 --- a/share/qtcreator/qml/qmljsdebugger/editor/selectiontool.h +++ b/share/qtcreator/qml/qmljsdebugger/editor/liveselectiontool.h @@ -31,8 +31,8 @@ ** **************************************************************************/ -#ifndef SELECTIONTOOL_H -#define SELECTIONTOOL_H +#ifndef LIVESELECTIONTOOL_H +#define LIVESELECTIONTOOL_H #include "abstractformeditortool.h" @@ -50,13 +50,13 @@ QT_FORWARD_DECLARE_CLASS(QAction) namespace QmlJSDebugger { -class SelectionTool : public AbstractFormEditorTool +class LiveSelectionTool : public AbstractLiveEditTool { Q_OBJECT public: - SelectionTool(QDeclarativeViewObserver* editorView); - ~SelectionTool(); + LiveSelectionTool(QDeclarativeViewObserver* editorView); + ~LiveSelectionTool(); void mousePressEvent(QMouseEvent *event); void mouseMoveEvent(QMouseEvent *event); @@ -96,9 +96,9 @@ private: private: bool m_rubberbandSelectionMode; - RubberBandSelectionManipulator m_rubberbandSelectionManipulator; + LiveRubberBandSelectionManipulator m_rubberbandSelectionManipulator; SingleSelectionManipulator m_singleSelectionManipulator; - SelectionIndicator m_selectionIndicator; + LiveSelectionIndicator m_selectionIndicator; //ResizeIndicator m_resizeIndicator; QTime m_mousePressTimer; bool m_selectOnlyContentItems; @@ -108,6 +108,6 @@ private: QList m_contextMenuItemList; }; -} +} // namespace QmlJSDebugger -#endif // SELECTIONTOOL_H +#endif // LIVESELECTIONTOOL_H diff --git a/share/qtcreator/qml/qmljsdebugger/editor/singleselectionmanipulator.cpp b/share/qtcreator/qml/qmljsdebugger/editor/livesingleselectionmanipulator.cpp similarity index 80% rename from share/qtcreator/qml/qmljsdebugger/editor/singleselectionmanipulator.cpp rename to share/qtcreator/qml/qmljsdebugger/editor/livesingleselectionmanipulator.cpp index 07fdc9b02b0..12825902a12 100644 --- a/share/qtcreator/qml/qmljsdebugger/editor/singleselectionmanipulator.cpp +++ b/share/qtcreator/qml/qmljsdebugger/editor/livesingleselectionmanipulator.cpp @@ -31,48 +31,48 @@ ** **************************************************************************/ -#include "singleselectionmanipulator.h" +#include "livesingleselectionmanipulator.h" #include "qdeclarativeviewobserver.h" #include "../qdeclarativeviewobserver_p.h" #include namespace QmlJSDebugger { -SingleSelectionManipulator::SingleSelectionManipulator(QDeclarativeViewObserver *editorView) +LiveSingleSelectionManipulator::LiveSingleSelectionManipulator(QDeclarativeViewObserver *editorView) : m_editorView(editorView), m_isActive(false) { } -void SingleSelectionManipulator::begin(const QPointF &beginPoint) +void LiveSingleSelectionManipulator::begin(const QPointF &beginPoint) { m_beginPoint = beginPoint; m_isActive = true; m_oldSelectionList = QDeclarativeViewObserverPrivate::get(m_editorView)->selectedItems(); } -void SingleSelectionManipulator::update(const QPointF &/*updatePoint*/) +void LiveSingleSelectionManipulator::update(const QPointF &/*updatePoint*/) { m_oldSelectionList.clear(); } -void SingleSelectionManipulator::clear() +void LiveSingleSelectionManipulator::clear() { m_beginPoint = QPointF(); m_oldSelectionList.clear(); } -void SingleSelectionManipulator::end(const QPointF &/*updatePoint*/) +void LiveSingleSelectionManipulator::end(const QPointF &/*updatePoint*/) { m_oldSelectionList.clear(); m_isActive = false; } -void SingleSelectionManipulator::select(SelectionType selectionType, - const QList &items, - bool /*selectOnlyContentItems*/) +void LiveSingleSelectionManipulator::select(SelectionType selectionType, + const QList &items, + bool /*selectOnlyContentItems*/) { QGraphicsItem *selectedItem = 0; @@ -120,7 +120,7 @@ void SingleSelectionManipulator::select(SelectionType selectionType, m_editorView->setSelectedItems(resultList); } -void SingleSelectionManipulator::select(SelectionType selectionType, bool selectOnlyContentItems) +void LiveSingleSelectionManipulator::select(SelectionType selectionType, bool selectOnlyContentItems) { QDeclarativeViewObserverPrivate *observerPrivate = QDeclarativeViewObserverPrivate::get(m_editorView); @@ -129,12 +129,12 @@ void SingleSelectionManipulator::select(SelectionType selectionType, bool select } -bool SingleSelectionManipulator::isActive() const +bool LiveSingleSelectionManipulator::isActive() const { return m_isActive; } -QPointF SingleSelectionManipulator::beginPoint() const +QPointF LiveSingleSelectionManipulator::beginPoint() const { return m_beginPoint; } diff --git a/share/qtcreator/qml/qmljsdebugger/editor/singleselectionmanipulator.h b/share/qtcreator/qml/qmljsdebugger/editor/livesingleselectionmanipulator.h similarity index 89% rename from share/qtcreator/qml/qmljsdebugger/editor/singleselectionmanipulator.h rename to share/qtcreator/qml/qmljsdebugger/editor/livesingleselectionmanipulator.h index 46ae285dbe5..a388f1f1bda 100644 --- a/share/qtcreator/qml/qmljsdebugger/editor/singleselectionmanipulator.h +++ b/share/qtcreator/qml/qmljsdebugger/editor/livesingleselectionmanipulator.h @@ -31,8 +31,8 @@ ** **************************************************************************/ -#ifndef SINGLESELECTIONMANIPULATOR_H -#define SINGLESELECTIONMANIPULATOR_H +#ifndef LIVESINGLESELECTIONMANIPULATOR_H +#define LIVESINGLESELECTIONMANIPULATOR_H #include #include @@ -43,10 +43,10 @@ namespace QmlJSDebugger { class QDeclarativeViewObserver; -class SingleSelectionManipulator +class LiveSingleSelectionManipulator { public: - SingleSelectionManipulator(QDeclarativeViewObserver *editorView); + LiveSingleSelectionManipulator(QDeclarativeViewObserver *editorView); enum SelectionType { ReplaceSelection, @@ -76,6 +76,6 @@ private: bool m_isActive; }; -} +} // namespace QmlJSDebugger -#endif // SINGLESELECTIONMANIPULATOR_H +#endif // LIVESINGLESELECTIONMANIPULATOR_H diff --git a/share/qtcreator/qml/qmljsdebugger/editor/qmltoolbar.cpp b/share/qtcreator/qml/qmljsdebugger/editor/qmltoolbar.cpp index 09f8029dad9..bcc66734318 100644 --- a/share/qtcreator/qml/qmljsdebugger/editor/qmltoolbar.cpp +++ b/share/qtcreator/qml/qmljsdebugger/editor/qmltoolbar.cpp @@ -363,4 +363,4 @@ void QmlToolbar::activateToQml() emit applyChangesToQmlFileSelected(); } -} +} // namespace QmlJSDebugger diff --git a/share/qtcreator/qml/qmljsdebugger/editor/subcomponenteditortool.cpp b/share/qtcreator/qml/qmljsdebugger/editor/subcomponenteditortool.cpp index 4413f2b498d..8c10b8ba2c9 100644 --- a/share/qtcreator/qml/qmljsdebugger/editor/subcomponenteditortool.cpp +++ b/share/qtcreator/qml/qmljsdebugger/editor/subcomponenteditortool.cpp @@ -49,7 +49,7 @@ namespace QmlJSDebugger { const qreal MaxOpacity = 0.5f; SubcomponentEditorTool::SubcomponentEditorTool(QDeclarativeViewObserver *view) - : AbstractFormEditorTool(view), + : AbstractLiveEditTool(view), m_animIncrement(0.05f), m_animTimer(new QTimer(this)) { diff --git a/share/qtcreator/qml/qmljsdebugger/editor/subcomponenteditortool.h b/share/qtcreator/qml/qmljsdebugger/editor/subcomponenteditortool.h index 8e662aec267..ba064cbea8a 100644 --- a/share/qtcreator/qml/qmljsdebugger/editor/subcomponenteditortool.h +++ b/share/qtcreator/qml/qmljsdebugger/editor/subcomponenteditortool.h @@ -46,7 +46,7 @@ namespace QmlJSDebugger { class SubcomponentMaskLayerItem; -class SubcomponentEditorTool : public AbstractFormEditorTool +class SubcomponentEditorTool : public AbstractLiveEditTool { Q_OBJECT diff --git a/share/qtcreator/qml/qmljsdebugger/editor/toolbarcolorbox.h b/share/qtcreator/qml/qmljsdebugger/editor/toolbarcolorbox.h index ffb6edab7c2..cea0e6ea59f 100644 --- a/share/qtcreator/qml/qmljsdebugger/editor/toolbarcolorbox.h +++ b/share/qtcreator/qml/qmljsdebugger/editor/toolbarcolorbox.h @@ -31,8 +31,8 @@ ** **************************************************************************/ -#ifndef ToolBarColorBox_H -#define ToolBarColorBox_H +#ifndef TOOLBARCOLORBOX_H +#define TOOLBARCOLORBOX_H #include #include @@ -66,9 +66,8 @@ private: QPoint m_dragBeginPoint; QAction *m_copyHexColor; QColor m_color; - }; } // namespace QmlJSDebugger -#endif // ToolBarColorBox_H +#endif // TOOLBARCOLORBOX_H diff --git a/share/qtcreator/qml/qmljsdebugger/editor/zoomtool.cpp b/share/qtcreator/qml/qmljsdebugger/editor/zoomtool.cpp index d5189187f61..67afa813716 100644 --- a/share/qtcreator/qml/qmljsdebugger/editor/zoomtool.cpp +++ b/share/qtcreator/qml/qmljsdebugger/editor/zoomtool.cpp @@ -46,7 +46,7 @@ namespace QmlJSDebugger { ZoomTool::ZoomTool(QDeclarativeViewObserver *view) : - AbstractFormEditorTool(view), + AbstractLiveEditTool(view), m_rubberbandManipulator(), m_smoothZoomMultiplier(0.05f), m_currentScale(1.0f) @@ -58,9 +58,9 @@ ZoomTool::ZoomTool(QDeclarativeViewObserver *view) : m_zoomOutAction->setShortcut(QKeySequence(Qt::Key_Minus)); - LayerItem *layerItem = QDeclarativeViewObserverPrivate::get(view)->manipulatorLayer; + LiveLayerItem *layerItem = QDeclarativeViewObserverPrivate::get(view)->manipulatorLayer; QGraphicsObject *layerObject = reinterpret_cast(layerItem); - m_rubberbandManipulator = new RubberBandSelectionManipulator(layerObject, view); + m_rubberbandManipulator = new LiveRubberBandSelectionManipulator(layerObject, view); connect(m_zoomTo100Action, SIGNAL(triggered()), SLOT(zoomTo100())); diff --git a/share/qtcreator/qml/qmljsdebugger/editor/zoomtool.h b/share/qtcreator/qml/qmljsdebugger/editor/zoomtool.h index dc5ddee64c0..0cdd5e15497 100644 --- a/share/qtcreator/qml/qmljsdebugger/editor/zoomtool.h +++ b/share/qtcreator/qml/qmljsdebugger/editor/zoomtool.h @@ -41,7 +41,7 @@ QT_FORWARD_DECLARE_CLASS(QAction); namespace QmlJSDebugger { -class ZoomTool : public AbstractFormEditorTool +class ZoomTool : public AbstractLiveEditTool { Q_OBJECT public: @@ -86,7 +86,7 @@ private: QAction *m_zoomTo100Action; QAction *m_zoomInAction; QAction *m_zoomOutAction; - RubberBandSelectionManipulator *m_rubberbandManipulator; + LiveRubberBandSelectionManipulator *m_rubberbandManipulator; qreal m_smoothZoomMultiplier; qreal m_currentScale; diff --git a/share/qtcreator/qml/qmljsdebugger/qdeclarativeviewobserver.cpp b/share/qtcreator/qml/qmljsdebugger/qdeclarativeviewobserver.cpp index 3eb33f5d7d3..69877219a4b 100644 --- a/share/qtcreator/qml/qmljsdebugger/qdeclarativeviewobserver.cpp +++ b/share/qtcreator/qml/qmljsdebugger/qdeclarativeviewobserver.cpp @@ -76,8 +76,8 @@ QDeclarativeViewObserver::QDeclarativeViewObserver(QDeclarativeView *view, QObje QObject(parent), data(new QDeclarativeViewObserverPrivate(this)) { data->view = view; - data->manipulatorLayer = new LayerItem(view->scene()); - data->selectionTool = new SelectionTool(this); + data->manipulatorLayer = new LiveLayerItem(view->scene()); + data->selectionTool = new LiveSelectionTool(this); data->zoomTool = new ZoomTool(this); data->colorPickerTool = new ColorPickerTool(this); data->boundingRectHighlighter = new BoundingRectHighlighter(this); @@ -269,7 +269,7 @@ bool QDeclarativeViewObserver::mouseMoveEvent(QMouseEvent *event) QList selItems = data->selectableItems(event->pos()); if (!selItems.isEmpty()) { - declarativeView()->setToolTip(AbstractFormEditorTool::titleForItem(selItems.first())); + declarativeView()->setToolTip(AbstractLiveEditTool::titleForItem(selItems.first())); } else { declarativeView()->setToolTip(QString()); } diff --git a/share/qtcreator/qml/qmljsdebugger/qdeclarativeviewobserver_p.h b/share/qtcreator/qml/qmljsdebugger/qdeclarativeviewobserver_p.h index 0cdfecb45ed..6a8b55ea09f 100644 --- a/share/qtcreator/qml/qmljsdebugger/qdeclarativeviewobserver_p.h +++ b/share/qtcreator/qml/qmljsdebugger/qdeclarativeviewobserver_p.h @@ -44,15 +44,15 @@ namespace QmlJSDebugger { class JSDebuggerAgent; class QDeclarativeViewObserver; -class SelectionTool; +class LiveSelectionTool; class ZoomTool; class ColorPickerTool; -class LayerItem; +class LiveLayerItem; class BoundingRectHighlighter; class SubcomponentEditorTool; class QmlToolbar; class CrumblePath; -class AbstractFormEditorTool; +class AbstractLiveEditTool; class QDeclarativeViewObserverPrivate { @@ -75,13 +75,13 @@ public: QList > currentSelection; Constants::DesignTool currentToolMode; - AbstractFormEditorTool *currentTool; + AbstractLiveEditTool *currentTool; - SelectionTool *selectionTool; + LiveSelectionTool *selectionTool; ZoomTool *zoomTool; ColorPickerTool *colorPickerTool; SubcomponentEditorTool *subcomponentEditorTool; - LayerItem *manipulatorLayer; + LiveLayerItem *manipulatorLayer; BoundingRectHighlighter *boundingRectHighlighter; diff --git a/share/qtcreator/qml/qmljsdebugger/qmljsdebugger-lib.pri b/share/qtcreator/qml/qmljsdebugger/qmljsdebugger-lib.pri index 7165e269bb3..fc303162734 100644 --- a/share/qtcreator/qml/qmljsdebugger/qmljsdebugger-lib.pri +++ b/share/qtcreator/qml/qmljsdebugger/qmljsdebugger-lib.pri @@ -27,13 +27,13 @@ contains(CONFIG, dll) { include/qdeclarativeviewobserver.h \ include/qdeclarativeobserverservice.h \ include/qmlobserverconstants.h \ - editor/abstractformeditortool.h \ - editor/selectiontool.h \ - editor/layeritem.h \ - editor/singleselectionmanipulator.h \ - editor/rubberbandselectionmanipulator.h \ - editor/selectionrectangle.h \ - editor/selectionindicator.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/subcomponenteditortool.h \ editor/subcomponentmasklayeritem.h \ @@ -46,13 +46,13 @@ contains(CONFIG, dll) { SOURCES += \ qdeclarativeviewobserver.cpp \ qdeclarativeobserverservice.cpp \ - editor/abstractformeditortool.cpp \ - editor/selectiontool.cpp \ - editor/layeritem.cpp \ - editor/singleselectionmanipulator.cpp \ - editor/rubberbandselectionmanipulator.cpp \ - editor/selectionrectangle.cpp \ - editor/selectionindicator.cpp \ + editor/abstractliveedittool.cpp \ + editor/liveselectiontool.cpp \ + editor/livelayeritem.cpp \ + editor/livesingleselectionmanipulator.cpp \ + editor/liverubberbandselectionmanipulator.cpp \ + editor/liveselectionrectangle.cpp \ + editor/liveselectionindicator.cpp \ editor/boundingrecthighlighter.cpp \ editor/subcomponenteditortool.cpp \ editor/subcomponentmasklayeritem.cpp \ diff --git a/src/plugins/qmljsinspector/qmljstoolbarcolorbox.h b/src/plugins/qmljsinspector/qmljstoolbarcolorbox.h index ac4d209ac20..16842fe45af 100644 --- a/src/plugins/qmljsinspector/qmljstoolbarcolorbox.h +++ b/src/plugins/qmljsinspector/qmljstoolbarcolorbox.h @@ -70,7 +70,6 @@ private: QColor m_borderColorOuter; QColor m_borderColorInner; - }; } // namespace QmlJSInspector