Weird crash with QProgressDialog: Qt bug?

Michael Goffioul goffioul at
Fri Aug 9 12:48:20 BST 2002

I encountered a weird crash when dealing with a QProgressDialog in
KDEPrint, and I think it might be due to a Qt bug. Before reporting it
to TT, I'd like to have an external opinion.

The situation is the following. I have a widget w1, included in 
a QWidgetStack, in turn included in a QDialog d1. Now I create a
QProgressDialog with w1 as "parent/creator". In QProgressDialog's
code, you can see that the QDialog ctor is called with
creator->topLevelWidget() as parent, that means that my progress
dialog has w1 as creator, and d1 as parent.

Now, when you delete d1, all children are deleted recursively,
including w1 and the progress dialog. But if w1 is deleted before
the progress dialog, you get a crash because ~QProgressDialog tries
to access its creator (w1 in this case). And this is the crash I got.

My workaround was to create the progress dialog with w1->topLevelWidget()
as creator as well, such that the real parent and the creator of the
progress dialog are the same.

Does this sound logical, or am I completely wrong? Is it possible
that a creator of a progress dialog gets deleted before the dialog


Michael Goffioul		IMEC-DESICS-MIRA
e-mail: goffioul at	(Mixed-Signal and RF Applications)
Tel:    +32/16/28-8510		Kapeldreef, 75
Fax:    +32/16/28-1515		3001 HEVERLEE, BELGIUM

More information about the kde-core-devel mailing list