leocad/qt/lc_qglwidget.h

48 lines
1,012 B
C
Raw Normal View History

#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;
bool isView;
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
};