class Login(QtGui.QDialog):

    def __init__(self, parent=None):
        super(Login, self).__init__(parent)
self.textName = QtGui.QLineEdit(self)
self.textPass = QtGui.QLineEdit(self)
self.buttonLogin = QtGui.QPushButton('Login', self)
self.buttonLogin.clicked.connect(self.handleLogin)
layout = QtGui.QVBoxLayout(self)
layout.addWidget(self.textName)
layout.addWidget(self.textPass)
layout.addWidget(self.buttonLogin)
Login dialog PyQt