leocad/qt/lc_qglwidget.h

50 lines
1.1 KiB
C
Raw Normal View History

2013-08-09 06:57:18 +02:00
#ifndef _LC_QGLWIDGET_H_
#define _LC_QGLWIDGET_H_
#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 isView;
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
};
#endif // _LC_VIEWWIDGET_H_