[PyQt] Synchronized scrolling between two tables

Wolfgang Rohdewald wolfgang at rohdewald.de
Wed Nov 2 01:11:48 GMT 2011


Am Dienstag, 1. November 2011, 14:02:48 schrieb Nader Abedrabbo:
> What I would like though is a synchronized scrolling of the two tables, i.e.
> if I scroll the first table, then the second table should scroll to the
> same view (same row level) as the first table.
> 
> Is that possible? 

yes. Have a look at classes ScoreViewLeft, ScoreViewRight and ScoreTable
in kajongg
http://websvn.kde.org/trunk/KDE/kdegames/kajongg/src/scoring.py?view=markup

but I do not see the need for two tables in your case, I would try to use one
single QTableView. Initialize the calculated fields to empty and after having 
calculated them, refresh the view.

you do not even need a calculate button. If your calculation really needs some
time,  you can put the calculation into a separate thread and automatically
update the view when a field has been calculcated.

-- 
Wolfgang




More information about the PyQt mailing list