summaryrefslogtreecommitdiffstats
path: root/src/widget/openglwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widget/openglwindow.cpp')
-rw-r--r--src/widget/openglwindow.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/widget/openglwindow.cpp b/src/widget/openglwindow.cpp
index c2249a9e8e..b797ea8ebe 100644
--- a/src/widget/openglwindow.cpp
+++ b/src/widget/openglwindow.cpp
@@ -7,8 +7,9 @@
#include "widget/trackdroptarget.h"
#include "widget/wglwidget.h"
-OpenGLWindow::OpenGLWindow(WGLWidget* widget)
- : m_pWidget(widget) {
+OpenGLWindow::OpenGLWindow(WGLWidget* pWidget)
+ : m_pWidget(pWidget),
+ m_dirty(false) {
QSurfaceFormat format;
format.setVersion(2, 1);
format.setProfile(QSurfaceFormat::CoreProfile);
@@ -53,26 +54,26 @@ void OpenGLWindow::widgetDestroyed() {
m_pWidget = nullptr;
}
-bool OpenGLWindow::event(QEvent* ev) {
+bool OpenGLWindow::event(QEvent* pEv) {
// From here we call QApplication::sendEvent(m_pWidget, ev) to trigger
// handling of the event as if it were received by the main window.
// With drag move and drag leave events it may happen that this function
// gets called recursive, potentially resulting in infinite recursion
// and a stack overflow. The boolean m_handlingEvent protects against
// this recursion.
- const auto t = ev->type();
+ const auto t = pEv->type();
- bool result = QOpenGLWindow::event(ev);
+ bool result = QOpenGLWindow::event(pEv);
if (m_pWidget) {
// Tooltip don't work by forwarding the events. This mimics the
// tooltip behavior.
if (t == QEvent::MouseMove) {
ToolTipQOpenGL::singleton().start(
- m_pWidget, dynamic_cast<QMouseEvent*>(ev)->globalPos());
+ m_pWidget, dynamic_cast<QMouseEvent*>(pEv)->globalPos());
}
if (t == QEvent::Leave) {
- ToolTipQOpenGL::singleton().stop(m_pWidget);
+ ToolTipQOpenGL::singleton().stop();
}
if (t == QEvent::DragEnter || t == QEvent::DragMove ||
@@ -80,10 +81,10 @@ bool OpenGLWindow::event(QEvent* ev) {
// Drag & Drop events are not delivered correctly when using QApplication::sendEvent
// and even result in a recursive call to this method, so we use our own mechanism.
if (m_pWidget->trackDropTarget()) {
- return m_pWidget->trackDropTarget()->handleDragAndDropEventFromWindow(ev);
+ return m_pWidget->trackDropTarget()->handleDragAndDropEventFromWindow(pEv);
}
- ev->ignore();
+ pEv->ignore();
return false;
}
@@ -101,7 +102,7 @@ bool OpenGLWindow::event(QEvent* ev) {
// container widget that contains this QOpenGLWindow. With this mouse
// events, keyboard events, etc all arrive as intended, including the
// events for the WWaveformViewer that contains the waveform widget.
- QApplication::sendEvent(m_pWidget, ev);
+ QApplication::sendEvent(m_pWidget, pEv);
}
return result;