When I try go show a window (AddUserGui) it just resize the Ui_MainWindow. I think the problem occurs when I send "self" as a argument. How do you solve this? or is this a stuipd way to do it?
from PyQt4 import QtCore, QtGui
from libarylib import *
from bibgui import Ui_MainWindow
from addusergui import Ui_Dialog as AddUserGui
import sys
def __init__(self, parent=None):
QtGui.
QWidget.__init__
(self, parent
) self.ui = Ui_MainWindow()
self.ui.setupUi(self)
self.connect(self.ui.pushButton_3, QtCore.SIGNAL("clicked()"), self.addUser)
def addUser(self):
self.adduser = AddUserGui()
self.adduser.setupUi(self) #<-- this don't work
if __name__ == "__main__":
myapp = mainGuiWindow()
myapp.show()
sys.exit(app.exec_())
from PyQt4 import QtCore, QtGui
from libarylib import *
from bibgui import Ui_MainWindow
from addusergui import Ui_Dialog as AddUserGui
import sys
class mainGuiWindow(QtGui.QMainWindow):
def __init__(self, parent=None):
QtGui.QWidget.__init__(self, parent)
self.ui = Ui_MainWindow()
self.ui.setupUi(self)
self.connect(self.ui.pushButton_3, QtCore.SIGNAL("clicked()"), self.addUser)
def addUser(self):
self.adduser = AddUserGui()
self.adduser.setupUi(self) #<-- this don't work
if __name__ == "__main__":
app = QtGui.QApplication(sys.argv)
myapp = mainGuiWindow()
myapp.show()
sys.exit(app.exec_())
To copy to clipboard, switch view to plain text mode
Bookmarks