Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- # -*- coding: utf-8 -*-
- import sys
- from PySide.QtCore import *
- from PySide.QtGui import *
- string = ""
- class Problems(QWidget):
- par = None
- def __init__(self, parent = None):
- super(Problems, self).__init__(parent)
- self.judgeid = QLineEdit("Enter your string")
- self.button = QPushButton("Ok")
- layout = QVBoxLayout()
- layout.addWidget(self.judgeid)
- layout.addWidget(self.button)
- self.setLayout(layout)
- self.button.clicked.connect(self.login)
- self.button.clicked.emit(parent)
- print type(parent)
- @Slot(QWidget)
- def login(self, parent):
- global string
- string = self.judgeid.text()
- a = QWidget()
- parent.mainTile.addTab(a, "TestTab")
- class Application(QWidget):
- def __init__(self, parent = None):
- super(Application, self).__init__(parent)
- self.mainTile = QTabWidget()
- self.setWindowTitle("Hello crazy world!")
- layout = QVBoxLayout()
- lay1 = Problems(self)
- self.mainTile.addTab(lay1, "Problems")
- layout.addWidget(self.mainTile)
- self.setLayout(layout)
- if __name__ == '__main__':
- # Create the Qt Application
- app = QApplication(sys.argv)
- # Create and show the form
- mainWindow = Application()
- mainWindow.show()
- # Run the main Qt loop
- sys.exit(app.exec_())
Advertisement
Add Comment
Please, Sign In to add comment