Porting feedback: Hiding the Help button in KConfigDialog
Kevin Krammer
krammer at kde.org
Sun Feb 23 13:17:29 UTC 2014
On Sunday, 2014-02-23, 10:54:01, Kevin Ottens wrote:
> On Sunday 23 February 2014 10:08:13 David Faure wrote:
> > On Monday 17 February 2014 16:00:08 Eike Hein wrote:
> > > Hi,
> > >
> > > in the KDialog-based KConfigDialog of yesteryear, it was fairly easy
> > >
> > > to hide the Help button:
> > > dialog->button(KDialog::Help)->hide();
> > >
> > > This is useful for apps that don't (yet) ship a handbook, since it
> > > avoids mounting user frustration when a click on Help actually re-
> > > sults in a nasty error message (though it's actually looking less
> > > nasty these days).
> > >
> > > In Frameworks, this isn't possible any longer since the buttons
> > > reside in a private QDialogButtonBox. Might be nice to get it back
> > > tho ...
> >
> > Kévin? (this is your port).
>
> Hmmm yes, I was sure I replied in this thread though... apparently not. :-)
>
> > Should we add an accessor for the QDialogButtonBox in KConfigDialog?
> >
> > On one hand this could interfer with some of the internal handling
> > (enabling/disabling "Defaults", "Apply", "Restore"...) but on the other
> > hand this was possible before too (using KDialog members), and it gives
> > most flexibility to the apps (e.g. adding another button, even).
>
> Yep, was my thought as well in the imaginary email I sent. :-)
>
> The more secure alternative would be hideButton() and addButton() which
> would take respectively a button code and a pointer to a button. That'd
> avoid breaking the encapsulation.
>
> I don't think I have a preference between the two. One breaks encapsulation
> badly, the other one carries the risk of API explosion later on (if we want
> to provide more control than just hiding).
My initial thought was to suggest doing the same as in the Qt4 version, i.e.
having a button() method to allows access to be buttons.
That would make it less implementation specific, i.e. would still work if
QDialogButtonBox is replaced with something else in the future.
But usage of the button box already leaks, there are two protected accessors
to it.
Cheers,
Kevin
--
Kevin Krammer, KDE developer, xdg-utils developer
KDE user support, developer mentoring
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20140223/05761efa/attachment.sig>
More information about the Kde-frameworks-devel
mailing list