Problem number 1, where does hlay come from? It isn’t defined anywhere in that snippet.
hlay.addWidget(self.add_button)
Problem number 2, adding the widget with the layer to the layout? This line should probably be removed..
hlay.addWidget(self)
And replaced with:
hlay = QtGui.QHBoxLayout(self)
Unless the tab bar already had a layout you could/should use.
hlay = self.layout()
Just double-check it’s the right kind of layout, e.g. a QHBoxLayout.
--
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/f3418d80-dd83-4561-9f90-7975c3aa8a9d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
class MyTabBar(QtGui.QTabBar): def __init__(self, parent=None): super(MyTabBar, self).__init__(parent) ...
...
hlay = QtGui.QHBoxLayout(self) hlay.addWidget(self.add_button)
...
# Or added in the following
self.setLayout(self)Hi Marcus, my bad on this. `hlay` actually refers to the `HBoxLayout()`I have updated the snippet - https://pastebin.com/raw/EYcMh5hq
When trying out your method where:class MyTabBar(QtGui.QTabBar):def __init__(self, parent=None):super(MyTabBar, self).__init__(parent)...
...hlay = QtGui.QHBoxLayout(self)hlay.addWidget(self.add_button)
...
# Or added in the following
self.setLayout(self)
While it does not seems to error out but the 'add' icon is gone, and I am presented with nothing..
--
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/1e49a218-9a06-437e-b2bb-ee971e59a913%40googlegroups.com.
--
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/f3f134a2-d195-4016-bb5c-50b1ce6aa941%40googlegroups.com.
Instead of `class MyTabBar(QtGui.QTabBar)`, I created it as `class MyTabBar(QtGui.QMainWindow)` and a new variable solely for `QTabBar` and it works...
Even so, (as I am not sure) , generally, to use `QTabBar`, does it always go along with the use of `QTabWidget`?
--
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/106eb8a3-7718-4684-b137-5493c00cd186%40googlegroups.com.