17 :
public QOpenGLWidget,
protected QOpenGLFunctions
20 Q_PROPERTY(
double ZoomFactor READ GetZoomFactor WRITE SetZoomFactor)
42 KeepAspectRationToWindow = 6,
45 void SetAdaptWindows(ADAPT_WINDOWS aw = Original);
46 ADAPT_WINDOWS GetAdaptWindows();
55 double GetZoomFactor()
const;
56 int SetZoomFactor(
double newZoomFactor);
57 QSize GetDesktopSize();
59 virtual int Load(QSettings &set);
60 virtual int Save(QSettings &set);
62 virtual QImage GrabImage(
int x = 0,
int y = 0,
int w = -1,
int h = -1);
70 void slotSetDesktopSize(
int width,
int height);
75 void slotSetName(
const QString& szName);
81 void slotUpdateRect(
const QRect& r,
const QImage& image);
82 void slotUpdateRect(QSharedPointer<CImage> image);
87 void slotUpdateCursor(
const QCursor& cursor);
92 void slotUpdateCursorPosition(
const QPoint& pos);
93 void slotSystemCombination();
96 void sigMousePressEvent(Qt::MouseButtons, QPoint);
97 void sigMouseReleaseEvent(Qt::MouseButton, QPoint);
98 void sigMouseMoveEvent(Qt::MouseButtons buttons, QPoint pos);
99 void sigMouseMoveEvent(QMouseEvent *event);
100 void sigWheelEvent(Qt::MouseButtons buttons, QPoint pos, QPoint angleDelta);
101 void sigKeyPressEvent(
int key, Qt::KeyboardModifiers modify);
102 void sigKeyReleaseEvent(
int key, Qt::KeyboardModifiers modify);
106 virtual void initializeGL()
override;
107 virtual void resizeGL(
int w,
int height)
override;
108 virtual void paintGL()
override;
110 virtual void mousePressEvent(QMouseEvent *event)
override;
111 virtual void mouseReleaseEvent(QMouseEvent *event)
override;
112 virtual void mouseMoveEvent(QMouseEvent *event)
override;
113 virtual void wheelEvent(QWheelEvent *event)
override;
114 virtual void keyPressEvent(QKeyEvent *event)
override;
115 virtual void keyReleaseEvent(QKeyEvent *event)
override;
122 QOpenGLVertexArrayObject m_VaoQuad;
123 QOpenGLBuffer m_VboQuad;
124 QOpenGLShaderProgram m_ShaderProgram;
125 QVector<GLfloat> m_VertexData;
127 QOpenGLTexture* m_pTexture;
129 ADAPT_WINDOWS m_AdaptWindows;
130 double m_dbZoomFactor;
132 int ReSize(
int width,
int height);
133 int TranslationMousePoint(QPointF inPos, QPointF &outPos);
134 QRectF GetAspectRationRect();