diff options
Diffstat (limited to 'src/widget/tooltipqopengl.h')
-rw-r--r-- | src/widget/tooltipqopengl.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/widget/tooltipqopengl.h b/src/widget/tooltipqopengl.h new file mode 100644 index 0000000000..05777cfe76 --- /dev/null +++ b/src/widget/tooltipqopengl.h @@ -0,0 +1,27 @@ +#pragma once + +#include <QPoint> +#include <QTimer> +#include <QToolTip> + +class WGLWidget; + +// Tooltips don't work for the qopengl-based WGLWidget. This +// singleton mimics the standard tooltip behaviour for them. +class ToolTipQOpenGL : public QObject { + Q_OBJECT + + bool m_active{true}; + QTimer m_timer; + QPoint m_pos{}; + WGLWidget* m_widget{}; + ToolTipQOpenGL(); + + public: + static ToolTipQOpenGL& singleton(); + void setActive(bool active); + void start(WGLWidget* widget, QPoint pos); + void stop(WGLWidget* widget); + private slots: + void onTimeout(); +}; |