[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    Re: KDE/kdelibs/kdeui/tests
From:       André_Wöbbeking <Woebbeking () kde ! org>
Date:       2010-05-25 21:17:11
Message-ID: 201005252317.11679.Woebbeking () kde ! org
[Download RAW message or body]

On Friday 21 May 2010, David Faure wrote:
> SVN commit 1129079 by dfaure:
> 
> Test for Qt::WA_DeleteOnClose in KDialog closed by OK button, works.
> 
> 
>  M  +18 -1     kdialog_unittest.cpp
> 
> 
> --- trunk/KDE/kdelibs/kdeui/tests/kdialog_unittest.cpp #1129078:1129079
> @@ -158,12 +158,29 @@
>          QCOMPARE(dialog.button(id)->whatsThis(), whatsthis);
>      }
> 
> -    void testCloseDialog()
> +    void testDeleteOnClose()
>      {
>          KDialog* dialog = new KDialog;
>          QWeakPointer<KDialog> dialogPointer(dialog);
>          dialog->setAttribute(Qt::WA_DeleteOnClose);
>          dialog->setButtons(KDialog::Ok | KDialog::Cancel);
> +        QSignalSpy qOkClickedSpy(dialog, SIGNAL(okClicked()));
> +        QSignalSpy qAcceptedSpy(dialog, SIGNAL(accepted()));
> +        dialog->show(); // KDialog::closeEvent tests for isHidden
> +        dialog->button(KDialog::Ok)->click();
> +        QCOMPARE(qOkClickedSpy.count(), 1);
> +        QCOMPARE(qAcceptedSpy.count(), 1); // and then accepted is emitted
> as well +        qApp->sendPostedEvents(); // DeferredDelete
> +        QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);

I'm just curious, are both calls needed to process the delete events?
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic