[PyQt] Synchronized scrolling between two tables

Scott Price scottmprice at gmail.com
Wed Nov 2 01:13:12 GMT 2011


According to the documentation:

QTableView.scrollTo (*self*,
QModelIndex<file:///C:/Python26/Lib/site-packages/PyQt4/doc/html/qmodelindex.html>
 *index*, QAbstractItemView.ScrollHint<file:///C:/Python26/Lib/site-packages/PyQt4/doc/html/qabstractitemview.html#ScrollHint-enum>
 *hint* = QAbstractItemView.EnsureVisible)

I assume you would have to create a QModelIndex based on the first tables'
scrolled to record, and then feed it into the second table via a key press
(or release) grab?  If this is set up to fire for each scrolled record on
the first table, it might get resource-intensive to 'synchronize' the
scrolling, though.





On Tue, Nov 1, 2011 at 2:02 PM, Nader Abedrabbo <aenader1 at yahoo.com> wrote:

>
> Greetings,
>
> I have a program where two tables are shows next to each other.   One
> program is used to get user data, while the second table is used to show
> the
> results of the data after certain calculations are performed on the
> original
> data (via a calculate button).  The list of data in the tables can be in
> the
> hundreds. I added buttons to scroll to the bottom and top of the table.
>
> 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?
>
> Thanks,
> Nader
>
> --
> View this message in context:
> http://old.nabble.com/Synchronized-scrolling-between-two-tables-tp32761709p32761709.html
> Sent from the PyQt mailing list archive at Nabble.com.
>
> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20111101/ee087ac5/attachment.html>


More information about the PyQt mailing list