I really don't know anymore if is an event problem or what, because my code works "fine", i just have to click many times on a cell to get the correct value of (line, column).
I tried to change my code of post #11, i don't know if is what anda_skoa said, but i got the same problem. Nothing changed.
if(event->button( ) == Qt::LeftButton) {
cout << "(" << this->currentRow( ) << ", " << this->currentColumn( ) << ")" << endl;
}
else {
}
}
void Table::mousePressEvent(QMouseEvent *event) {
if(event->button( ) == Qt::LeftButton) {
cout << "(" << this->currentRow( ) << ", " << this->currentColumn( ) << ")" << endl;
}
else {
QWidget::mousePressEvent( event );
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks