2017-07-19 14:20:32 -07:00
|
|
|
#pragma once
|
2013-08-09 04:57:18 +00:00
|
|
|
|
|
|
|
#include <QGLWidget>
|
|
|
|
class lcGLWidget;
|
|
|
|
|
|
|
|
class lcQGLWidget : public QGLWidget
|
|
|
|
{
|
|
|
|
public:
|
2016-12-28 13:30:31 -08:00
|
|
|
lcQGLWidget(QWidget *parent, lcGLWidget *owner, bool view);
|
2013-08-09 04:57:18 +00:00
|
|
|
~lcQGLWidget();
|
|
|
|
|
|
|
|
QSize sizeHint() const;
|
|
|
|
|
|
|
|
lcGLWidget *widget;
|
|
|
|
QSize preferredSize;
|
2018-01-12 10:50:25 -08:00
|
|
|
bool mIsView;
|
2013-08-09 04:57:18 +00:00
|
|
|
|
2014-04-08 01:04:32 +00:00
|
|
|
float deviceScale()
|
|
|
|
{
|
|
|
|
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
|
|
|
|
return windowHandle()->devicePixelRatio();
|
|
|
|
#else
|
|
|
|
return 1.0f;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2014-09-14 22:41:22 +00:00
|
|
|
QTimer mUpdateTimer;
|
|
|
|
|
2013-08-09 04:57:18 +00:00
|
|
|
protected:
|
|
|
|
void initializeGL();
|
|
|
|
void resizeGL(int x, int h);
|
|
|
|
void paintGL();
|
|
|
|
void keyPressEvent(QKeyEvent *event);
|
|
|
|
void keyReleaseEvent(QKeyEvent *event);
|
|
|
|
void mousePressEvent(QMouseEvent *event);
|
|
|
|
void mouseReleaseEvent(QMouseEvent *event);
|
2014-04-26 06:23:12 +00:00
|
|
|
void mouseDoubleClickEvent(QMouseEvent *event);
|
2013-08-09 04:57:18 +00:00
|
|
|
void mouseMoveEvent(QMouseEvent *event);
|
|
|
|
void wheelEvent(QWheelEvent *event);
|
|
|
|
void dragEnterEvent(QDragEnterEvent *event);
|
|
|
|
void dragLeaveEvent(QDragLeaveEvent *event);
|
|
|
|
void dragMoveEvent(QDragMoveEvent *event);
|
|
|
|
void dropEvent(QDropEvent *event);
|
2015-02-10 22:34:04 +00:00
|
|
|
|
|
|
|
int mWheelAccumulator;
|
2013-08-09 04:57:18 +00:00
|
|
|
};
|
|
|
|
|