UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
qzq_area.hpp
1 /* qzq_area.hpp */
2 /* $Id: qzq_area.hpp 20080 2009-12-15 15:57:52Z vlad $ */
3 #ifndef __qzq_area_hpp
4 #define __qzq_area_hpp
5 
6 #include <QWidget>
7 #include <QTimer>
8 #include <QPixmap>
9 
10 #include "zq_object.hpp"
11 #include "zqb_pixgroup.hpp"
12 #include "zqb_placeholder.hpp"
13 #include "zqb_natgrpmember.hpp"
14 
15 #include "zqb_long_job_processor.hpp"
16 
17 class QzqDynamicTip;
18 class QMainWindow;
19 class QzqAreaPainter;
20 
43 class QzqArea : public QWidget, public ZqbLongJobProcessor
44 {
45  Q_OBJECT
46 
47  friend class QzqAreaPainter;
48 
49 public:
50 
52  QzqArea (QWidget *parent = NULL, const char* name = NULL, Qt::WFlags f = 0);
53 
55  virtual ~QzqArea ();
56 
58  void setDrawable(const bool drawable = true) {m_drawable = drawable;}
59 
60 
61  /*
62  * Built-in placeholder container
63  */
64 
68 
71  const ZqbPlaceholder* placeholder () const;
72 
73 
74  /*
75  * Visible functionality (small difference from ZqbVisible)
76  */
77 
82  virtual void redraw (bool bForce = false,
83  QPaintDevice* pdev = NULL);
84 
88  virtual void redrawOnSetCoord (ZqbNatGroup* pNatGrp);
89 
94  virtual bool isHardcopy () const;
95 
96 
98  virtual ZqbEventHint input (QEvent* qev);
99 
105  virtual bool updateGeometry (QPainter* paint = NULL,
106  bool bForce = false,
107  QRect *pCustomRect = NULL);
108 
113  virtual bool tip (const QPoint& p,
114  QString& qsShort, QString& qsLong);
115 
116 
123  virtual void interactiveRedraw ();
124 
125 
129  DrawAll,
132  };
133 
136 
138  void setDrawObjectSelection (const DrawObjectSelection &mode);
139 
142  QMainWindow* getMainWindow () const;
143 
145  void setBackgroundColor(const QColor &color) {m_bg_color = color;}
146 
148  const QColor& getBackgroundColor() const {return m_bg_color;}
149 
150 
152  virtual void startLongJob() const;
153  virtual void finishLongJob() const;
154  virtual void longJobProgerss(double progress);
155 
156 signals:
157 
159  void toolTipDelivered(const QString& qsShort, const QString& qsLong);
160 
161 protected slots:
162 
164  void resizeEventTimeout();
165 
166 protected:
167 
168  /*
169  * Built-in placeholder and related functionality
170  */
171 
174 
177 
180 
184 
187 
189  QPainter m_qPainter;
190 
192  QColor m_bg_color;
193 
195  QPixmap m_qPixBuf;
196 
199 
201  ZqbNatGrpMembers m_vObservers;
202 
206  QPixmap m_qStaticPixBuf;
207 
211 
214 
215  /*
216  * Event processing
217  */
218  virtual void mousePressEvent (QMouseEvent* qev);
219  virtual void mouseReleaseEvent (QMouseEvent* qev);
220  virtual void mouseDoubleClickEvent (QMouseEvent* qev);
221  virtual void mouseMoveEvent (QMouseEvent* qev);
222  virtual void wheelEvent (QWheelEvent* qev);
223  virtual void keyPressEvent (QKeyEvent* qev);
224  virtual void keyReleaseEvent (QKeyEvent* qev);
225  virtual void enterEvent (QEvent* qev);
226  virtual void leaveEvent (QEvent* qev);
227  virtual void resizeEvent (QResizeEvent* qev);
228  virtual void paintEvent (QPaintEvent* qev);
229  virtual bool event (QEvent* qev);
230 
231 private:
232 
234  QzqAreaPainter *mp_area_painter;
235 
237  mutable QTimer m_timer;
238 
239  void redraw_impl(bool bForce = false,
240  QPaintDevice *pd = NULL);
241 
242  void interactiveRedraw_impl();
243 };
244 
245 #endif /* qzq_area.hpp */
ZqbPixGroup m_pgy
Definition: qzq_area.hpp:142
void setDrawable(const bool drawable=true)
Definition: qzq_area.hpp:58
ZqbPixGroup m_pgx
Definition: qzq_area.hpp:139
ZqObject * m_pGrabber
Definition: qzq_area.hpp:149
virtual void redrawOnSetCoord(ZqbNatGroup *pNatGrp)
void toolTipDelivered(const QString &qsShort, const QString &qsLong)
QPixmap m_qPixBuf
Definition: qzq_area.hpp:158
QzqArea(QWidget *parent=NULL, const char *name=NULL, WFlags f=0)
Definition: qzq_area.hpp:125
void setDrawObjectSelection(const DrawObjectSelection &mode)
Definition: zqb_long_job_processor.hpp:8
ZqbNatGrpMembers m_vObservers
Definition: qzq_area.hpp:164
virtual bool updateGeometry(QPainter *paint=NULL, bool bForce=false, QRect *pCustomRect=NULL)
Definition: qzq_area.hpp:126
Definition: zqb_natgroup.hpp:35
DrawObjectSelection m_eDrawObjectSelection
Definition: qzq_area.hpp:177
Definition: zqb_placeholder.hpp:25
void resizeEventTimeout()
DrawObjectSelection getDrawObjectSelection() const
void setBackgroundColor(const QColor &color)
Definition: qzq_area.hpp:145
QPainter m_qPainter
Definition: qzq_area.hpp:155
ZqbPlaceholder * placeholder()
bool m_drawable
Definition: qzq_area.hpp:213
QzqDynamicTip * m_qDynTip
Definition: qzq_area.hpp:161
virtual void startLongJob() const
virtual ~QzqArea()
virtual void interactiveRedraw()
const QColor & getBackgroundColor() const
Definition: qzq_area.hpp:148
virtual void finishLongJob() const
virtual void redraw(bool bForce=false, QPaintDevice *pdev=NULL, QRect *pCustomRect=NULL, bool bHardcopy=false)
Definition: zqb_container.hpp:23
QPixmap m_qStaticPixBuf
Definition: qzq_area.hpp:173
Definition: qzq_area.hpp:39
QMainWindow * getMainWindow() const
virtual bool tip(const QPoint &p, QString &qsShort, QString &qsLong)
virtual bool isHardcopy() const
Definition: zq_object.hpp:36
virtual ZqbEventHint input(QEvent *qev)
Definition: qzq_dynamic_tip.hpp:15
DrawObjectSelection
Definition: qzq_area.hpp:123
ZqbPlaceholder m_AreaPh
Definition: qzq_area.hpp:152
ZqbContainer m_Container
Definition: qzq_area.hpp:145
Definition: qzq_area.hpp:124
Definition: zqb_pixgroup.hpp:34
QColor m_bg_color
Definition: qzq_area.hpp:192