nwnoga
nwnoga

Reputation: 575

QDialog not painting in loop

So I have a QDialog class that's launched from a QMainWindow. The constructor sets up the UI. I declare the object in the QMainWindow, then i call the method that loops in the QDialog class. The result is that when the QDialog is shown(dialog->show() is in the constructor) the window appears without the layout. After the loop completes the layout is then shown.

I've tried using exec() instead, but then the method does not execute until after the dialog is closed.

Upvotes: 0

Views: 865

Answers (1)

Anthony
Anthony

Reputation: 8788

qApp->processEvents() should help you out. Try placing it around the code creating the dialog and/or running the loop.

Upvotes: 1

Related Questions