Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
4.5.3
-
None
Description
The problem can be summarised as a lack of repaint on a window that is first partly hidden, minimised and then restored.
The code below reproduces is on Qt 4.5.2:-
#include <QtGui>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QMainWindow mainWin;
QMdiArea *mdiArea = new QMdiArea;
mainWin.setCentralWidget(mdiArea);
mainWin.show();
QGraphicsView *view = new QGraphicsView;
view->setCacheMode(QGraphicsView::CacheBackground);
QBrush brush(QLinearGradient(0,0,256,256));
brush.setColor(Qt::blue);
view->setBackgroundBrush(brush);
QGraphicsScene *scene = new QGraphicsScene;
scene->addRect(QRectF(10,10,30,40),QPen(QColor(Qt::yellow)),QBrush(QColor(Qt::red)));
scene->setSceneRect(QRectF(0.0, 0.0, 256, 256));
view->setScene(scene);
mdiArea->addSubWindow(view);
view->show();
return app.exec();
}
To reproduce the problem do the following:
- move the small SubWindow to the left, so that half of the window is hidden
- iconify the window
- restore the window
- move the window to the right, so that the previous hidden part is visible again
only half of the window background is restored correctly.