简体   繁体   中英

column width in QTableWidget and PyQt4

I have a QTableWidget and I want to make sure that all the columns are stretched, ie occupy all of the form. The solution that I found is provided here but it seems to be for Qt5 and C++ . I'm working with PyQt4 and Python . Is there a way to do this in PyQt4 ?

the function for PyQt that is similar to that and which also apply to QHeaderView is :

setResizeMode (self, ResizeMode mode)

with possible values for resize mode

enum ResizeMode { Interactive, Fixed, Stretch, ResizeToContents, Custom }

more information :

http://pyqt.sourceforge.net/Docs/PyQt4/qheaderview.html

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