getting the internal name of a KAction
Jason Harris
kstars at 30doradus.org
Mon Feb 19 18:18:15 GMT 2007
Hello,
With revision 621518 (by Haussmann), the KAction ctors no longer call
QAction->setObjectName(). As a result, the name of the KAction is no
longer accessible.
In KActionCollection, it is possible to identify an action given a name,
but one cannot retrieve the name given an action. I' like to be able to
do this. My use case is that I have a slot in which I construct the
name of a data file based on the name of the invoking action:
void KStars::slotColorScheme() {
QString filename = QString( sender()->objectName() ) + ".colors";
loadColorScheme( filename );
}
I see that KAction no longer passes a name parameter in the ctor, but
the names must be stored in KActionCollection, since we have
action(QString name). Can we also have:
QString KActionCollection::actionName( KAction *a )
thanks,
Jason
More information about the kde-core-devel
mailing list