[kde-guidelines] Discouraging use of custom widget replacements

Aurélien Gâteau agateau at kde.org
Tue Jul 9 16:17:17 UTC 2013


On Monday 08 July 2013 11:12:01 Heiko Tietze wrote:
> Am Donnerstag, 4. Juli 2013, 17:49:22 schrieb Thomas Pfeiffer:
> > All HIGs assume that the widgets referenced in the "Implementation"
> > sections  are used. Therefore they only contain guidelines for aspects
> > which can be changed by the developer, to keep them as concise as
> > possible.
> > If you feel your application needs something which the referenced standard
> > KDE  or Qt widget does not provide, do not create you own custom
> > replacement, because it might violate best practice which is implemented
> > in
> > the standard widget. Instead, ask the KDE HIG team for advice on how to
> > solve your specific problem.
> 
> I placed it below "Behaviour" to not forget it. Actually, I'm not convinced
> that owner-drawn controls need to get rejected completely (I have KScreen in
> mind). I would suggest to create a special page for non-standard controls.

I agree. Sometimes one need non-standard widgets, so having a HIG page for 
them makes a lot of sense. Some guidelines ideas from the top of my head:

* Do you really need a custom widget? Check whether an existing widget cannot 
be used instead

* Make sure your new widget:
** Resizes correctly
** Handles right-to-left setups
** Works well with different color schemes
** Looks as close to native as possible (use QStyle or QStylePainter to draw 
elements)
** Is based on an existing widget rather than a plain QWidget if possible

* If possible, consider making your widget reusable enough so that it can be 
integrated in standard widgets

Aurélien


More information about the kde-guidelines mailing list