1 #ifndef QG_GRAPHICVIEW_H
2 #define QG_GRAPHICVIEW_H
5 #include "graphicview.h"
6 #include "rs_layerlistlistener.h"
7 #include "rs_blocklistlistener.h"
14 * This is the Qt implementation of a widget which can view a
17 * Instances of this class can be linked to layer lists using
18 * addLayerListListener().
20 class QG_GraphicView: public QWidget, public GraphicView//, //public Q3FilePreview,
21 // public RS_LayerListListener, public RS_BlockListListener
26 QG_GraphicView(QWidget * parent = 0, const char * name = 0, Qt::WindowFlags f = 0);
27 QG_GraphicView(RS_Document * doc, QWidget * parent = 0);
28 virtual ~QG_GraphicView();
30 virtual int getWidth();
31 virtual int getHeight();
32 virtual void redraw();
33 virtual void adjustOffsetControls();
34 virtual void adjustZoomControls();
35 virtual void setBackground(const RS_Color & bg);
36 virtual void setMouseCursor(RS2::CursorType c);
37 virtual void updateGridStatusWidget(const QString & text);
39 // This is just crap. Why have a klunky listener interface when we have slots/signals???
40 // That's what I thought!!!
41 // Methods from RS_LayerListListener Interface:
42 // virtual void layerEdited(RS_Layer *);
43 // virtual void layerRemoved(RS_Layer *);
44 // virtual void layerToggled(RS_Layer *);
47 virtual void emulateMouseMoveEvent();
48 virtual void mousePressEvent(QMouseEvent * e);
49 virtual void mouseReleaseEvent(QMouseEvent * e);
50 virtual void mouseMoveEvent(QMouseEvent * e);
51 virtual void tabletEvent(QTabletEvent * e);
52 virtual void leaveEvent(QEvent *);
53 virtual void enterEvent(QEvent *);
54 virtual void focusInEvent(QFocusEvent *);
55 virtual void focusOutEvent(QFocusEvent *);
56 virtual void wheelEvent(QWheelEvent * e);
57 virtual void keyPressEvent(QKeyEvent * e);
58 virtual void keyReleaseEvent(QKeyEvent * e);
60 void paintEvent(QPaintEvent *);
61 virtual void resizeEvent(QResizeEvent * e);
63 #warning "!!! File preview needs porting to Qt4 !!!"
64 // void previewUrl(const Q3Url &u);
67 void CommonInitialization(void);
70 void slotHScrolled(int value);
71 void slotVScrolled(int value);
74 //#warning "!!! Double buffering is not necessary anymore !!!"
75 // //! Buffer for double-buffering
83 //! Horizontal scrollbar.
84 QScrollBar * hScrollBar;
85 //! Vertical scrollbar.
86 QScrollBar * vScrollBar;
87 //! Layout used to fit in the view and the scrollbars.
89 //! Label for grid spacing.
93 //! Delete mouse cursor
95 //! Select mouse cursor
97 //! Magnifying glass mouse cursor
98 QCursor * curMagnifier;