Can QSignalMapper be used to re-emit signals with multiple parameters?

Can I use QSignalMapper to re-emit signals with multiple parameters? I have found a workaround, but I'm curious to know if this is possible.

example: take
void QLineEdit :: textEdited (const QString and text) [signal]

and re-emit:

void newSignal (int group, int pos);

+3
source share
1 answer

QSignalMapper cannot be used for this, but the class is pretty simple to re-implement and specialize for your needs. Just use QMap<QObject*,ValueStruct> , where ValueStruct stores your arguments. When you get the signal, map() , look at QObject::sender() ( link ) as the key on the map to make the radiation in turn.

+8
source

Source: https://habr.com/ru/post/1246493/


All Articles