Implement QOpenGLWidget wrong fbo size workaround.
This commit is contained in:
parent
3542f5e913
commit
c538357107
1 changed files with 9 additions and 0 deletions
|
|
@ -32,6 +32,7 @@ private:
|
|||
void resizeGL(int w, int h) override;
|
||||
void paintEvent(QPaintEvent *e) override;
|
||||
void paintGL() override;
|
||||
bool eventHook(QEvent *e) override;
|
||||
void callDeInit();
|
||||
|
||||
const std::unique_ptr<Renderer> _renderer;
|
||||
|
|
@ -109,6 +110,14 @@ void SurfaceOpenGL::paintGL() {
|
|||
_renderer->paint(this, *f);
|
||||
}
|
||||
|
||||
bool SurfaceOpenGL::eventHook(QEvent *e) {
|
||||
const auto result = RpWidgetBase::eventHook(e);
|
||||
if (e->type() == QEvent::ScreenChangeInternal) {
|
||||
_deviceSize = size() * devicePixelRatio();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
void SurfaceOpenGL::callDeInit() {
|
||||
if (!_connection) {
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue