Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'subject:: [': 0.03; 'sys': 0.05; '__name__': 0.07; 'received:openend.se': 0.09; 'received:theraft.openend.se': 0.09; 'cc:addr:python-list': 0.10; 'index': 0.13; 'def': 0.14; "'__main__':": 0.16; 'from:addr:lac': 0.16; 'from:addr:openend.se': 0.16; 'from:name:laura creighton': 0.16; 'labels,': 0.16; 'message-id:@fido.openend.se': 0.16; 'received:89.233': 0.16; 'received:89.233.217': 0.16; 'received:89.233.217.133': 0.16; 'received:fido': 0.16; 'received:fido.openend.se': 0.16; 'skip:w 70': 0.16; 'widget)': 0.16; 'app': 0.16; '(in': 0.18; 'subject:] ': 0.19; 'skip:v 30': 0.20; 'cc:2**0': 0.21; 'cc:addr:python.org': 0.21; 'cc:no real name:2**0': 0.23; 'import': 0.24; 'header:In-Reply-To:1': 0.24; "doesn't": 0.28; 'looks': 0.29; 'behaviour': 0.29; 'received:se': 0.29; 'skip:q 20': 0.29; 'window': 0.31; 'code': 0.31; 'skip:_ 10': 0.32; 'subject:lists': 0.32; 'class': 0.33; 'but': 0.36; 'others.': 0.36; 'should': 0.37; 'charset:us-ascii': 0.37; 'skip:v 20': 0.38; 'subject:with': 0.40; 'header:Message-Id:1': 0.62; 'received:89': 0.80; 'widgets:': 0.84 To: Alexis Dubois cc: python-list@python.org From: Laura Creighton Subject: Re: [QT] Scroll multiple lists with one scrollbar In-Reply-To: Message from Alexis Dubois of "Thu, 28 May 2015 02:50:13 -0700." <53f83314-12a6-4368-894f-13e756b5a888@googlegroups.com> References: <53f83314-12a6-4368-894f-13e756b5a888@googlegroups.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <17634.1432815483.1@fido> Content-Transfer-Encoding: quoted-printable Date: Thu, 28 May 2015 14:18:03 +0200 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.9 (theraft.openend.se [89.233.217.130]); Thu, 28 May 2015 14:18:06 +0200 (CEST) X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 39 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1432815493 news.xs4all.nl 2956 [2001:888:2000:d::a6]:38057 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:91366 Looks like what you need to do is to = connect verticalScrollBar().valueChanged (in one widget) to verticalScrollBar().setValue in all of the others. So is this code on the right track? It uses lists, not labels, and doesn't hide the scrollbars, but is this the behaviour you need ( and weren't getting)? It should work for labels too.. from PyQt4 import QtGui, QtCore class Window(QtGui.QWidget): def __init__(self): QtGui.QWidget.__init__(self) self.listA =3D QtGui.QListWidget(self) self.listB =3D QtGui.QListWidget(self) self.listC =3D QtGui.QListWidget(self) widgets=3D[self.listA, self.listB, self.listC] layout =3D QtGui.QHBoxLayout(self) for w1 in widgets: layout.addWidget(w1) for index in range(100): w1.addItem('This is line number %d' % (index +1)) for w2 in widgets: if w1 !=3D w2: w1.verticalScrollBar().valueChanged.connect(w2.vertica= lScrollBar().setValue) = if __name__ =3D=3D '__main__': import sys app =3D QtGui.QApplication(sys.argv) window =3D Window() window.show() sys.exit(app.exec_())