QmlJSDebugger: Prefix live editor related classes

AbstractFormEditorTool -> AbstractLiveEditTool
LayerItem -> LiveLayerItem
SelectionIndicator -> LiveSelectionIndicator
SelectionRectangle -> LiveSelectionRectangle
SelectionTool -> LiveSelectionTool
SingleSelectionManipulator -> LiveSingleSelectionManipulator
RubberBandSelectionManipulator -> LiveRubberBandSelectionManipulator
This commit is contained in:
Thorbjørn Lindeijer
2011-02-09 16:59:43 +01:00
parent 350eaa5029
commit f9e65028fd
29 changed files with 182 additions and 228 deletions

View File

@@ -31,7 +31,7 @@
** **
**************************************************************************/ **************************************************************************/
#include "abstractformeditortool.h" #include "abstractliveedittool.h"
#include "qdeclarativeviewobserver.h" #include "qdeclarativeviewobserver.h"
#include "../qdeclarativeviewobserver_p.h" #include "../qdeclarativeviewobserver_p.h"
@@ -43,48 +43,48 @@
namespace QmlJSDebugger { namespace QmlJSDebugger {
AbstractFormEditorTool::AbstractFormEditorTool(QDeclarativeViewObserver *editorView) AbstractLiveEditTool::AbstractLiveEditTool(QDeclarativeViewObserver *editorView)
: QObject(editorView), m_observer(editorView) : QObject(editorView), m_observer(editorView)
{ {
} }
AbstractFormEditorTool::~AbstractFormEditorTool() AbstractLiveEditTool::~AbstractLiveEditTool()
{ {
} }
QDeclarativeViewObserver *AbstractFormEditorTool::observer() const QDeclarativeViewObserver *AbstractLiveEditTool::observer() const
{ {
return m_observer; return m_observer;
} }
QDeclarativeView *AbstractFormEditorTool::view() const QDeclarativeView *AbstractLiveEditTool::view() const
{ {
return m_observer->declarativeView(); return m_observer->declarativeView();
} }
QGraphicsScene* AbstractFormEditorTool::scene() const QGraphicsScene* AbstractLiveEditTool::scene() const
{ {
return view()->scene(); return view()->scene();
} }
void AbstractFormEditorTool::updateSelectedItems() void AbstractLiveEditTool::updateSelectedItems()
{ {
selectedItemsChanged(items()); selectedItemsChanged(items());
} }
QList<QGraphicsItem*> AbstractFormEditorTool::items() const QList<QGraphicsItem*> AbstractLiveEditTool::items() const
{ {
return observer()->selectedItems(); return observer()->selectedItems();
} }
void AbstractFormEditorTool::enterContext(QGraphicsItem *itemToEnter) void AbstractLiveEditTool::enterContext(QGraphicsItem *itemToEnter)
{ {
observer()->data->enterContext(itemToEnter); observer()->data->enterContext(itemToEnter);
} }
bool AbstractFormEditorTool::topItemIsMovable(const QList<QGraphicsItem*> & itemList) bool AbstractLiveEditTool::topItemIsMovable(const QList<QGraphicsItem*> & itemList)
{ {
QGraphicsItem *firstSelectableItem = topMovableGraphicsItem(itemList); QGraphicsItem *firstSelectableItem = topMovableGraphicsItem(itemList);
if (firstSelectableItem == 0) if (firstSelectableItem == 0)
@@ -100,7 +100,7 @@ bool AbstractFormEditorTool::topItemIsMovable(const QList<QGraphicsItem*> & item
} }
bool AbstractFormEditorTool::topSelectedItemIsMovable(const QList<QGraphicsItem*> &itemList) bool AbstractLiveEditTool::topSelectedItemIsMovable(const QList<QGraphicsItem*> &itemList)
{ {
QList<QGraphicsItem*> selectedItems = observer()->selectedItems(); QList<QGraphicsItem*> selectedItems = observer()->selectedItems();
@@ -116,17 +116,17 @@ bool AbstractFormEditorTool::topSelectedItemIsMovable(const QList<QGraphicsItem*
} }
bool AbstractFormEditorTool::topItemIsResizeHandle(const QList<QGraphicsItem*> &/*itemList*/) bool AbstractLiveEditTool::topItemIsResizeHandle(const QList<QGraphicsItem*> &/*itemList*/)
{ {
return false; return false;
} }
QDeclarativeItem *AbstractFormEditorTool::toQDeclarativeItem(QGraphicsItem *item) QDeclarativeItem *AbstractLiveEditTool::toQDeclarativeItem(QGraphicsItem *item)
{ {
return dynamic_cast<QDeclarativeItem*>(item->toGraphicsObject()); return dynamic_cast<QDeclarativeItem*>(item->toGraphicsObject());
} }
QGraphicsItem *AbstractFormEditorTool::topMovableGraphicsItem(const QList<QGraphicsItem*> &itemList) QGraphicsItem *AbstractLiveEditTool::topMovableGraphicsItem(const QList<QGraphicsItem*> &itemList)
{ {
foreach (QGraphicsItem *item, itemList) { foreach (QGraphicsItem *item, itemList) {
if (item->flags().testFlag(QGraphicsItem::ItemIsMovable)) if (item->flags().testFlag(QGraphicsItem::ItemIsMovable))
@@ -135,8 +135,8 @@ QGraphicsItem *AbstractFormEditorTool::topMovableGraphicsItem(const QList<QGraph
return 0; return 0;
} }
QDeclarativeItem *AbstractFormEditorTool::topMovableDeclarativeItem(const QList<QGraphicsItem*> QDeclarativeItem *AbstractLiveEditTool::topMovableDeclarativeItem(const QList<QGraphicsItem*>
&itemList) &itemList)
{ {
foreach (QGraphicsItem *item, itemList) { foreach (QGraphicsItem *item, itemList) {
QDeclarativeItem *declarativeItem = toQDeclarativeItem(item); QDeclarativeItem *declarativeItem = toQDeclarativeItem(item);
@@ -147,8 +147,8 @@ QDeclarativeItem *AbstractFormEditorTool::topMovableDeclarativeItem(const QList<
return 0; return 0;
} }
QList<QGraphicsObject*> AbstractFormEditorTool::toGraphicsObjectList(const QList<QGraphicsItem*> QList<QGraphicsObject*> AbstractLiveEditTool::toGraphicsObjectList(const QList<QGraphicsItem*>
&itemList) &itemList)
{ {
QList<QGraphicsObject*> gfxObjects; QList<QGraphicsObject*> gfxObjects;
foreach(QGraphicsItem *item, itemList) { foreach(QGraphicsItem *item, itemList) {
@@ -160,7 +160,7 @@ QList<QGraphicsObject*> AbstractFormEditorTool::toGraphicsObjectList(const QList
return gfxObjects; return gfxObjects;
} }
QString AbstractFormEditorTool::titleForItem(QGraphicsItem *item) QString AbstractLiveEditTool::titleForItem(QGraphicsItem *item)
{ {
QString className("QGraphicsItem"); QString className("QGraphicsItem");
QString objectStringId; QString objectStringId;

View File

@@ -31,8 +31,8 @@
** **
**************************************************************************/ **************************************************************************/
#ifndef ABSTRACTFORMEDITORTOOL_H #ifndef ABSTRACTLIVEEDITTOOL_H
#define ABSTRACTFORMEDITORTOOL_H #define ABSTRACTLIVEEDITTOOL_H
#include <QtCore/QList> #include <QtCore/QList>
#include <QtCore/QObject> #include <QtCore/QObject>
@@ -54,13 +54,13 @@ class QDeclarativeViewObserver;
class FormEditorView; class FormEditorView;
class AbstractFormEditorTool : public QObject class AbstractLiveEditTool : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
AbstractFormEditorTool(QDeclarativeViewObserver* observer); AbstractLiveEditTool(QDeclarativeViewObserver *observer);
virtual ~AbstractFormEditorTool(); virtual ~AbstractLiveEditTool();
virtual void mousePressEvent(QMouseEvent *event) = 0; virtual void mousePressEvent(QMouseEvent *event) = 0;
virtual void mouseMoveEvent(QMouseEvent *event) = 0; virtual void mouseMoveEvent(QMouseEvent *event) = 0;
@@ -105,4 +105,4 @@ private:
} }
#endif // ABSTRACTFORMEDITORTOOL_H #endif // ABSTRACTLIVEEDITTOOL_H

View File

@@ -83,7 +83,7 @@ int BoundingBoxPolygonItem::type() const
} }
BoundingRectHighlighter::BoundingRectHighlighter(QDeclarativeViewObserver *view) : BoundingRectHighlighter::BoundingRectHighlighter(QDeclarativeViewObserver *view) :
LayerItem(view->declarativeView()->scene()), LiveLayerItem(view->declarativeView()->scene()),
m_view(view), m_view(view),
m_animFrame(0) m_animFrame(0)
{ {

View File

@@ -50,7 +50,7 @@ namespace QmlJSDebugger {
class QDeclarativeViewObserver; class QDeclarativeViewObserver;
class BoundingBox; class BoundingBox;
class BoundingRectHighlighter : public LayerItem class BoundingRectHighlighter : public LiveLayerItem
{ {
Q_OBJECT Q_OBJECT
public: public:

View File

@@ -45,7 +45,7 @@
namespace QmlJSDebugger { namespace QmlJSDebugger {
ColorPickerTool::ColorPickerTool(QDeclarativeViewObserver *view) : ColorPickerTool::ColorPickerTool(QDeclarativeViewObserver *view) :
AbstractFormEditorTool(view) AbstractLiveEditTool(view)
{ {
m_selectedColor.setRgb(0,0,0); m_selectedColor.setRgb(0,0,0);
} }

View File

@@ -34,7 +34,7 @@
#ifndef COLORPICKERTOOL_H #ifndef COLORPICKERTOOL_H
#define COLORPICKERTOOL_H #define COLORPICKERTOOL_H
#include "abstractformeditortool.h" #include "abstractliveedittool.h"
#include <QtGui/QColor> #include <QtGui/QColor>
@@ -42,7 +42,7 @@ QT_FORWARD_DECLARE_CLASS(QPoint)
namespace QmlJSDebugger { namespace QmlJSDebugger {
class ColorPickerTool : public AbstractFormEditorTool class ColorPickerTool : public AbstractLiveEditTool
{ {
Q_OBJECT Q_OBJECT
public: public:
@@ -78,7 +78,6 @@ private:
private: private:
QColor m_selectedColor; QColor m_selectedColor;
}; };
} // namespace QmlJSDebugger } // namespace QmlJSDebugger

View File

@@ -1,41 +0,0 @@
#ifndef ToolBarColorBox_H
#define ToolBarColorBox_H
#include <QLabel>
#include <QColor>
#include <QPoint>
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

View File

@@ -31,14 +31,14 @@
** **
**************************************************************************/ **************************************************************************/
#include "layeritem.h" #include "livelayeritem.h"
#include "qmlobserverconstants.h" #include "qmlobserverconstants.h"
#include <QGraphicsScene> #include <QGraphicsScene>
namespace QmlJSDebugger { namespace QmlJSDebugger {
LayerItem::LayerItem(QGraphicsScene* scene) LiveLayerItem::LiveLayerItem(QGraphicsScene* scene)
: QGraphicsObject() : QGraphicsObject()
{ {
scene->addItem(this); scene->addItem(this);
@@ -46,31 +46,31 @@ LayerItem::LayerItem(QGraphicsScene* scene)
setFlag(QGraphicsItem::ItemIsMovable, false); setFlag(QGraphicsItem::ItemIsMovable, false);
} }
LayerItem::~LayerItem() LiveLayerItem::~LiveLayerItem()
{ {
} }
void LayerItem::paint(QPainter * /*painter*/, const QStyleOptionGraphicsItem * /*option*/, void LiveLayerItem::paint(QPainter * /*painter*/, const QStyleOptionGraphicsItem * /*option*/,
QWidget * /*widget*/) QWidget * /*widget*/)
{ {
} }
int LayerItem::type() const int LiveLayerItem::type() const
{ {
return Constants::EditorItemType; return Constants::EditorItemType;
} }
QRectF LayerItem::boundingRect() const QRectF LiveLayerItem::boundingRect() const
{ {
return childrenBoundingRect(); return childrenBoundingRect();
} }
QList<QGraphicsItem*> LayerItem::findAllChildItems() const QList<QGraphicsItem*> LiveLayerItem::findAllChildItems() const
{ {
return findAllChildItems(this); return findAllChildItems(this);
} }
QList<QGraphicsItem*> LayerItem::findAllChildItems(const QGraphicsItem *item) const QList<QGraphicsItem*> LiveLayerItem::findAllChildItems(const QGraphicsItem *item) const
{ {
QList<QGraphicsItem*> itemList(item->childItems()); QList<QGraphicsItem*> itemList(item->childItems());

View File

@@ -31,20 +31,18 @@
** **
**************************************************************************/ **************************************************************************/
#ifndef LAYERITEM_H #ifndef LIVELAYERITEM_H
#define LAYERITEM_H #define LIVELAYERITEM_H
#include <QtGui/QGraphicsObject> #include <QtGui/QGraphicsObject>
namespace QmlJSDebugger { namespace QmlJSDebugger {
class FormEditorScene; class LiveLayerItem : public QGraphicsObject
class LayerItem : public QGraphicsObject
{ {
public: public:
LayerItem(QGraphicsScene *scene); LiveLayerItem(QGraphicsScene *scene);
~LayerItem(); ~LiveLayerItem();
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
QWidget *widget = 0); QWidget *widget = 0);
QRectF boundingRect() const; QRectF boundingRect() const;
@@ -58,4 +56,4 @@ protected:
} }
#endif // LAYERITEM_H #endif // LIVELAYERITEM_H

View File

@@ -31,7 +31,7 @@
** **
**************************************************************************/ **************************************************************************/
#include "rubberbandselectionmanipulator.h" #include "liverubberbandselectionmanipulator.h"
#include "../qdeclarativeviewobserver_p.h" #include "../qdeclarativeviewobserver_p.h"
#include <QtGui/QGraphicsItem> #include <QtGui/QGraphicsItem>
@@ -40,8 +40,8 @@
namespace QmlJSDebugger { namespace QmlJSDebugger {
RubberBandSelectionManipulator::RubberBandSelectionManipulator(QGraphicsObject *layerItem, LiveRubberBandSelectionManipulator::LiveRubberBandSelectionManipulator(QGraphicsObject *layerItem,
QDeclarativeViewObserver *editorView) QDeclarativeViewObserver *editorView)
: m_selectionRectangleElement(layerItem), : m_selectionRectangleElement(layerItem),
m_editorView(editorView), m_editorView(editorView),
m_beginFormEditorItem(0), m_beginFormEditorItem(0),
@@ -50,7 +50,7 @@ RubberBandSelectionManipulator::RubberBandSelectionManipulator(QGraphicsObject *
m_selectionRectangleElement.hide(); m_selectionRectangleElement.hide();
} }
void RubberBandSelectionManipulator::clear() void LiveRubberBandSelectionManipulator::clear()
{ {
m_selectionRectangleElement.clear(); m_selectionRectangleElement.clear();
m_isActive = false; m_isActive = false;
@@ -59,8 +59,8 @@ void RubberBandSelectionManipulator::clear()
m_oldSelectionList.clear(); m_oldSelectionList.clear();
} }
QGraphicsItem *RubberBandSelectionManipulator::topFormEditorItem(const QList<QGraphicsItem*> QGraphicsItem *LiveRubberBandSelectionManipulator::topFormEditorItem(const QList<QGraphicsItem*>
&itemList) &itemList)
{ {
if (itemList.isEmpty()) if (itemList.isEmpty())
return 0; return 0;
@@ -68,7 +68,7 @@ QGraphicsItem *RubberBandSelectionManipulator::topFormEditorItem(const QList<QGr
return itemList.first(); return itemList.first();
} }
void RubberBandSelectionManipulator::begin(const QPointF& beginPoint) void LiveRubberBandSelectionManipulator::begin(const QPointF &beginPoint)
{ {
m_beginPoint = beginPoint; m_beginPoint = beginPoint;
m_selectionRectangleElement.setRect(m_beginPoint, m_beginPoint); m_selectionRectangleElement.setRect(m_beginPoint, m_beginPoint);
@@ -80,19 +80,19 @@ void RubberBandSelectionManipulator::begin(const QPointF& beginPoint)
m_oldSelectionList = m_editorView->selectedItems(); m_oldSelectionList = m_editorView->selectedItems();
} }
void RubberBandSelectionManipulator::update(const QPointF& updatePoint) void LiveRubberBandSelectionManipulator::update(const QPointF &updatePoint)
{ {
m_selectionRectangleElement.setRect(m_beginPoint, updatePoint); m_selectionRectangleElement.setRect(m_beginPoint, updatePoint);
} }
void RubberBandSelectionManipulator::end() void LiveRubberBandSelectionManipulator::end()
{ {
m_oldSelectionList.clear(); m_oldSelectionList.clear();
m_selectionRectangleElement.hide(); m_selectionRectangleElement.hide();
m_isActive = false; m_isActive = false;
} }
void RubberBandSelectionManipulator::select(SelectionType selectionType) void LiveRubberBandSelectionManipulator::select(SelectionType selectionType)
{ {
QDeclarativeViewObserverPrivate *observerPrivate QDeclarativeViewObserverPrivate *observerPrivate
= QDeclarativeViewObserverPrivate::get(m_editorView); = QDeclarativeViewObserverPrivate::get(m_editorView);
@@ -138,17 +138,17 @@ void RubberBandSelectionManipulator::select(SelectionType selectionType)
} }
void RubberBandSelectionManipulator::setItems(const QList<QGraphicsItem*> &itemList) void LiveRubberBandSelectionManipulator::setItems(const QList<QGraphicsItem*> &itemList)
{ {
m_itemList = itemList; m_itemList = itemList;
} }
QPointF RubberBandSelectionManipulator::beginPoint() const QPointF LiveRubberBandSelectionManipulator::beginPoint() const
{ {
return m_beginPoint; return m_beginPoint;
} }
bool RubberBandSelectionManipulator::isActive() const bool LiveRubberBandSelectionManipulator::isActive() const
{ {
return m_isActive; return m_isActive;
} }

View File

@@ -45,7 +45,7 @@ namespace QmlJSDebugger {
class QDeclarativeViewObserver; class QDeclarativeViewObserver;
class RubberBandSelectionManipulator class LiveRubberBandSelectionManipulator
{ {
public: public:
enum SelectionType { enum SelectionType {
@@ -54,8 +54,8 @@ public:
RemoveFromSelection RemoveFromSelection
}; };
RubberBandSelectionManipulator(QGraphicsObject *layerItem, LiveRubberBandSelectionManipulator(QGraphicsObject *layerItem,
QDeclarativeViewObserver *editorView); QDeclarativeViewObserver *editorView);
void setItems(const QList<QGraphicsItem*> &itemList); void setItems(const QList<QGraphicsItem*> &itemList);
@@ -77,7 +77,7 @@ protected:
private: private:
QList<QGraphicsItem*> m_itemList; QList<QGraphicsItem*> m_itemList;
QList<QGraphicsItem*> m_oldSelectionList; QList<QGraphicsItem*> m_oldSelectionList;
SelectionRectangle m_selectionRectangleElement; LiveSelectionRectangle m_selectionRectangleElement;
QPointF m_beginPoint; QPointF m_beginPoint;
QDeclarativeViewObserver *m_editorView; QDeclarativeViewObserver *m_editorView;
QGraphicsItem *m_beginFormEditorItem; QGraphicsItem *m_beginFormEditorItem;

View File

@@ -31,7 +31,7 @@
** **
**************************************************************************/ **************************************************************************/
#include "selectionindicator.h" #include "liveselectionindicator.h"
#include "../qdeclarativeviewobserver_p.h" #include "../qdeclarativeviewobserver_p.h"
#include "qmlobserverconstants.h" #include "qmlobserverconstants.h"
@@ -46,30 +46,30 @@
namespace QmlJSDebugger { namespace QmlJSDebugger {
SelectionIndicator::SelectionIndicator(QDeclarativeViewObserver *editorView, LiveSelectionIndicator::LiveSelectionIndicator(QDeclarativeViewObserver *editorView,
QGraphicsObject *layerItem) QGraphicsObject *layerItem)
: m_layerItem(layerItem), m_view(editorView) : m_layerItem(layerItem), m_view(editorView)
{ {
} }
SelectionIndicator::~SelectionIndicator() LiveSelectionIndicator::~LiveSelectionIndicator()
{ {
clear(); clear();
} }
void SelectionIndicator::show() void LiveSelectionIndicator::show()
{ {
foreach (QGraphicsPolygonItem *item, m_indicatorShapeHash.values()) foreach (QGraphicsPolygonItem *item, m_indicatorShapeHash.values())
item->show(); item->show();
} }
void SelectionIndicator::hide() void LiveSelectionIndicator::hide()
{ {
foreach (QGraphicsPolygonItem *item, m_indicatorShapeHash.values()) foreach (QGraphicsPolygonItem *item, m_indicatorShapeHash.values())
item->hide(); item->hide();
} }
void SelectionIndicator::clear() void LiveSelectionIndicator::clear()
{ {
if (!m_layerItem.isNull()) { if (!m_layerItem.isNull()) {
QHashIterator<QGraphicsItem*, QGraphicsPolygonItem *> iter(m_indicatorShapeHash); QHashIterator<QGraphicsItem*, QGraphicsPolygonItem *> 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 // ### remove this if statement when QTBUG-12172 gets fixed
if (item->boundingRect() != QRectF(0,0,0,0)) { if (item->boundingRect() != QRectF(0,0,0,0)) {
@@ -100,7 +100,7 @@ QPolygonF SelectionIndicator::addBoundingRectToPolygon(QGraphicsItem *item, QPol
return polygon; return polygon;
} }
void SelectionIndicator::setItems(const QList<QWeakPointer<QGraphicsObject> > &itemList) void LiveSelectionIndicator::setItems(const QList<QWeakPointer<QGraphicsObject> > &itemList)
{ {
clear(); clear();

View File

@@ -31,8 +31,8 @@
** **
**************************************************************************/ **************************************************************************/
#ifndef SELECTIONINDICATOR_H #ifndef LIVESELECTIONINDICATOR_H
#define SELECTIONINDICATOR_H #define LIVESELECTIONINDICATOR_H
#include <QtCore/QWeakPointer> #include <QtCore/QWeakPointer>
#include <QtCore/QHash> #include <QtCore/QHash>
@@ -48,11 +48,11 @@ namespace QmlJSDebugger {
class QDeclarativeViewObserver; class QDeclarativeViewObserver;
class SelectionIndicator class LiveSelectionIndicator
{ {
public: public:
SelectionIndicator(QDeclarativeViewObserver* editorView, QGraphicsObject *layerItem); LiveSelectionIndicator(QDeclarativeViewObserver* editorView, QGraphicsObject *layerItem);
~SelectionIndicator(); ~LiveSelectionIndicator();
void show(); void show();
void hide(); void hide();
@@ -73,4 +73,4 @@ private:
} }
#endif // SELECTIONINDICATOR_H #endif // LIVESELECTIONINDICATOR_H

View File

@@ -31,7 +31,7 @@
** **
**************************************************************************/ **************************************************************************/
#include "selectionrectangle.h" #include "liveselectionrectangle.h"
#include "qmlobserverconstants.h" #include "qmlobserverconstants.h"
#include <QtGui/QPen> #include <QtGui/QPen>
@@ -52,7 +52,7 @@ public:
int type() const { return Constants::EditorItemType; } int type() const { return Constants::EditorItemType; }
}; };
SelectionRectangle::SelectionRectangle(QGraphicsObject *layerItem) LiveSelectionRectangle::LiveSelectionRectangle(QGraphicsObject *layerItem)
: m_controlShape(new SelectionRectShape(layerItem)), : m_controlShape(new SelectionRectShape(layerItem)),
m_layerItem(layerItem) m_layerItem(layerItem)
{ {
@@ -60,32 +60,32 @@ SelectionRectangle::SelectionRectangle(QGraphicsObject *layerItem)
m_controlShape->setBrush(QColor(128, 128, 128, 50)); m_controlShape->setBrush(QColor(128, 128, 128, 50));
} }
SelectionRectangle::~SelectionRectangle() LiveSelectionRectangle::~LiveSelectionRectangle()
{ {
if (m_layerItem) if (m_layerItem)
m_layerItem.data()->scene()->removeItem(m_controlShape); m_layerItem.data()->scene()->removeItem(m_controlShape);
} }
void SelectionRectangle::clear() void LiveSelectionRectangle::clear()
{ {
hide(); hide();
} }
void SelectionRectangle::show() void LiveSelectionRectangle::show()
{ {
m_controlShape->show(); m_controlShape->show();
} }
void SelectionRectangle::hide() void LiveSelectionRectangle::hide()
{ {
m_controlShape->hide(); m_controlShape->hide();
} }
QRectF SelectionRectangle::rect() const QRectF LiveSelectionRectangle::rect() const
{ {
return m_controlShape->mapFromScene(m_controlShape->rect()).boundingRect(); return m_controlShape->mapFromScene(m_controlShape->rect()).boundingRect();
} }
void SelectionRectangle::setRect(const QPointF &firstPoint, void LiveSelectionRectangle::setRect(const QPointF &firstPoint,
const QPointF &secondPoint) const QPointF &secondPoint)
{ {
double firstX = std::floor(firstPoint.x()) + 0.5; double firstX = std::floor(firstPoint.x()) + 0.5;

View File

@@ -31,8 +31,8 @@
** **
**************************************************************************/ **************************************************************************/
#ifndef SELECTIONRECTANGLE_H #ifndef LIVESELECTIONRECTANGLE_H
#define SELECTIONRECTANGLE_H #define LIVESELECTIONRECTANGLE_H
#include <QtCore/QWeakPointer> #include <QtCore/QWeakPointer>
@@ -43,11 +43,11 @@ QT_FORWARD_DECLARE_CLASS(QRectF)
namespace QmlJSDebugger { namespace QmlJSDebugger {
class SelectionRectangle class LiveSelectionRectangle
{ {
public: public:
SelectionRectangle(QGraphicsObject *layerItem); LiveSelectionRectangle(QGraphicsObject *layerItem);
~SelectionRectangle(); ~LiveSelectionRectangle();
void show(); void show();
void hide(); void hide();
@@ -64,6 +64,6 @@ private:
QWeakPointer<QGraphicsObject> m_layerItem; QWeakPointer<QGraphicsObject> m_layerItem;
}; };
} } // namespace QmlJSDebugger
#endif // SELECTIONRECTANGLE_H #endif // LIVESELECTIONRECTANGLE_H

View File

@@ -31,7 +31,7 @@
** **
**************************************************************************/ **************************************************************************/
#include "selectiontool.h" #include "liveselectiontool.h"
#include "layeritem.h" #include "layeritem.h"
#include "../qdeclarativeviewobserver_p.h" #include "../qdeclarativeviewobserver_p.h"
@@ -51,8 +51,8 @@
namespace QmlJSDebugger { namespace QmlJSDebugger {
SelectionTool::SelectionTool(QDeclarativeViewObserver *editorView) : LiveSelectionTool::LiveSelectionTool(QDeclarativeViewObserver *editorView) :
AbstractFormEditorTool(editorView), AbstractLiveEditTool(editorView),
m_rubberbandSelectionMode(false), m_rubberbandSelectionMode(false),
m_rubberbandSelectionManipulator( m_rubberbandSelectionManipulator(
QDeclarativeViewObserverPrivate::get(editorView)->manipulatorLayer, editorView), 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; m_rubberbandSelectionMode = value;
} }
SingleSelectionManipulator::SelectionType SelectionTool::getSelectionType(Qt::KeyboardModifiers SingleSelectionManipulator::SelectionType LiveSelectionTool::getSelectionType(Qt::KeyboardModifiers
modifiers) modifiers)
{ {
SingleSelectionManipulator::SelectionType selectionType SingleSelectionManipulator::SelectionType selectionType
@@ -87,7 +87,7 @@ SingleSelectionManipulator::SelectionType SelectionTool::getSelectionType(Qt::Ke
return selectionType; return selectionType;
} }
bool SelectionTool::alreadySelected(const QList<QGraphicsItem*> &itemList) const bool LiveSelectionTool::alreadySelected(const QList<QGraphicsItem*> &itemList) const
{ {
QDeclarativeViewObserverPrivate *observerPrivate QDeclarativeViewObserverPrivate *observerPrivate
= QDeclarativeViewObserverPrivate::get(observer()); = QDeclarativeViewObserverPrivate::get(observer());
@@ -105,7 +105,7 @@ bool SelectionTool::alreadySelected(const QList<QGraphicsItem*> &itemList) const
return false; return false;
} }
void SelectionTool::mousePressEvent(QMouseEvent *event) void LiveSelectionTool::mousePressEvent(QMouseEvent *event)
{ {
QDeclarativeViewObserverPrivate *observerPrivate QDeclarativeViewObserverPrivate *observerPrivate
= QDeclarativeViewObserverPrivate::get(observer()); = QDeclarativeViewObserverPrivate::get(observer());
@@ -126,7 +126,7 @@ void SelectionTool::mousePressEvent(QMouseEvent *event)
} }
} }
void SelectionTool::createContextMenu(QList<QGraphicsItem*> itemList, QPoint globalPos) void LiveSelectionTool::createContextMenu(QList<QGraphicsItem*> itemList, QPoint globalPos)
{ {
if (!QDeclarativeViewObserverPrivate::get(observer())->mouseInsideContextItem()) if (!QDeclarativeViewObserverPrivate::get(observer())->mouseInsideContextItem())
return; return;
@@ -173,7 +173,7 @@ void SelectionTool::createContextMenu(QList<QGraphicsItem*> itemList, QPoint glo
m_contextMenuItemList.clear(); m_contextMenuItemList.clear();
} }
void SelectionTool::contextMenuElementSelected() void LiveSelectionTool::contextMenuElementSelected()
{ {
QAction *senderAction = static_cast<QAction*>(sender()); QAction *senderAction = static_cast<QAction*>(sender());
int itemListIndex = senderAction->data().toInt(); 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(); int itemListIndex = action->data().toInt();
if (itemListIndex >= 0 && itemListIndex < m_contextMenuItemList.length()) { 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()) { if (m_singleSelectionManipulator.isActive()) {
QPointF mouseMovementVector = m_singleSelectionManipulator.beginPoint() - event->pos(); QPointF mouseMovementVector = m_singleSelectionManipulator.beginPoint() - event->pos();
@@ -220,18 +220,18 @@ void SelectionTool::mouseMoveEvent(QMouseEvent *event)
if (event->modifiers().testFlag(Qt::ControlModifier)) if (event->modifiers().testFlag(Qt::ControlModifier))
m_rubberbandSelectionManipulator.select( m_rubberbandSelectionManipulator.select(
RubberBandSelectionManipulator::RemoveFromSelection); LiveRubberBandSelectionManipulator::RemoveFromSelection);
else if (event->modifiers().testFlag(Qt::ShiftModifier)) else if (event->modifiers().testFlag(Qt::ShiftModifier))
m_rubberbandSelectionManipulator.select( m_rubberbandSelectionManipulator.select(
RubberBandSelectionManipulator::AddToSelection); LiveRubberBandSelectionManipulator::AddToSelection);
else else
m_rubberbandSelectionManipulator.select( 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 // ### commented out until move tool is re-enabled
// QList<QGraphicsItem*> itemList = view()->items(event->pos()); // QList<QGraphicsItem*> itemList = view()->items(event->pos());
@@ -263,7 +263,7 @@ void SelectionTool::hoverMoveEvent(QMouseEvent * event)
QDeclarativeViewObserverPrivate::get(observer())->clearHighlight(); QDeclarativeViewObserverPrivate::get(observer())->clearHighlight();
} }
void SelectionTool::mouseReleaseEvent(QMouseEvent *event) void LiveSelectionTool::mouseReleaseEvent(QMouseEvent *event)
{ {
if (m_singleSelectionManipulator.isActive()) { if (m_singleSelectionManipulator.isActive()) {
m_singleSelectionManipulator.end(event->pos()); m_singleSelectionManipulator.end(event->pos());
@@ -290,25 +290,25 @@ void SelectionTool::mouseReleaseEvent(QMouseEvent *event)
if (event->modifiers().testFlag(Qt::ControlModifier)) if (event->modifiers().testFlag(Qt::ControlModifier))
m_rubberbandSelectionManipulator.select( m_rubberbandSelectionManipulator.select(
RubberBandSelectionManipulator::RemoveFromSelection); LiveRubberBandSelectionManipulator::RemoveFromSelection);
else if (event->modifiers().testFlag(Qt::ShiftModifier)) else if (event->modifiers().testFlag(Qt::ShiftModifier))
m_rubberbandSelectionManipulator.select( m_rubberbandSelectionManipulator.select(
RubberBandSelectionManipulator::AddToSelection); LiveRubberBandSelectionManipulator::AddToSelection);
else else
m_rubberbandSelectionManipulator.select( m_rubberbandSelectionManipulator.select(
RubberBandSelectionManipulator::ReplaceSelection); LiveRubberBandSelectionManipulator::ReplaceSelection);
m_rubberbandSelectionManipulator.end(); 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()) { switch(event->key()) {
case Qt::Key_Left: 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) if (event->orientation() == Qt::Horizontal || m_rubberbandSelectionMode)
return; return;
@@ -366,17 +366,17 @@ void SelectionTool::wheelEvent(QWheelEvent *event)
} }
void SelectionTool::setSelectOnlyContentItems(bool selectOnlyContentItems) void LiveSelectionTool::setSelectOnlyContentItems(bool selectOnlyContentItems)
{ {
m_selectOnlyContentItems = selectOnlyContentItems; m_selectOnlyContentItems = selectOnlyContentItems;
} }
void SelectionTool::itemsAboutToRemoved(const QList<QGraphicsItem*> &/*itemList*/) void LiveSelectionTool::itemsAboutToRemoved(const QList<QGraphicsItem*> &/*itemList*/)
{ {
} }
void SelectionTool::clear() void LiveSelectionTool::clear()
{ {
view()->setCursor(Qt::ArrowCursor); view()->setCursor(Qt::ArrowCursor);
m_rubberbandSelectionManipulator.clear(), m_rubberbandSelectionManipulator.clear(),
@@ -385,7 +385,7 @@ void SelectionTool::clear()
//m_resizeIndicator.clear(); //m_resizeIndicator.clear();
} }
void SelectionTool::selectedItemsChanged(const QList<QGraphicsItem*> &itemList) void LiveSelectionTool::selectedItemsChanged(const QList<QGraphicsItem*> &itemList)
{ {
foreach(QWeakPointer<QGraphicsObject> obj, m_selectedItemList) { foreach(QWeakPointer<QGraphicsObject> obj, m_selectedItemList) {
if (!obj.isNull()) { if (!obj.isNull()) {
@@ -413,12 +413,12 @@ void SelectionTool::selectedItemsChanged(const QList<QGraphicsItem*> &itemList)
//m_resizeIndicator.setItems(toGraphicsObjectList(itemList)); //m_resizeIndicator.setItems(toGraphicsObjectList(itemList));
} }
void SelectionTool::repaintBoundingRects() void LiveSelectionTool::repaintBoundingRects()
{ {
m_selectionIndicator.setItems(m_selectedItemList); m_selectionIndicator.setItems(m_selectedItemList);
} }
void SelectionTool::selectUnderPoint(QMouseEvent *event) void LiveSelectionTool::selectUnderPoint(QMouseEvent *event)
{ {
m_singleSelectionManipulator.begin(event->pos()); m_singleSelectionManipulator.begin(event->pos());

View File

@@ -31,8 +31,8 @@
** **
**************************************************************************/ **************************************************************************/
#ifndef SELECTIONTOOL_H #ifndef LIVESELECTIONTOOL_H
#define SELECTIONTOOL_H #define LIVESELECTIONTOOL_H
#include "abstractformeditortool.h" #include "abstractformeditortool.h"
@@ -50,13 +50,13 @@ QT_FORWARD_DECLARE_CLASS(QAction)
namespace QmlJSDebugger { namespace QmlJSDebugger {
class SelectionTool : public AbstractFormEditorTool class LiveSelectionTool : public AbstractLiveEditTool
{ {
Q_OBJECT Q_OBJECT
public: public:
SelectionTool(QDeclarativeViewObserver* editorView); LiveSelectionTool(QDeclarativeViewObserver* editorView);
~SelectionTool(); ~LiveSelectionTool();
void mousePressEvent(QMouseEvent *event); void mousePressEvent(QMouseEvent *event);
void mouseMoveEvent(QMouseEvent *event); void mouseMoveEvent(QMouseEvent *event);
@@ -96,9 +96,9 @@ private:
private: private:
bool m_rubberbandSelectionMode; bool m_rubberbandSelectionMode;
RubberBandSelectionManipulator m_rubberbandSelectionManipulator; LiveRubberBandSelectionManipulator m_rubberbandSelectionManipulator;
SingleSelectionManipulator m_singleSelectionManipulator; SingleSelectionManipulator m_singleSelectionManipulator;
SelectionIndicator m_selectionIndicator; LiveSelectionIndicator m_selectionIndicator;
//ResizeIndicator m_resizeIndicator; //ResizeIndicator m_resizeIndicator;
QTime m_mousePressTimer; QTime m_mousePressTimer;
bool m_selectOnlyContentItems; bool m_selectOnlyContentItems;
@@ -108,6 +108,6 @@ private:
QList<QGraphicsItem*> m_contextMenuItemList; QList<QGraphicsItem*> m_contextMenuItemList;
}; };
} } // namespace QmlJSDebugger
#endif // SELECTIONTOOL_H #endif // LIVESELECTIONTOOL_H

View File

@@ -31,48 +31,48 @@
** **
**************************************************************************/ **************************************************************************/
#include "singleselectionmanipulator.h" #include "livesingleselectionmanipulator.h"
#include "qdeclarativeviewobserver.h" #include "qdeclarativeviewobserver.h"
#include "../qdeclarativeviewobserver_p.h" #include "../qdeclarativeviewobserver_p.h"
#include <QtDebug> #include <QtDebug>
namespace QmlJSDebugger { namespace QmlJSDebugger {
SingleSelectionManipulator::SingleSelectionManipulator(QDeclarativeViewObserver *editorView) LiveSingleSelectionManipulator::LiveSingleSelectionManipulator(QDeclarativeViewObserver *editorView)
: m_editorView(editorView), : m_editorView(editorView),
m_isActive(false) m_isActive(false)
{ {
} }
void SingleSelectionManipulator::begin(const QPointF &beginPoint) void LiveSingleSelectionManipulator::begin(const QPointF &beginPoint)
{ {
m_beginPoint = beginPoint; m_beginPoint = beginPoint;
m_isActive = true; m_isActive = true;
m_oldSelectionList = QDeclarativeViewObserverPrivate::get(m_editorView)->selectedItems(); m_oldSelectionList = QDeclarativeViewObserverPrivate::get(m_editorView)->selectedItems();
} }
void SingleSelectionManipulator::update(const QPointF &/*updatePoint*/) void LiveSingleSelectionManipulator::update(const QPointF &/*updatePoint*/)
{ {
m_oldSelectionList.clear(); m_oldSelectionList.clear();
} }
void SingleSelectionManipulator::clear() void LiveSingleSelectionManipulator::clear()
{ {
m_beginPoint = QPointF(); m_beginPoint = QPointF();
m_oldSelectionList.clear(); m_oldSelectionList.clear();
} }
void SingleSelectionManipulator::end(const QPointF &/*updatePoint*/) void LiveSingleSelectionManipulator::end(const QPointF &/*updatePoint*/)
{ {
m_oldSelectionList.clear(); m_oldSelectionList.clear();
m_isActive = false; m_isActive = false;
} }
void SingleSelectionManipulator::select(SelectionType selectionType, void LiveSingleSelectionManipulator::select(SelectionType selectionType,
const QList<QGraphicsItem*> &items, const QList<QGraphicsItem*> &items,
bool /*selectOnlyContentItems*/) bool /*selectOnlyContentItems*/)
{ {
QGraphicsItem *selectedItem = 0; QGraphicsItem *selectedItem = 0;
@@ -120,7 +120,7 @@ void SingleSelectionManipulator::select(SelectionType selectionType,
m_editorView->setSelectedItems(resultList); m_editorView->setSelectedItems(resultList);
} }
void SingleSelectionManipulator::select(SelectionType selectionType, bool selectOnlyContentItems) void LiveSingleSelectionManipulator::select(SelectionType selectionType, bool selectOnlyContentItems)
{ {
QDeclarativeViewObserverPrivate *observerPrivate = QDeclarativeViewObserverPrivate *observerPrivate =
QDeclarativeViewObserverPrivate::get(m_editorView); 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; return m_isActive;
} }
QPointF SingleSelectionManipulator::beginPoint() const QPointF LiveSingleSelectionManipulator::beginPoint() const
{ {
return m_beginPoint; return m_beginPoint;
} }

View File

@@ -31,8 +31,8 @@
** **
**************************************************************************/ **************************************************************************/
#ifndef SINGLESELECTIONMANIPULATOR_H #ifndef LIVESINGLESELECTIONMANIPULATOR_H
#define SINGLESELECTIONMANIPULATOR_H #define LIVESINGLESELECTIONMANIPULATOR_H
#include <QtCore/QPointF> #include <QtCore/QPointF>
#include <QtCore/QList> #include <QtCore/QList>
@@ -43,10 +43,10 @@ namespace QmlJSDebugger {
class QDeclarativeViewObserver; class QDeclarativeViewObserver;
class SingleSelectionManipulator class LiveSingleSelectionManipulator
{ {
public: public:
SingleSelectionManipulator(QDeclarativeViewObserver *editorView); LiveSingleSelectionManipulator(QDeclarativeViewObserver *editorView);
enum SelectionType { enum SelectionType {
ReplaceSelection, ReplaceSelection,
@@ -76,6 +76,6 @@ private:
bool m_isActive; bool m_isActive;
}; };
} } // namespace QmlJSDebugger
#endif // SINGLESELECTIONMANIPULATOR_H #endif // LIVESINGLESELECTIONMANIPULATOR_H

View File

@@ -363,4 +363,4 @@ void QmlToolbar::activateToQml()
emit applyChangesToQmlFileSelected(); emit applyChangesToQmlFileSelected();
} }
} } // namespace QmlJSDebugger

View File

@@ -49,7 +49,7 @@ namespace QmlJSDebugger {
const qreal MaxOpacity = 0.5f; const qreal MaxOpacity = 0.5f;
SubcomponentEditorTool::SubcomponentEditorTool(QDeclarativeViewObserver *view) SubcomponentEditorTool::SubcomponentEditorTool(QDeclarativeViewObserver *view)
: AbstractFormEditorTool(view), : AbstractLiveEditTool(view),
m_animIncrement(0.05f), m_animIncrement(0.05f),
m_animTimer(new QTimer(this)) m_animTimer(new QTimer(this))
{ {

View File

@@ -46,7 +46,7 @@ namespace QmlJSDebugger {
class SubcomponentMaskLayerItem; class SubcomponentMaskLayerItem;
class SubcomponentEditorTool : public AbstractFormEditorTool class SubcomponentEditorTool : public AbstractLiveEditTool
{ {
Q_OBJECT Q_OBJECT

View File

@@ -31,8 +31,8 @@
** **
**************************************************************************/ **************************************************************************/
#ifndef ToolBarColorBox_H #ifndef TOOLBARCOLORBOX_H
#define ToolBarColorBox_H #define TOOLBARCOLORBOX_H
#include <QtGui/QLabel> #include <QtGui/QLabel>
#include <QtGui/QColor> #include <QtGui/QColor>
@@ -66,9 +66,8 @@ private:
QPoint m_dragBeginPoint; QPoint m_dragBeginPoint;
QAction *m_copyHexColor; QAction *m_copyHexColor;
QColor m_color; QColor m_color;
}; };
} // namespace QmlJSDebugger } // namespace QmlJSDebugger
#endif // ToolBarColorBox_H #endif // TOOLBARCOLORBOX_H

View File

@@ -46,7 +46,7 @@
namespace QmlJSDebugger { namespace QmlJSDebugger {
ZoomTool::ZoomTool(QDeclarativeViewObserver *view) : ZoomTool::ZoomTool(QDeclarativeViewObserver *view) :
AbstractFormEditorTool(view), AbstractLiveEditTool(view),
m_rubberbandManipulator(), m_rubberbandManipulator(),
m_smoothZoomMultiplier(0.05f), m_smoothZoomMultiplier(0.05f),
m_currentScale(1.0f) m_currentScale(1.0f)
@@ -58,9 +58,9 @@ ZoomTool::ZoomTool(QDeclarativeViewObserver *view) :
m_zoomOutAction->setShortcut(QKeySequence(Qt::Key_Minus)); m_zoomOutAction->setShortcut(QKeySequence(Qt::Key_Minus));
LayerItem *layerItem = QDeclarativeViewObserverPrivate::get(view)->manipulatorLayer; LiveLayerItem *layerItem = QDeclarativeViewObserverPrivate::get(view)->manipulatorLayer;
QGraphicsObject *layerObject = reinterpret_cast<QGraphicsObject *>(layerItem); QGraphicsObject *layerObject = reinterpret_cast<QGraphicsObject *>(layerItem);
m_rubberbandManipulator = new RubberBandSelectionManipulator(layerObject, view); m_rubberbandManipulator = new LiveRubberBandSelectionManipulator(layerObject, view);
connect(m_zoomTo100Action, SIGNAL(triggered()), SLOT(zoomTo100())); connect(m_zoomTo100Action, SIGNAL(triggered()), SLOT(zoomTo100()));

View File

@@ -41,7 +41,7 @@ QT_FORWARD_DECLARE_CLASS(QAction);
namespace QmlJSDebugger { namespace QmlJSDebugger {
class ZoomTool : public AbstractFormEditorTool class ZoomTool : public AbstractLiveEditTool
{ {
Q_OBJECT Q_OBJECT
public: public:
@@ -86,7 +86,7 @@ private:
QAction *m_zoomTo100Action; QAction *m_zoomTo100Action;
QAction *m_zoomInAction; QAction *m_zoomInAction;
QAction *m_zoomOutAction; QAction *m_zoomOutAction;
RubberBandSelectionManipulator *m_rubberbandManipulator; LiveRubberBandSelectionManipulator *m_rubberbandManipulator;
qreal m_smoothZoomMultiplier; qreal m_smoothZoomMultiplier;
qreal m_currentScale; qreal m_currentScale;

View File

@@ -76,8 +76,8 @@ QDeclarativeViewObserver::QDeclarativeViewObserver(QDeclarativeView *view, QObje
QObject(parent), data(new QDeclarativeViewObserverPrivate(this)) QObject(parent), data(new QDeclarativeViewObserverPrivate(this))
{ {
data->view = view; data->view = view;
data->manipulatorLayer = new LayerItem(view->scene()); data->manipulatorLayer = new LiveLayerItem(view->scene());
data->selectionTool = new SelectionTool(this); data->selectionTool = new LiveSelectionTool(this);
data->zoomTool = new ZoomTool(this); data->zoomTool = new ZoomTool(this);
data->colorPickerTool = new ColorPickerTool(this); data->colorPickerTool = new ColorPickerTool(this);
data->boundingRectHighlighter = new BoundingRectHighlighter(this); data->boundingRectHighlighter = new BoundingRectHighlighter(this);
@@ -269,7 +269,7 @@ bool QDeclarativeViewObserver::mouseMoveEvent(QMouseEvent *event)
QList<QGraphicsItem*> selItems = data->selectableItems(event->pos()); QList<QGraphicsItem*> selItems = data->selectableItems(event->pos());
if (!selItems.isEmpty()) { if (!selItems.isEmpty()) {
declarativeView()->setToolTip(AbstractFormEditorTool::titleForItem(selItems.first())); declarativeView()->setToolTip(AbstractLiveEditTool::titleForItem(selItems.first()));
} else { } else {
declarativeView()->setToolTip(QString()); declarativeView()->setToolTip(QString());
} }

View File

@@ -44,15 +44,15 @@ namespace QmlJSDebugger {
class JSDebuggerAgent; class JSDebuggerAgent;
class QDeclarativeViewObserver; class QDeclarativeViewObserver;
class SelectionTool; class LiveSelectionTool;
class ZoomTool; class ZoomTool;
class ColorPickerTool; class ColorPickerTool;
class LayerItem; class LiveLayerItem;
class BoundingRectHighlighter; class BoundingRectHighlighter;
class SubcomponentEditorTool; class SubcomponentEditorTool;
class QmlToolbar; class QmlToolbar;
class CrumblePath; class CrumblePath;
class AbstractFormEditorTool; class AbstractLiveEditTool;
class QDeclarativeViewObserverPrivate class QDeclarativeViewObserverPrivate
{ {
@@ -75,13 +75,13 @@ public:
QList<QWeakPointer<QGraphicsObject> > currentSelection; QList<QWeakPointer<QGraphicsObject> > currentSelection;
Constants::DesignTool currentToolMode; Constants::DesignTool currentToolMode;
AbstractFormEditorTool *currentTool; AbstractLiveEditTool *currentTool;
SelectionTool *selectionTool; LiveSelectionTool *selectionTool;
ZoomTool *zoomTool; ZoomTool *zoomTool;
ColorPickerTool *colorPickerTool; ColorPickerTool *colorPickerTool;
SubcomponentEditorTool *subcomponentEditorTool; SubcomponentEditorTool *subcomponentEditorTool;
LayerItem *manipulatorLayer; LiveLayerItem *manipulatorLayer;
BoundingRectHighlighter *boundingRectHighlighter; BoundingRectHighlighter *boundingRectHighlighter;

View File

@@ -27,13 +27,13 @@ contains(CONFIG, dll) {
include/qdeclarativeviewobserver.h \ include/qdeclarativeviewobserver.h \
include/qdeclarativeobserverservice.h \ include/qdeclarativeobserverservice.h \
include/qmlobserverconstants.h \ include/qmlobserverconstants.h \
editor/abstractformeditortool.h \ editor/abstractliveedittool.h \
editor/selectiontool.h \ editor/liveselectiontool.h \
editor/layeritem.h \ editor/livelayeritem.h \
editor/singleselectionmanipulator.h \ editor/livesingleselectionmanipulator.h \
editor/rubberbandselectionmanipulator.h \ editor/liverubberbandselectionmanipulator.h \
editor/selectionrectangle.h \ editor/liveselectionrectangle.h \
editor/selectionindicator.h \ editor/liveselectionindicator.h \
editor/boundingrecthighlighter.h \ editor/boundingrecthighlighter.h \
editor/subcomponenteditortool.h \ editor/subcomponenteditortool.h \
editor/subcomponentmasklayeritem.h \ editor/subcomponentmasklayeritem.h \
@@ -46,13 +46,13 @@ contains(CONFIG, dll) {
SOURCES += \ SOURCES += \
qdeclarativeviewobserver.cpp \ qdeclarativeviewobserver.cpp \
qdeclarativeobserverservice.cpp \ qdeclarativeobserverservice.cpp \
editor/abstractformeditortool.cpp \ editor/abstractliveedittool.cpp \
editor/selectiontool.cpp \ editor/liveselectiontool.cpp \
editor/layeritem.cpp \ editor/livelayeritem.cpp \
editor/singleselectionmanipulator.cpp \ editor/livesingleselectionmanipulator.cpp \
editor/rubberbandselectionmanipulator.cpp \ editor/liverubberbandselectionmanipulator.cpp \
editor/selectionrectangle.cpp \ editor/liveselectionrectangle.cpp \
editor/selectionindicator.cpp \ editor/liveselectionindicator.cpp \
editor/boundingrecthighlighter.cpp \ editor/boundingrecthighlighter.cpp \
editor/subcomponenteditortool.cpp \ editor/subcomponenteditortool.cpp \
editor/subcomponentmasklayeritem.cpp \ editor/subcomponentmasklayeritem.cpp \

View File

@@ -70,7 +70,6 @@ private:
QColor m_borderColorOuter; QColor m_borderColorOuter;
QColor m_borderColorInner; QColor m_borderColorInner;
}; };
} // namespace QmlJSInspector } // namespace QmlJSInspector