1 #ifndef QG_GRAPHICVIEW_H
2 #define QG_GRAPHICVIEW_H
5 #include "graphicview.h"
6 #include "rs_layerlistlistener.h"
7 #include "rs_blocklistlistener.h"
8 #include "qg_scrollbar.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 RS_GraphicView, //public Q3FilePreview,
21 class QG_GraphicView: public QWidget, public GraphicView, //public Q3FilePreview,
22 public RS_LayerListListener, public RS_BlockListListener
27 QG_GraphicView(QWidget * parent = 0, const char * name = 0, Qt::WindowFlags f = 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 // Methods from RS_LayerListListener Interface:
40 virtual void layerEdited(RS_Layer *);
41 virtual void layerRemoved(RS_Layer *);
42 virtual void layerToggled(RS_Layer *);
45 virtual void emulateMouseMoveEvent();
46 virtual void mousePressEvent(QMouseEvent * e);
47 virtual void mouseReleaseEvent(QMouseEvent * e);
48 virtual void mouseMoveEvent(QMouseEvent * e);
49 virtual void tabletEvent(QTabletEvent * e);
50 virtual void leaveEvent(QEvent *);
51 virtual void enterEvent(QEvent *);
52 virtual void focusInEvent(QFocusEvent *);
53 virtual void focusOutEvent(QFocusEvent *);
54 virtual void wheelEvent(QWheelEvent * e);
55 virtual void keyPressEvent(QKeyEvent * e);
56 virtual void keyReleaseEvent(QKeyEvent * e);
58 void paintEvent(QPaintEvent *);
59 virtual void resizeEvent(QResizeEvent * e);
61 #warning "!!! File preview needs porting to Qt4 !!!"
62 // void previewUrl(const Q3Url &u);
65 void slotHScrolled(int value);
66 void slotVScrolled(int value);
69 #warning "!!! Double buffering is not necessary anymore !!!"
70 //! Buffer for double-buffering
77 //! Horizontal scrollbar.
78 QG_ScrollBar * hScrollBar;
79 //! Vertical scrollbar.
80 QG_ScrollBar * vScrollBar;
81 //! Layout used to fit in the view and the scrollbars.
83 //! Label for grid spacing.
87 //! Delete mouse cursor
89 //! Select mouse cursor
91 //! Magnifying glass mouse cursor
92 QCursor * curMagnifier;