On Tue, Nov 8, 2016 at 3:56 PM, william.croc...@analog.com < william.croc...@analog.com> wrote: > > It appears that with Qt 5.7, SOMETIMES, my call to processEvents waits > for the full 5 secs even though I do not believe there is anything to do. > That is why my app is SOMETIMES unresponsive for 5 seconds when I start it > up. > > [Snippet ...] >
Perhaps I'm missing something, but why not skip the processEvents call altogether and just queue an event to do the resizing later? E.g: void MyApp::show() { QSettings settings; QSize sz = settings.value("MainWindowWSize",QSize(1200,700)).toSize(); QPoint pos = settings.value("MainWindowPos",QPoint(180,190)).toPoint(); if (sz.width() > 0 && sz.height() > 0) { resize(sz); move(pos); } BaseClass::show(); // The lambda is just quickest to write, you can use a private slot as well. QTimer::singleShot(0, [sz, pos] () -> void { if (sz.width() > 0 && sz.height() > 0) { resize(sz); move(pos); } raise(); }); }
_______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest