[SOLVED] regarding QSignalMapper and QComBox in QTableWidget
hi,
this is my code to display a QComboBox in a QTableWidget and using QSignalMapper to re-emit the signal but the output is Object::connect: No such signal QComboBox::currentIndexChanged()
Code:
QString val
= tableUsers
->item
(y, x
)->text
();
query.exec("SELECT * FROM position");
int i = 0;
while (query.next()) {
dropdownPosition->addItem(query.value(1).toString());
if (val == query.value(1).toString()) dropdownPosition->setCurrentIndex(i);
i++;
}
query.clear();
tableUsers->setCellWidget(y, x, dropdownPosition);
connect(dropdownPosition, SIGNAL(currentIndexChanged()), signalMapper, SLOT(map()));
signalMapper
->setMapping
(dropdownPosition,
QString("%1-%2").
arg(y
).
arg(x
));
connect(signalMapper,
SIGNAL(mapped
(const QString &)),
this,
SLOT(editUserPosition
()));
am i doing it right? or there is something missing in my code? thanx for the help..
Re: regarding QSignalMapper and QComBox in QTableWidget
It is not clear why you use a signal mapper but anyway the warning is because there is no signal called currentIndexChanged()! You mean currentIndexChanged(int) or currentIndexChanged(const QString&), don't you?
Re: regarding QSignalMapper and QComBox in QTableWidget
thanx. and you were right. i just have to add the parameter...
i use the signal mapper coz every time the user double clicks in QTableWidget position column, a QComboBox appears but the QComboBox signal cant emit its signal to the given function for editing the value.
thanx a lot...