leocad/qt/lc_qglwidget.h

46 lines
1.2 KiB
C
Raw Normal View History

#pragma once
2013-08-09 04:57:18 +00:00
#include <QGLWidget>
class lcGLWidget;
class lcQGLWidget : public QGLWidget
{
public:
2020-11-14 12:47:55 -08:00
lcQGLWidget(QWidget* Parent, lcGLWidget* Owner);
2013-08-09 04:57:18 +00:00
~lcQGLWidget();
QSize sizeHint() const override;
2013-08-09 04:57:18 +00:00
2020-11-14 12:47:55 -08:00
lcGLWidget* widget;
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
}
void SetPreviewPosition(const QRect& ParentRect);
2013-08-09 04:57:18 +00:00
protected:
void resizeGL(int Width, int Height) override;
void paintGL() override;
void keyPressEvent(QKeyEvent* KeyEvent) override;
void keyReleaseEvent(QKeyEvent* KeyEvent) override;
void mousePressEvent(QMouseEvent* MouseEvent) override;
void mouseReleaseEvent(QMouseEvent* MouseEvent) override;
void mouseDoubleClickEvent(QMouseEvent* MouseEvent) override;
void mouseMoveEvent(QMouseEvent* MouseEvent) override;
void wheelEvent(QWheelEvent* WheelEvent) override;
void dragEnterEvent(QDragEnterEvent* DragEnterEvent) override;
void dragLeaveEvent(QDragLeaveEvent* DragLeaveEvent) override;
void dragMoveEvent(QDragMoveEvent* DragMoveEvent) override;
void dropEvent(QDropEvent* DropEvent) override;
2015-02-10 22:34:04 +00:00
2020-11-14 12:47:55 -08:00
QSize mPreferredSize;
2015-02-10 22:34:04 +00:00
int mWheelAccumulator;
2013-08-09 04:57:18 +00:00
};