leocad/qt/lc_qglwidget.h

48 lines
1,013 B
C
Raw Normal View History

#pragma once
2013-08-09 06:57:18 +02:00
#include <QGLWidget>
class lcGLWidget;
class lcQGLWidget : public QGLWidget
{
public:
2016-12-28 22:30:31 +01:00
lcQGLWidget(QWidget *parent, lcGLWidget *owner, bool view);
2013-08-09 06:57:18 +02:00
~lcQGLWidget();
QSize sizeHint() const;
lcGLWidget *widget;
QSize preferredSize;
bool mIsView;
2013-08-09 06:57:18 +02:00
2014-04-08 03:04:32 +02:00
float deviceScale()
{
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
return windowHandle()->devicePixelRatio();
#else
return 1.0f;
#endif
}
2014-09-15 00:41:22 +02:00
QTimer mUpdateTimer;
2013-08-09 06:57:18 +02: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 08:23:12 +02:00
void mouseDoubleClickEvent(QMouseEvent *event);
2013-08-09 06:57:18 +02: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 23:34:04 +01:00
int mWheelAccumulator;
2013-08-09 06:57:18 +02:00
};