No such signal QTableWidget::cellChanged(int, int)
-
24-09-2019 - |
Question
The title describes my problem quite well.
The offending line of code:
connect(table, SIGNAL(cellChanged(row, 5)), this, SLOT(updateSP()));
I can think of no reason why that signal is not valid. I googled around, and found a couple people with the same problem, but the solutions posed there don't work.
I'm using Qt 4.5.2 on Ubuntu Karmic, g++.
Anyone know what I am doing wrong? Trolltech's documentation regarding cellChanged() doesn't mention any special requirements.
I'm at a loss.
Thanks for any advice!
Solution
it seems for me that you don't understand Qt's Signals and Slots concepts. The SIGNAL & SLOT macro take an interface. Something like
connect(table, SIGNAL(cellChanged(int, int)), this, SLOT(updateSP()));
might work but you need to have same argument count in your slot, to make it work like you expect:
connect(table, SIGNAL(cellChanged(int, int)), this, SLOT(updateSP(int, int)));
Slot should look something like this:
void ClassFoo::updateSP(int row, int column)
{
// row is the number of row that was clicked;
// column is the number of column that was clicked;
// Here we go! It's right place to do some actions. =)
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow