Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from PySide.QtCore import *
- from PySide.QtGui import *
- from PySide.QtUiTools import QUiLoader
- from Trader.core.outpost import Outpost
- def loadui(file_name):
- loader = QUiLoader()
- uifile = QFile(file_name)
- uifile.open(QFile.ReadOnly)
- ui = loader.load(uifile)
- uifile.close()
- return ui
- def create_topic(data):
- box = QGroupBox()
- grid = QGridLayout()
- nickname = QTextEdit()
- box.setFixedHeight(200)
- nickname.setText(data)
- grid.addWidget(nickname)
- box.setLayout(grid)
- return box
- if __name__ == "__main__":
- import sys
- app = QApplication(sys.argv)
- MainWindow = loadui("main.ui")
- MainWindow.vlay.setAlignment(Qt.AlignTop)
- timer = QTimer()
- timer.start(5000)
- def create(outpost):
- widg = create_topic(outpost.trades + " : " + outpost.posts)
- MainWindow.vlay.addWidget(widg)
- def output_slot():
- outpost = Outpost('12345')
- outpost.finished.connect(create(outpost))
- timer.timeout.connect(output_slot)
- MainWindow.show()
- app.exec_()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement