diff -r 7a71a914afdb -r 6d2b32f305f9 mapeditor.h --- a/mapeditor.h Thu May 07 08:48:53 2009 +0000 +++ b/mapeditor.h Wed May 13 08:26:27 2009 +0000 @@ -4,6 +4,8 @@ #include #include +#include //! Not yet officially in Qt! + #include "attribute.h" #include "ornamentedobj.h" #include "settings.h" @@ -12,8 +14,11 @@ /*! \brief Main widget in vym to display and edit a map */ -class MapEditor : public QGraphicsView { + +class MapEditor : public QGraphicsView { Q_OBJECT + Q_PROPERTY(qreal zoomFactor READ getZoomFactor WRITE setZoomFactor) + Q_PROPERTY(QPointF scrollBarPos READ getScrollBarPos WRITE setScrollBarPos) public: MapEditor(VymModel *vm); @@ -21,6 +26,26 @@ VymModel* getModel(); QGraphicsScene * getScene(); +protected: + QPointF scrollBarPos; + QPointF scrollBarPosTarget; + QtPropertyAnimation scrollBarPosAnimation; +public: + void setScrollBarPosTarget (const QRectF &rect); //! ensureVisible of rect + QPointF getScrollBarPosTarget (); + void setScrollBarPos (const QPointF &p); + QPointF getScrollBarPos(); + +protected: + qreal zoomFactor; + qreal zoomFactorTarget; + QtPropertyAnimation zoomAnimation; +public: + void setZoomFactorTarget (const qreal &zf); + qreal getZoomFactorTarget(); + void setZoomFactor (const qreal &zf); + qreal getZoomFactor(); + public: void print(); //!< Print the map void setAntiAlias (bool); //!< Set or unset antialiasing