Problems with KSelectAction

David Faure david at
Mon Aug 26 15:45:26 BST 2002

Hash: SHA1

On Monday 26 August 2002 15:20, Tobias Koenig wrote:
> Hi,
> I've two problems with KSelectAction. First it seems that the activated()
> signal isn't emitted when you use KSelectAction::setCurrentItem().
> Could the author of this code please take a closer look at it?

That's by design. activated() means the _user_ activated it.
In other cases, if the app knows about it, it can as well call the slot directly.
All of KActions work that way now (they didn't use to, in KDE-2.0, in that led
to many problems).

> The second problem is the following: When you insert a item with a '&' sign
> in it, the '&' sign is displayed in the combo box representation of the Action
> but not in the menu item representation (there it's transformed to a shortcut).
> So would be a patch ok that transform a single '&Hello' in an item to
> 	'Hello' in the combo box
> 	'&Hello' in the menu item (H is a shortcut)
> and a '&&Hello' to
> 	'&Hello' in the combobox
> 	'&&Hello' in the menu item (H is a shortcut with a prepended & )

I added that some time ago (but it's not activated by default for backward-compat reasons).

     * Call setRemoveAmpersandsInCombo to ask KSelectAction to remove
     * '&' signs from the combobox that is created when plugging this action
     * into a toolbar. This is useful when the items have an '&' for providing
     * accelerators in the menu-items; those '&' shouldn't appear in comboboxes.
     * By default this setting is false.
     * Call this before plugging the action.
    void setRemoveAmpersandsInCombo( bool b );

- -- 
David FAURE, david at, faure at
Contributing to:,
KOffice-1.2-rc1 is out.
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see


More information about the kde-core-devel mailing list