Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: UTF-8 -*-
- import sys
- from PyQt4 import QtCore, QtGui
- from uiMain import Ui_MainWindow
- from uiAuth import Ui_Login
- class Login(QtGui.QDialog):
- def __init__(self, parent=None):
- QtGui.QWidget.__init__(self, parent)
- self.parent = parent
- self.setModal(True)
- self.User = None
- self.Pass = None
- self.ui = Ui_Login()
- self.ui.setupUi(self)
- QtCore.QObject.connect(self, QtCore.SIGNAL("accepted()"), self.onAccept )
- QtCore.QObject.connect(self, QtCore.SIGNAL("rejected()"), self.onReject )
- def onAccept(self):
- self.User = self.ui.edUser.text()
- self.Pass = self.ui.edPass.text()
- def onReject(self):
- #print "nem deu =/"
- pass
- class Main(QtGui.QMainWindow):
- def __init__(self, parent=None):
- QtGui.QWidget.__init__(self, parent)
- self.parent = parent
- self.ui = None
- self.ui = Ui_MainWindow()
- self.ui.setupUi(self)
- QtCore.QObject.connect(self.ui.actionLogin, QtCore.SIGNAL("triggered()"), self.doLogin )
- def doLogin(self):
- self.auth = Login(self)
- self.auth.show()
- print self.auth.User
- if __name__ == "__main__":
- app = QtGui.QApplication(sys.argv)
- myapp = Main()
- myapp.show()
- sys.exit(app.exec_())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement