[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: Plasmoid activation signal
From:       Thomas =?iso-8859-1?q?L=FCbking?= <thomas.luebking () web ! de>
Date:       2009-10-19 15:07:48
Message-ID: 200910191707.48947.thomas.luebking () web ! de
[Download RAW message or body]

No idea whether Plasma provides a signal on this, but usually you'd 
reimplement the ::changeEvent(QEvent *) and catch QEvent::ActivationChange
or installEventFilter() to your widget and catch it there (in former case 
don't forget to call ParentClass::changeEvent(), in the latter return false 
after setting the focus.


Btw: if you don't need the focus on other elements at all, just set their 
focus policy to Qt::NoFocus - if the lineedit is the only focus taking widget, 
it should automatically get and keep kbd focus as long as the window is 
active.

Cheers,
Thomas

Am Monday 19 October 2009 schrieb Matteo Agostinelli:
> Hello,
> 
> recently I've been request to add a new feature on my qalculator
> plasmoid: to automatically give focue to the input line edit when the
> plasmoid is activated. By "activated" I mean:
> 1) the user clicks on the plasmoid icon in the taskbar (since it is a
> PopupApplet)
> 2) the user clicks anywhere on the widget
> 3) the user opens the plasmoid via the keyboard shortcut
> 
> So my question is if there already is a signal that is emitted when
> either of the previously stated action is triggered. Or should I
> override some protected method (in that case, please give me a hint).
> A possible candidate seems this signal: void newStatus
> (Plasma::ItemStatus status)
> but this has been introduced in 4.4 and I would like to make this work
> also in 4.3 if possible. Any suggestions?
> 
> Thanks in advance,
> Matteo
> 
> >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to
> >> unsubscribe <<
> 

 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic