diff --git a/src/tools/qml/qmlobserver/qdeclarativedesignview.h b/src/tools/qml/qmlobserver/qdeclarativedesignview.h deleted file mode 100644 index b9e8d5fb682b41f88c4c4245c8c0d46154edc0c3..0000000000000000000000000000000000000000 --- a/src/tools/qml/qmlobserver/qdeclarativedesignview.h +++ /dev/null @@ -1,137 +0,0 @@ -#ifndef QDECLARATIVEDESIGNVIEW_H -#define QDECLARATIVEDESIGNVIEW_H - -#include "qmlviewerconstants.h" -#include <qdeclarativeview.h> -#include <QWeakPointer> - -QT_FORWARD_DECLARE_CLASS(QDeclarativeItem); -QT_FORWARD_DECLARE_CLASS(QMouseEvent); -QT_FORWARD_DECLARE_CLASS(QToolBar); - -namespace QmlViewer { - -class AbstractFormEditorTool; -class SelectionTool; -class ZoomTool; -class ColorPickerTool; -class LayerItem; -class BoundingRectHighlighter; -class SubcomponentEditorTool; -class QmlToolbar; -class CrumblePath; - -class QDeclarativeDesignView : public QDeclarativeView -{ - Q_OBJECT -public: - enum ContextFlags { - IgnoreContext, - ContextSensitive - }; - - explicit QDeclarativeDesignView(QWidget *parent = 0); - ~QDeclarativeDesignView(); - - void setSelectedItems(QList<QGraphicsItem *> items); - QList<QGraphicsItem *> selectedItems(); - AbstractFormEditorTool *currentTool() const; - - LayerItem *manipulatorLayer() const; - void changeTool(Constants::DesignTool tool, - Constants::ToolFlags flags = Constants::NoToolFlags); - - void clearHighlight(); - void highlight(QList<QGraphicsItem *> item, ContextFlags flags = ContextSensitive); - void highlight(QGraphicsItem *item, ContextFlags flags = ContextSensitive); - - bool mouseInsideContextItem() const; - bool isEditorItem(QGraphicsItem *item) const; - - QList<QGraphicsItem*> selectableItems(const QPoint &pos) const; - QList<QGraphicsItem*> selectableItems(const QPointF &scenePos) const; - QList<QGraphicsItem*> selectableItems(const QRectF &sceneRect, Qt::ItemSelectionMode selectionMode) const; - QGraphicsItem *currentRootItem() const; - - CrumblePath *crumblePathWidget() const; - QToolBar *toolbar() const; - static QString idStringForObject(QObject *obj); - QRectF adjustToScreenBoundaries(const QRectF &boundingRectInSceneSpace); - -public Q_SLOTS: - void setDesignModeBehavior(bool value); - bool designModeBehavior() const; - void changeToSingleSelectTool(); - void changeToMarqueeSelectTool(); - void changeToZoomTool(); - void changeToColorPickerTool(); - - void changeAnimationSpeed(qreal slowdownFactor); - void continueExecution(qreal slowdownFactor = 1.0f); - void pauseExecution(); - -Q_SIGNALS: - void designModeBehaviorChanged(bool inDesignMode); - void reloadRequested(); - void marqueeSelectToolActivated(); - void selectToolActivated(); - void zoomToolActivated(); - void colorPickerActivated(); - void selectedColorChanged(const QColor &color); - - void executionStarted(qreal slowdownFactor); - void executionPaused(); - -protected: - void leaveEvent(QEvent *); - void mousePressEvent(QMouseEvent *event); - void mouseMoveEvent(QMouseEvent *event); - void mouseReleaseEvent(QMouseEvent *event); - void keyPressEvent(QKeyEvent *event); - void keyReleaseEvent(QKeyEvent *keyEvent); - void mouseDoubleClickEvent(QMouseEvent *event); - void wheelEvent(QWheelEvent *event); - -private Q_SLOTS: - void reloadView(); - void onStatusChanged(QDeclarativeView::Status status); - void onCurrentObjectsChanged(QList<QObject*> objects); - void applyChangesFromClient(); - void createQmlObject(const QString &qml, QObject *parent, - const QStringList &imports, const QString &filename = QString()); - -private: - void clearEditorItems(); - void createToolbar(); - void changeToSelectTool(); - QList<QGraphicsItem*> filterForCurrentContext(QList<QGraphicsItem*> &itemlist) const; - QList<QGraphicsItem*> filterForSelection(QList<QGraphicsItem*> &itemlist) const; - - -private: - QPointF m_cursorPos; - QList<QWeakPointer<QGraphicsObject> > m_currentSelection; - - Constants::DesignTool m_currentToolMode; - AbstractFormEditorTool *m_currentTool; - - SelectionTool *m_selectionTool; - ZoomTool *m_zoomTool; - ColorPickerTool *m_colorPickerTool; - SubcomponentEditorTool *m_subcomponentEditorTool; - LayerItem *m_manipulatorLayer; - - BoundingRectHighlighter *m_boundingRectHighlighter; - - bool m_designModeBehavior; - - bool m_executionPaused; - qreal m_slowdownFactor; - - QmlToolbar *m_toolbar; - CrumblePath *m_crumblePath; -}; - -} //namespace QmlViewer - -#endif // QDECLARATIVEDESIGNVIEW_H