[kdeui] return type of KActionCollection::actionsOfType()

Jarosław Staniek js at iidea.pl
Fri Nov 24 22:58:34 GMT 2006


1. A question about:

template<class T>
   KAction* KActionCollection::actionsOfType(   const QString &   name )const

Logic and the docs say "Returns: A list of all KActions in the collection 
which match the parameters" but it's return type is KAction* instead of 
QList<KAction*> ...

How does it even compile?


2. actionsOfType() could return QList<T*>.

Reasoning: if I am looking for a given type, I'll be most probably try to use 
it's methods, e.g. KSelectAction::comboWidth(). SO why should I cast again?


Attached a prototype patch: kactioncollection.h.patch

-- 
regards / pozdrawiam, Jaroslaw Staniek
  Sponsored by OpenOffice Polska (http://www.openoffice.com.pl/en) to work on
  Kexi & KOffice: http://www.kexi-project.org, http://www.koffice.org
  KDE3 & KDE4 Libraries for MS Windows: http://kdelibs.com, http://www.kde.org
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: kactioncollection.h.patch
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20061124/40eac694/attachment.ksh>


More information about the kde-core-devel mailing list