I have a QTableWidget containing the output of various math functions. The user needs to be able to click the number next to a row (the vertical header) and I need to get the index of the row that was clicked. I've been searching for a while but I can't find exactly what I need. I've read something about using the verticalHeader() sectionDoubleClicked() signal but I can't get this working. Normally I'd just right click the widget in the designer and go to the slot I wanted but it isn't there.
I've tried
QObject::connect(ui->table->verticalHeader(),SIGNAL(sectionDoubleClicked(int)),this,SLOT(termSelect(int)));
where termSelect is
void termSelect(int index)
{
cout << "row selected: " << index;
}
but I get a no such slot error.
I tried doing this in the header file
public Q_SLOTS:
void cTermSelect(int);
but then I get a linking error.
I feel like I'm making a horribly butchered mess of this and that there has to be an easier way.
Q_OBJECT
macro in your class definition? – hank