简体   繁体   中英

vertical scroll in pyqt

I'm beginner in Pyqt and I'd like to add a vertical scroll to my listbox. Somebody can help me? I appreciate your help.

self.lres = QtGui.QListWidget(self)
self.lres.move(190,220)
self.lres.resize(780,460)

QListWidget already comes with a vertical scroll bar. By default it will only appear when the contents are too big to display in full. If you want the scroll bar to always be visible you can use setVerticalScrollBarPolicy()

self.lres.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOn)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM