diff -r 5db8dfd30ea2 -r c2a05fa925a1 mapeditor.h --- a/mapeditor.h Thu Nov 23 16:18:26 2006 +0000 +++ b/mapeditor.h Fri Dec 08 20:18:56 2006 +0000 @@ -1,8 +1,8 @@ #ifndef MAPEDITOR_H #define MAPEDITOR_H -#include #include +#include #include "mapcenterobj.h" #include "file.h" @@ -10,22 +10,24 @@ #include "selection.h" #include "settings.h" +class Q3NetworkOperation; +class Q3UrlOperator; -class MapEditor : public Q3CanvasView , public xmlObj { +class MapEditor : public QGraphicsView, public xmlObj { Q_OBJECT public: - MapEditor(QWidget* parent=0, const char* name=0, Qt::WFlags f=0); + MapEditor(QWidget* parent=0); ~MapEditor(); MapCenterObj* getMapCenter(); - Q3Canvas* getCanvas(); + QGraphicsScene * getScene(); void adjustCanvasSize();// adjust canvas size to map and scrollview bool isRepositionBlocked(); // block while load or undo private: QString getName(LinkableMapObj*); // Get e.g. heading or filename void makeTmpDirs(); // create temporary directories - QString saveToDir(const QString&,const QString &,bool, const QPoint &,LinkableMapObj*); + QString saveToDir(const QString&,const QString &,bool, const QPointF &,LinkableMapObj*); void saveStateChangingPart (LinkableMapObj *, LinkableMapObj *, const QString &, const QString &); void saveStateRemovingPart (LinkableMapObj *, const QString &); void saveState(LinkableMapObj *, const QString &, LinkableMapObj *, const QString &, const QString &); @@ -37,12 +39,11 @@ void addFloatImageInt(const QPixmap &img); private slots: -//FIXME not needed QT4 void fetchImage(const QString &img); -//FIXME not needed QT4 void imageDataFetched(const QByteArray &, Q3NetworkOperation *); -//FIXME not needed QT4 void imageDataFinished(Q3NetworkOperation *); + void fetchImage(const QString &img); + void imageDataFetched(const QByteArray &, Q3NetworkOperation *); + void imageDataFinished(Q3NetworkOperation *); public: - void toggleHistoryWindow(); bool isDefault(); // false, if map was changed once bool isUnsaved(); // save necessary bool hasChanged(); // undo possible @@ -60,6 +61,8 @@ void setZipped(bool); // save map zipped bool saveZipped(); // 1 if file will be saved zipped void print(); // print canvas + void setAntiAlias (bool); + void setSmoothPixmap(bool); private: QPixmap getPixmap(); void setHideTmpMode (HideTmpMode); // temporary hide stuff @@ -116,6 +119,8 @@ void selectRightBranch(); void selectFirstBranch(); void selectLastBranch(); + void selectMapBackgroundImage(); + void setMapBackgroundImage(const QString &); void selectMapBackgroundColor(); void setMapBackgroundColor(QColor); QColor getMapBackgroundColor(); @@ -180,18 +185,18 @@ protected: void ensureSelectionVisible(); virtual void updateViewCenter(); // needed for zooming - virtual void contentsContextMenuEvent ( QContextMenuEvent *e ); + virtual void contextMenuEvent ( QContextMenuEvent *e ); virtual void keyPressEvent(QKeyEvent*); virtual void keyReleaseEvent(QKeyEvent*); - virtual void contentsMousePressEvent(QMouseEvent*); - virtual void contentsMouseReleaseEvent(QMouseEvent*); - virtual void contentsMouseDoubleClickEvent(QMouseEvent*); - virtual void contentsMouseMoveEvent(QMouseEvent*); + virtual void mousePressEvent(QMouseEvent*); + virtual void mouseReleaseEvent(QMouseEvent*); + virtual void mouseDoubleClickEvent(QMouseEvent*); + virtual void mouseMoveEvent(QMouseEvent*); - virtual void contentsDragEnterEvent(QDragEnterEvent *event); + virtual void contentsDragEnterEvent(QDragEnterEvent *event); virtual void contentsDropEvent(QDropEvent *event); private: - Q3Canvas* mapCanvas; + QGraphicsScene *mapScene; MapCenterObj* mapCenter; bool adjustCanvasRequested; // collect requests until end of user event @@ -217,12 +222,12 @@ LinkableMapObj* selectionLast; // last selection MapObj* movingObj; // moving a MapObj MapObj* linkingObj_src; // part of a link - QPoint movingObj_orgPos; // org. pos of mouse before move - QPoint movingObj_orgRelPos; // org. relative pos of mouse before move - QPoint movingObj_start; // rel. pos of mouse to absPos - QPoint movingCont_start; // inital pos of moving Content or - QPoint movingVec; // how far has Content moved - QPoint movingCenter; // used when zooming + QPointF movingObj_orgPos; // org. pos of mouse before move + QPointF movingObj_orgRelPos; // org. relative pos of mouse before move + QPointF movingObj_start; // rel. pos of mouse to absPos + QPointF movingCont_start; // inital pos of moving Content or + QPointF movingVec; // how far has Content moved + QPointF movingCenter; // used when zooming QPrinter* printer; // Printing bool mapDefault; // Flag if map is untouched