Detect input for Inplace editor
-
wrote on 28 Sept 2011, 06:48 last edited by
I'm trying to create an inplace editor (Virtual keyboard with it's own editbox, it only sends the data when done typing and it is aware of the content type)
Is there a way to detect if an editable box is clicked, without connecting the signals on all the editable boxes? I would like to make it a library that I can use in all kinds of applications.
I'm using a QT widget application (not an embedded linux version) -
wrote on 28 Sept 2011, 13:30 last edited by
a signal is received by a slot only if you call connect(). So, I think the best thing is to get an idea about connecting all your editable boxes in a cycle.
-
wrote on 30 Sept 2011, 13:40 last edited by
Is it possible to install an eventfilter on all classes derived from QObject?
-
wrote on 30 Sept 2011, 13:56 last edited by
no, but you can install the event filter on all childs of a widget;
e.g subclass QWidget overrinding method eventFilter() (see "there":http://doc.qt.nokia.com/4.2/eventsandfilters.html;)
Create a widget of this new type (in qtdesigner create a qwidget and then use promote to... to change is type)
put all widget you want inside it;
get the list of widgets with "findChildren()":http://doc.qt.nokia.com/4.2/qobject.html#findChildren
iterate over the list and use installEventFilter on each widget.You should be fine.
1/4