Dear All,
I'm new to pyside so please forgive my ignorance. I can create a
mainwindow with Designer and I can call this with pyside without
problem. But, when I create a simple widget in Designer (e.g.,
QTabWidget), I cannot get it to load into pyside. With the script
below, when I call TabWidget() in __main__, I get the error:
AttributeError: 'TabWidget' object has no attribute 'addTab'
even though the widget is just a basic Designer two-tab widget with a
button added to each tab.
My basic question is how do I use simple widgets (not
templates/forms) created in Designer in pyside?
Sample Code:
#!/usr/bin/env python
import sys
from PySide.QtCore import *
from PySide.QtGui import *
from tabwidget_ui import Ui_TabWidget
from mainwindow_ui import Ui_MainWindow
class TabWidget(QMainWindow, Ui_TabWidget):
def __init__(self, parent=None):
super(TabWidget, self).__init__(parent)
self.setupUi(self)
class MainWindow(QMainWindow, Ui_MainWindow):
def __init__(self, parent=None):
super(MainWindow, self).__init__(parent)
self.setupUi(self)
if __name__ == '__main__':
app = QApplication(sys.argv)
frame = TabWidget()
frame.show()
app.exec_()
Thanks!
Laurence
_______________________________________________
PySide mailing list
[email protected]
http://lists.pyside.org/listinfo/pyside