Fix a crash on startup with QOpenGLWidget
After c4aabeb2b8 we now try to access
q_ptr in QWidgetPrivate::setRenderToTexture. QOpenGLWidget needs to
delay this call after the QObject constructor is done to make sure
that setTextureChildSeen doesn't dereference q_ptr before it has
been initialized.
Change-Id: Icaee82c8b806f42bc7614b0ac6fe4e6026331750
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
bb10
parent
b5eb850e0d
commit
f4f1f597d4
|
|
@ -60,7 +60,6 @@ public:
|
|||
QOpenGLWidgetPrivate()
|
||||
: fbo(0), uninitialized(true)
|
||||
{
|
||||
setRenderToTexture();
|
||||
}
|
||||
GLuint textureId() const { return fbo ? fbo->texture() : 0; }
|
||||
|
||||
|
|
@ -91,6 +90,8 @@ void QOpenGLWidgetPrivate::initialize()
|
|||
QOpenGLWidget::QOpenGLWidget(QWidget *parent, Qt::WindowFlags f)
|
||||
: QWidget(*(new QOpenGLWidgetPrivate), parent, f)
|
||||
{
|
||||
Q_D(QOpenGLWidget);
|
||||
d->setRenderToTexture();
|
||||
}
|
||||
|
||||
QOpenGLWidget::~QOpenGLWidget()
|
||||
|
|
|
|||
Loading…
Reference in New Issue