PySide Maya 2014 - QTableWidget not showing Header Labels

282 views
Skip to first unread message

olheiros

unread,
Feb 7, 2014, 2:43:02 PM2/7/14
to python_in...@googlegroups.com

Hi all

I have been experimenting with a QTableWidget (Pyside Maya 2014)
for a tool i am developing and i can't seem to get the header labels
to work. I have researched the web and all state that what im doing seems right. but
all it does is show number instead of my List Strings.

any help would be very much appretiated
thanks
Ricardo Viana

here is a snippet:

# Main Layout

self.mainLayout = QtGui.QVBoxLayout()

self.window.setLayout(self.mainLayout)

self.refresh= QtGui.QPushButton("Refresh")

# Table widget


self.listWidget = QtGui.QTableWidget()

self.listWidget.header = ['Light','Color','Intensity','Subdivisions','Invisible', 'Diffuse','Specular','Reflection']

self.listWidget.setColumnCount(len(self.listWidget.header))

self.listWidget.verticalHeader().setVisible(0)

self.listWidget.horizontalHeader().setVisible(1)


self.listWidget.setAlternatingRowColors(True)

self.listWidget.setHorizontalHeaderLabels(self.listWidget.header)







table.jpg

Justin Israel

unread,
Feb 7, 2014, 4:02:20 PM2/7/14
to python_in...@googlegroups.com

Are you calling listWidget.clear() somewhere before adding your items? If so, try replacing that with clearContent(). It won't clear your headers.

Otherwise can you post a small runnable example that exhibits the problem so we can reproduce it and debug?

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/2680eeaf-0e04-4bde-9a38-eef38db7205a%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ricardo Viana

unread,
Feb 7, 2014, 4:25:30 PM2/7/14
to python_in...@googlegroups.com
aaahhh dead on justin. as always:)

thank you so much.

For more options, visit https://groups.google.com/groups/opt_out.


--
Sent from Mobile

Justin Israel

unread,
Feb 7, 2014, 4:49:27 PM2/7/14
to python_in...@googlegroups.com
Confession. I actually don't know how to code. I have another secret forum that I forward all these questions to. They answer my questions, and then I answer them back here and reap all the cash profits. And when they don't answer quickly enough, I out-source to India and China  :-)




Ricardo Viana

unread,
Feb 7, 2014, 5:10:11 PM2/7/14
to python_in...@googlegroups.com
lol. :)




For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.


--
Sent from Mobile

Matt Estela

unread,
Feb 8, 2014, 1:22:49 AM2/8/14
to python_inside_maya

Justin Israel

unread,
Feb 8, 2014, 2:19:12 AM2/8/14
to python_in...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages