Hey Stefan,
Are you sure that is the right syntax to be using?
a = QtGui.QListWidget(self.listCategory.addItems( category))
This is adding your items to and existing list widget from your UI file, and then creating a new list widget with the None return value. This widget will then most likely be garbage collected after the function scope ends because it didn't have a parent.
It is effectively the same as writting:
self.listCategory.addItems(category)
a = QtGui.QListWidget(None)
Because addItems() doesn't return anything. Isn't the first line all you want? listCategory comes from the name you gave your list widget in Qt Designer.
--
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/7c0a0efe-0abc-434e-acc1-25a0193d8885%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA32di%3Dx4rkZsyTv8U_kgeNoXRBAytxoM_V0L%3DQRMR8i7g%40mail.gmail.com.
I like Swedish meatballs. Its my favorite reason to go to IKEA.
Ya you are creating local qwidgets for no reason, using the None return value from the setters you are calling on the existing widgets
QtGui.QListWidget(self.listCategory.addItems(category))
QtGui.QGroupBox(self.infoBoxProject.setTitle("Assets for Project: %s" % os.path.basename(os.environ["JOB"])))
QtGui.QGroupBox(self.infoBoxAsset.setTitle("INFO:"))
Each one of those is just creating a widget with no parent that gets garbage collected after your constructor ends.
You just want:
self.listCategory.addItems(category)
self.infoBoxProject.setTitle("Assets for Project: %s" % os.path.basename(os.environ["JOB"]))
self.infoBoxAsset.setTitle("INFO:")
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAKW24e0%3Ds%3DyiqY_w%3DJWCa%3DDhFQaiUPyEoaED9sx9TcxKj5Mdzw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0aD7Y%2BVRZsj1DpAOCLeFzs51MdGVFNBbpyT81ixTBfbQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/-4924351129100263996%40unknownmsgid.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA13cS3DyEj22LwCm8p2gAHJyCV_9DcNeT7GZX0Awo12zA%40mail.gmail.com.