this is the example from QSignalMapper help:
for (int i = 0; i < texts.size(); ++i) {
connect(button, SIGNAL(clicked()), signalMapper, SLOT(map()));
signalMapper->setMapping(button, texts[i]);
gridLayout->addWidget(button, i / 3, i % 3);
}
connect(signalMapper,
SIGNAL(mapped
(const QString &)),
this,
SIGNAL(clicked
(const QString &)));
signalMapper = new QSignalMapper(this);
QGridLayout *gridLayout = new QGridLayout;
for (int i = 0; i < texts.size(); ++i) {
QPushButton *button = new QPushButton(texts[i]);
connect(button, SIGNAL(clicked()), signalMapper, SLOT(map()));
signalMapper->setMapping(button, texts[i]);
gridLayout->addWidget(button, i / 3, i % 3);
}
connect(signalMapper, SIGNAL(mapped(const QString &)),
this, SIGNAL(clicked(const QString &)));
To copy to clipboard, switch view to plain text mode
I still dont see the solution, i have only one sender - combo1, and only one receiver - combo2.
The example shows one receiver and multiple senders.
And after, the last connection should have bool as function parameter, how do i get bool;.
Bookmarks