Ingo Klöcker kloecker at kde.org
Sun Sep 14 22:17:34 BST 2008

On Sunday 14 September 2008, Michael Pyne wrote:
> On Sunday 14 September 2008, Albert Astals Cid wrote:
> > const QList<QAction*> KActionCategory::actions() const
> >
> > seems not really KDE style to me, afair we do
> >
> > QList<QAction*> KActionCategory::actions() const
> >
> > but Michael says he copied it from KActionCollection, can someone
> > show any light?
> From the API docs both styles are used in KActionCollection (look at
> actionGroups() and actions()).
> As far as which is correct I think it depends on what exactly they're
> trying to accomplish.  If the idea of const QList<QAction *> is to
> force any pointers retrieved through the QList to be const QAction *
> then it makes sense I think.

Unfortunately, this idea doesn't work because of
  T QList<T>::value( int i ) const
i.e. QList<QAction *>::value( int i ) does not return a const QAction *, 
but a QAction *. All other const methods of QList<T> return a const T 
&, though.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20080914/8fd7d6d9/attachment.sig>

More information about the kde-core-devel mailing list