Iv?n Forcada Atienza wrote:

> Hi
> El 15/Feb/06 - 11:07, Vladimir Prus dijo:
>>
>> Hello!
>>
>> Is there a stock way to make tooltip text for a KAction mention the
>> shortcut for that KAction. Here's what I have now:
>>
>> action = new KAction(i18n("Step &Over"), "dbgnext", Key_F10,
>> this, SLOT(slotStepOver()),
>> actionCollection(), "debug_stepover");
>> action->setToolTip( i18n("Step over the next line (F10)") );
>>
>> Adding "F10" to tooltip is good so that users learn the shortcut key, but
>> if this is done manually it's easy to miss a KAction or too.
>>
>> I imagine I can write a code that iterates over all actions in
>> KActionCollection and modifies the tooltip text accordingly to shortcut,
>> but maybe there's a standard solution?
>>
>> I'm targeting KDE 3.5, if that matters.

>
> I'd do it by subclassing KAction and reimplementing setToolTip virtual
> function...


That would require changing all and every actions, and potentially those
that come from external KParts, and so leaves the original problem that you
can easily forget some actions.

- Volodya


>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<