Do not connect KStandardAction::quit() to QApplication::quit()

Aurélien Gâteau aurelien.gateau at free.fr
Wed Jan 30 21:14:33 GMT 2008


David Faure wrote:

> On Thursday 06 December 2007, Aurélien Gâteau wrote:
>> Hello,
>> 
>> I just got bitten by this one, so I thought I'd share it with you.
>> 
>> If your application implements KMainWindow::queryClose() to warn the user
>> about unsaved changes for example, do not connect KStandardAction::quit()
>> to QApplication::quit() as it would bypass the queryClose(). Instead,
>> connect it to QApplication::closeAllWindows().
>> 
>> I had a look at my incomplete checkout of KDE and only find one mistake:
>> kapptemplate. Attached patch fix it. Ok to commit?
> 
> Yes please do.
> 
> (IIRC this behavior was the same in kde3, right? We didn't document it
> much back then either, but I now added something to KStandardAction::quit)

Ok, done.

I haven't checked kde3 behavior, but it's a good idea to document it in the action doc.

Aurélien




More information about the kde-core-devel mailing list