On Monday 19 October 2009 17:07:48 Thomas Lübking wrote: > 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
Thanks for your suggestion. Unfortunately setting the focus policy to Qt::NoFocus on other elements seems to be not enough in my case. Anyway I solved the problem by reimplementing the focusInEvent() (see thread on plasma- devel). Cheers, Matteo > > 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 << > _______________________________________________ Plasma-devel mailing list Plasma-devel@kde.org https://mail.kde.org/mailman/listinfo/plasma-devel