mirror of
https://github.com/leozide/leocad
synced 2024-12-26 21:58:44 +01:00
46 lines
1.3 KiB
C++
46 lines
1.3 KiB
C++
#pragma once
|
|
|
|
#include <QGLWidget>
|
|
|
|
class lcQGLWidget : public QGLWidget
|
|
{
|
|
public:
|
|
lcQGLWidget(QWidget* Parent, lcGLWidget* Owner);
|
|
~lcQGLWidget();
|
|
|
|
QSize sizeHint() const override;
|
|
|
|
lcGLWidget* mWidget;
|
|
|
|
float GetDeviceScale() const
|
|
{
|
|
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
|
|
return windowHandle()->devicePixelRatio();
|
|
#else
|
|
return 1.0f;
|
|
#endif
|
|
}
|
|
|
|
void SetPreviewPosition(const QRect& ParentRect);
|
|
|
|
protected:
|
|
void resizeGL(int Width, int Height) override;
|
|
void paintGL() override;
|
|
void focusInEvent(QFocusEvent* FocusEvent) override;
|
|
void focusOutEvent(QFocusEvent* FocusEvent) 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;
|
|
|
|
QSize mPreferredSize;
|
|
int mWheelAccumulator;
|
|
};
|
|
|