On macOS, force a repaint of CustomPaintWidget upon UpdateRequest

* For some reason the actual paint event never makes it through after converting
  to metal-compatible widgets, but painting in response to UpdateRequest (which
  should become a paint really) works about as well.
This commit is contained in:
baldurk
2018-09-04 18:10:05 +01:00
parent 7da13165e9
commit 76e2a0f42e
2 changed files with 13 additions and 0 deletions
+9
View File
@@ -115,3 +115,12 @@ void CustomPaintWidget::paintEvent(QPaintEvent *e)
}
}
}
#if defined(RENDERDOC_PLATFORM_APPLE)
bool CustomPaintWidget::event(QEvent *e)
{
if(m_Ctx && e->type() == QEvent::UpdateRequest)
paintEvent(NULL);
return QWidget::event(e);
}
#endif
+4
View File
@@ -72,6 +72,10 @@ private:
public slots:
protected:
#if defined(RENDERDOC_PLATFORM_APPLE)
bool event(QEvent *event) override;
#endif
void paintEvent(QPaintEvent *e) override;
QPaintEngine *paintEngine() const override { return m_Ctx ? NULL : QWidget::paintEngine(); }
ICaptureContext *m_Ctx;