Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.6.1
-
None
-
Windows 10 x64, Visual Studio 2013, Linux XCB, macOS
-
b65e30c861af308d142c36b5f96f1a4cfedde1f3
Description
On Windows 10, calling resize(), before the widget is actually shown (in constructor or showEvent() ), moves it to upper left corner of the screen, with title bar hidden over the top.
for example:
void myWidget::showEvent(QShowEvent * event)
{
if (event->type()==QEvent::Show) {
resize (200,200);
}
}
... will exhibit the problem on Windows 10, while
void myWidget::showEvent(QShowEvent * event) { if (event->type()==QEvent::Show) { QTimer* timer = new QTimer(this); timer->setSingleShot(true); QObject::connect(timer, &QTimer::timeout, [timer]() { resize(200,200) delete timer; }); timer->start(0); } }
will work as usual.