DI-Guy C++ SDK Reference  13.0
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
diguyQGraphicsProxyWidget.h
Go to the documentation of this file.
1 
2 #ifndef diguyQGraphicsProxyWidget_H
3 #define diguyQGraphicsProxyWidget_H
4 
5 #include <QtGui/QGraphicsView>
6 #include <QObject>
7 #include <QGraphicsProxyWidget>
8 #include <QList>
9 #include <QString>
10 
11 class QGraphicsRectItem;
12 class QGraphicsSimpleTextItem;
13 
15 class bdiQGraphicsView;
16 
17 #include <diguy_constants.h>
18 
19 
20 /****************************************************************************/
21 /*
22  A graphics proxy widget embeds a widget in a scene. An instance should only
23  be made by a factory function, which has a pointer to a graphics view instance.
24 */
25 class diguyQGraphicsProxyWidget : public QGraphicsProxyWidget
26 {
27  Q_OBJECT
28 
29 public:
30 
31  friend class bdiQGraphicsView;
32 
33  diguyQGraphicsProxyWidget(const char* name,
34  bdiQGraphicsView* view,
35  QGraphicsItem* parent = 0,
36  Qt::WindowFlags wFlags = 0,
37  int base_x = 10,
38  int base_y = 10,
39  int base_z = 50,
40  int base_w = 0,
41  int base_h = 0);
43 
44  void resizeEvent(QGraphicsSceneResizeEvent* event);
45 
46  const char* get_name() {return m_name.ascii();}
47 
48  void set_base_position(int base_x, int base_y);
49  void set_base_size(int base_w, int base_h);
50  void set_base_depth(int base_z);
51  void set_handle_own_justification( bool state ) { m_handle_own_justification = state; }
52 
53  int get_x() { return m_base_x; }
54  int get_y() { return m_base_y; }
55  int get_w() { return m_base_w; }
56  int get_h() { return m_base_h; }
57 
60  void update_position();
61 
62  signals:
64 
65 protected:
66  QString m_name;
67 
68  QGraphicsRectItem* m_item_title_bar;
69  QGraphicsSimpleTextItem* m_item_title_bar_text;
70 
72  int m_base_x;
73  int m_base_y;
74  int m_base_z;
75  int m_base_w;
76  int m_base_h;
77 
80 };
81 
82 
83 #endif // bdiQGraphicsView_H
84