QtMainWindowWidget.h
Go to the documentation of this file.
1 // ****************************************************************************
2 // Filename: QtMainWindowWidget.h
3 // Author: Florian Hecht
4 // Date: 2008
5 // ****************************************************************************
6 
7 
8 #ifndef _QT_MAIN_WINDOW_WIDGET_H_
9 #define _QT_MAIN_WINDOW_WIDGET_H_
10 
11 
12 // ****************************************************************************
13 // Includes
14 // ****************************************************************************
15 
16 #include <qwidget.h>
17 
18 
19 // ****************************************************************************
20 // Forward declarations
21 // ****************************************************************************
22 
23 class CQtMainWindow;
24 class CByteImage;
25 
26 
27 // ****************************************************************************
28 // Enums
29 // ****************************************************************************
30 
32 {
33  eImage = 0,
41 };
42 
43 
44 
45 // ****************************************************************************
46 // CQtMainWindowWidget
47 // ****************************************************************************
48 
49 class CQtMainWindowWidget : public QObject
50 {
51  Q_OBJECT
52 
53 public:
56 
57 public slots:
58  void Clicked();
59  void ValueChanged(int value);
60  void Toggled(bool flag);
61  void TextChanged(const QString &str);
62 
63 public:
66  QWidget *m_widget;
67 };
68 
69 class CQtImageWidget : public QWidget, public CQtMainWindowWidget
70 {
71 public:
72  CQtImageWidget(CQtMainWindow *main_window, QWidget *pParent = 0);
73  ~CQtImageWidget();
74 
75  void SetImage(const CByteImage *pImage);
76 private:
77  void paintEvent(QPaintEvent *pPaintEvent);
78  void mousePressEvent(QMouseEvent *e);
79  void mouseReleaseEvent(QMouseEvent *e);
80  void mouseMoveEvent(QMouseEvent *e);
81  void keyPressEvent(QKeyEvent *e);
82  void keyReleaseEvent(QKeyEvent *e);
83 
84  int m_nWidth;
85  int m_nHeight;
86  unsigned char *m_pBuffer;
87 
93 };
94 
95 
96 
97 #ifdef USE_OPENGL
98 
99 #include <qgl.h>
100 
101 // ****************************************************************************
102 // CQtGLWidget
103 // ****************************************************************************
104 
105 class CQtGLWidget : public QGLWidget, public CQtMainWindowWidget
106 {
107 public:
108  CQtGLWidget(CQtMainWindow *main_window, QWidget *pParent = 0);
109  ~CQtGLWidget();
110 
111 private:
112  void mousePressEvent(QMouseEvent *e);
113  void mouseReleaseEvent(QMouseEvent *e);
114  void mouseMoveEvent(QMouseEvent *e);
115  void keyPressEvent(QKeyEvent *e);
116  void keyReleaseEvent(QKeyEvent *e);
117 };
118 
119 #endif
120 
121 
122 #endif /* _QT_MAIN_WINDOW_WIDGET_H_ */
void TextChanged(const QString &str)
CQtMainWindowWidget(CQtMainWindow *main_window, QtWidgetType type)
Data structure for the representation of 8-bit grayscale images and 24-bit RGB (or HSV) color images ...
Definition: ByteImage.h:80
GLuint GLuint GLsizei GLenum type
Definition: glext.h:3121
QtWidgetType
GLsizei const GLfloat * value
Definition: glext.h:3538
unsigned char * m_pBuffer
CQtMainWindow * m_main_window
void ValueChanged(int value)


asr_ivt
Author(s): Allgeyer Tobias, Hutmacher Robin, Kleinert Daniel, Meißner Pascal, Scholz Jonas, Stöckle Patrick
autogenerated on Mon Dec 2 2019 03:47:28