-
Bug
-
Resolution: Done
-
P1: Critical
-
None
-
5.4.0
-
None
-
OS X 10.9.4 git Qt 5.4
-
I4cc7a6b1bd3e34741ad50c2e0d2a2add242b28e4
- Compile and run the code below
#include <QWidget>
#include <QKeyEvent>
#include <QApplication>
class Widget : public QWidget
{
protected:
void keyPressEvent(QKeyEvent* e)
{
if(e->key() == Qt::Key_Space)
{
setWindowFlags(windowFlags() ^ Qt::FramelessWindowHint);
show();
}
}
};
#include <QGLWidget>
class GLWidget : public QGLWidget
{
public:
using QGLWidget::QGLWidget;
protected:
void paintGL() override
{
glClearColor(1, 0, 0, 1);
glClear(GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
}
};
#include <QVBoxLayout>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
Widget w;
w.setMinimumSize({100, 100});
auto l = new QVBoxLayout;
w.setLayout(l);
l->addWidget(new GLWidget(&w));
w.show();
return a.exec();
}
A window shows up with red a square - the QGLWidget.
- press space
Under 5.4 QGLWidget will stop repainting and show garbage.
Under 5.3.2 it works fine.
Debugging shows painting bails out because Qt::WA_Mapped is no longer true.