seting the width of QTableView [PySide]

Post here if you need help with creating a Graphical User Interface in Python.

seting the width of QTableView [PySide]

Postby verb » Wed Aug 21, 2013 4:09 pm

Hello guys i am trying to set the width in qtableview widget but no luck

Code: Select all
self.model2=QStandardItemModel()
self.dialog.chanList2.setModel(self.model2)
 self.dialog.chanList2.horizontalHeader().setVisible(False)
 self.dialog.chanList2.resizeColumnsToContents()
 #self.dialog.chanList2.setColumnWidth(1,400)


this is part of my code and neither resizeColumnsToContents() || setColumnWidth() works
appreciate any help
verb
 
Posts: 9
Joined: Fri Feb 22, 2013 8:15 pm

Re: seting the width of QTableView [PySide]

Postby verb » Wed Aug 21, 2013 4:45 pm

i found the solution just in case anyone needs it

Code: Select all
   self.dialog.chanList2.horizontalHeader().setResizeMode(QHeaderView.Stretch)


http://qt-project.org/doc/qt-4.8/qheade ... eMode-enum
verb
 
Posts: 9
Joined: Fri Feb 22, 2013 8:15 pm


Return to GUI

Who is online

Users browsing this forum: yueeng and 2 guests