So, i have to promote each table to different classes in which i have different mousePressEvent() implementation?
For instance:
table_1 promoted to Table1(here i have an mousePressEvent())
table_2 promoted to Table2(here i have an mousePressEvent())
table_3 promoted to Table3(here i have an mousePressEvent())
table_1 promoted to Table1(here i have an mousePressEvent())
table_2 promoted to Table2(here i have an mousePressEvent())
table_3 promoted to Table3(here i have an mousePressEvent())
To copy to clipboard, switch view to plain text mode
Here my basic implementation of mousePressEvent().
if(event->button( ) == Qt::LeftButton) {
this->currentRow( );
this->currentColumn( );
// Do something with this table.
//"this" is the table made with Desing promoted to Table.
}
else if(event->button( ) == Qt::RightButton) {
this->currentRow( );
this->currentColumn( );
// Do other thing with this table.
}
// And if i click on other table?
}
void Table::mousePressEvent(QMouseEvent *event) {
QTableWidget::mousePressEvent( event );
if(event->button( ) == Qt::LeftButton) {
this->currentRow( );
this->currentColumn( );
// Do something with this table.
//"this" is the table made with Desing promoted to Table.
}
else if(event->button( ) == Qt::RightButton) {
this->currentRow( );
this->currentColumn( );
// Do other thing with this table.
}
// And if i click on other table?
}
To copy to clipboard, switch view to plain text mode
Bookmarks