Provided that dimensions are same, it should be as simple as connecting scrollbars' valueChanged(int) signals to setValue(int) slots:
// establish connections in both directions
connect(table1->horizontalScrollBar(), SIGNAL(valueChanged(int)), table2->horizontalScrollBar(), SLOT(setValue(int)));
connect(table2->horizontalScrollBar(), SIGNAL(valueChanged(int)), table1->horizontalScrollBar(), SLOT(setValue(int)));
// ...and the same for vertical scroll bar
// establish connections in both directions
connect(table1->horizontalScrollBar(), SIGNAL(valueChanged(int)), table2->horizontalScrollBar(), SLOT(setValue(int)));
connect(table2->horizontalScrollBar(), SIGNAL(valueChanged(int)), table1->horizontalScrollBar(), SLOT(setValue(int)));
// ...and the same for vertical scroll bar
To copy to clipboard, switch view to plain text mode
Bookmarks