[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-06-03 20:20:23
Message-ID: 201006032220.23701.Woebbeking () kde ! org
[Download RAW message or body]
On Wednesday 26 May 2010, David Faure wrote:
> On Tuesday 25 May 2010, André Wöbbeking wrote:
> > 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?
>
> No, I removed the first call in a later commit.
>
> I don't really understand why the second call works while the first one
> doesn't though ;)
Maybe related to
* [132395] Sent DeferredDelete events at the right time. Specifying the
QEventLoop::DeferredDeletion flag (now deprecated) to processEvents()
is no longer necessary.
(from changes-4.4.0)
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic