1.1 --- a/mapeditor.h Thu May 07 08:48:53 2009 +0000
1.2 +++ b/mapeditor.h Wed May 13 08:26:27 2009 +0000
1.3 @@ -4,6 +4,8 @@
1.4 #include <QGraphicsView>
1.5 #include <QItemSelectionModel>
1.6
1.7 +#include <QtPropertyAnimation> //! Not yet officially in Qt!
1.8 +
1.9 #include "attribute.h"
1.10 #include "ornamentedobj.h"
1.11 #include "settings.h"
1.12 @@ -12,8 +14,11 @@
1.13
1.14 /*! \brief Main widget in vym to display and edit a map */
1.15
1.16 -class MapEditor : public QGraphicsView {
1.17 +
1.18 +class MapEditor : public QGraphicsView {
1.19 Q_OBJECT
1.20 + Q_PROPERTY(qreal zoomFactor READ getZoomFactor WRITE setZoomFactor)
1.21 + Q_PROPERTY(QPointF scrollBarPos READ getScrollBarPos WRITE setScrollBarPos)
1.22
1.23 public:
1.24 MapEditor(VymModel *vm);
1.25 @@ -21,6 +26,26 @@
1.26 VymModel* getModel();
1.27 QGraphicsScene * getScene();
1.28
1.29 +protected:
1.30 + QPointF scrollBarPos;
1.31 + QPointF scrollBarPosTarget;
1.32 + QtPropertyAnimation scrollBarPosAnimation;
1.33 +public:
1.34 + void setScrollBarPosTarget (const QRectF &rect); //! ensureVisible of rect
1.35 + QPointF getScrollBarPosTarget ();
1.36 + void setScrollBarPos (const QPointF &p);
1.37 + QPointF getScrollBarPos();
1.38 +
1.39 +protected:
1.40 + qreal zoomFactor;
1.41 + qreal zoomFactorTarget;
1.42 + QtPropertyAnimation zoomAnimation;
1.43 +public:
1.44 + void setZoomFactorTarget (const qreal &zf);
1.45 + qreal getZoomFactorTarget();
1.46 + void setZoomFactor (const qreal &zf);
1.47 + qreal getZoomFactor();
1.48 +
1.49 public:
1.50 void print(); //!< Print the map
1.51 void setAntiAlias (bool); //!< Set or unset antialiasing