tags:

views:

186

answers:

1

Is it possible to use QSignalMapper to re-emit signals with multiple parameters? I have found a workaround but im curious to know if it is possible.

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

and re-emit:

void newSignal(int group, int pos);

+3  A: 

QSignalMapper can not be used for that, but the class is quite simple to re-implement and specialize for your needs. Simply use a QMap<QObject*,ValueStruct>, where ValueStruct keeps your arguments. When you receive a signal, map(), look at QObject::sender() (link) as the key in the map to make the emit in your turn.

e8johan