Important: Please read the Qt Code of Conduct -

Detect input for Inplace editor

  • 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)

  • 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.

  • Is it possible to install an eventfilter on all classes derived from QObject?

  • no, but you can install the event filter on all childs of a widget;

    e.g subclass QWidget overrinding method eventFilter() (see "there":;)
    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()":
    iterate over the list and use installEventFilter on each widget.

    You should be fine.

Log in to reply