Virtual methods in KLineEdit

Olivier Goffart ogoffart at kde.org
Tue Jan 23 21:58:43 GMT 2007


Le mardi 23 janvier 2007 19:38, Christian Schaarschmidt a écrit :
> Hi,
>
> I have recently commited a change to trunk/.../KLineEdit (bug 137430) and
> after that I had a discussion with Simon concerning virtual methods. Since
> we could not agree upon a solution it would be nice to get some other
> opinions...
>
> Problem: Allow subclasses of KLineEdit to extend context menu
> The patch solves the issue by moving the code to
> createStandardContextMenu(), remains the question: should KLineEdit be used
> as base for a hierarchy? How comfortable should it be?

If you choose to have the virtual method,  i think that 
createStandardContextMenu is not a good name for the following reason:
 - It's not really standard for the sublass (i mean that 
KFooApplicationSuperLineEdit cannot say his menu will be standard)
 - It's confusing with the Qt method which is not virtual

So i suggest simply "createContextMenu"

Also, I think that the performance issue is quite negligible here

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20070123/cb6c8f80/attachment.sig>


More information about the kde-core-devel mailing list