Yeah, I was trying to fix bug #152182 and I found the reason behind the
bug. And I was even able to fix that if I add a close button of mine and
connect that to close() slot (detailed explanation would be too long but if
you want me to, then surely I would).
And this setButtons(Close), does not call close() slot nor does it send a
closeEvent(QCloseEvent * ) and I think that's why there is the bug.

On Sun, Feb 5, 2012 at 4:23 PM, Kevin Krammer <[email protected]> wrote:

> On Sunday, 2012-02-05, Rahul Sharma wrote:
> > Thanks a lot Kevin.
> > That really helped, but one more question, does the QDialog::done()
> emits a
> > close event signal as QWidget::close() in order to close the window (or
> > dialog) ?
>
> Hmm. There is no such things as a close event signal, but if you mean
> whether
> it calls the closeEvent() handler method, then no.
>
> QDialog::closeEvent() however calls QDialog::reject() which in turn calls
> QDialog::done().
>
> Any specific use case you have in mind that lead to this question?
>
> Cheers,
> Kevin
> >
> > Regards
> > -Rahul Sharma
> >
> > On Sun, Feb 5, 2012 at 3:56 PM, Kevin Krammer <[email protected]>
> wrote:
> > > Hi,
> > >
> > > On Sunday, 2012-02-05, Rahul Sharma wrote:
> > > > Hi,
> > > > I was going through the source code of *Kmplot .  *And at a place I
> got
> > > > stuck with it when i found that in a class inherited from KDialog, a
> > > > function setButtons( Close ) was used.
> > > > I understand that it creates a close button in the window but I was
> > >
> > > willing
> > >
> > > > to know that when the button is clicked, does it call close() slot
> (as
> > > > normally we would do when we create a close pushbutton we connect the
> > > > clicked() signal to the close() slot) or it just simply emits close
> > > > event signal.
> > >
> > > It does not call QWidget::close() but QDialog::done()
> > >
> > > From lxr.kde.org [1]
> > >
> > > 914     case Close:
> > > 915       emit closeClicked();
> > > 916       done(Close); // KDE5: call reject() instead; more
> QDialog-like.
> > > 917       break;
> > >
> > > This is necessary because a dialog might be run using QDialog::exec()
> > > which returns an exit code allowing the caller to do different things
> > > depening on result.
> > >
> > > > And one more query, what is the name of the button, simpy close or
> > > > something else ( as in QPushButton* closeButton, I can say that I
> > >
> > > created a
> > >
> > > > PushButton named closeButton ).
> > >
> > > It is not a member of the KDialog class if that is what you are asking.
> > > It gets added to an internal button map with KDialog::Close being the
> > > key.
> > >
> > > Again from lxr.kde.org
> > >
> > > 155   KPushButton *button = new KPushButton( item );
> > > 156   mButtonBox->addButton( button, role );
> > > 157
> > > 158   mButtonList.insert( key, button );
> > >
> > > See KDialog::button(ButtonCode)
> > >
> > > Cheers,
> > > Kevin
> > >
> > > [1] http://lxr.kde.org/source/kde/kdelibs/kdeui/dialogs/kdialog.cpp
> > >
> > > --
> > > Kevin Krammer, KDE developer, xdg-utils developer
> > > KDE user support, developer mentoring
> > >
> > > >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to
> > >
> > > unsubscribe <<
>
> --
> Kevin Krammer, KDE developer, xdg-utils developer
> KDE user support, developer mentoring
>
>
> >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to
> unsubscribe <<
>
>
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<

Reply via email to