I'm having a go at my first attempted at creating a GUID with Pyside and QT.
I looked at some tutorials and created this attempted below.
I'm trying to create some sort of a window that prints what ever the script finds, so instead of using the python shell window, it prints at this new window I created. The App runs and creates the GUID, the bottom lunches the script but now is where I'm stuck.
The app freezes until the script has run to the end instead of printing the results as it goes though the loop.
here is the code:
import sys
import PySide
from PySide.QtCore import *
from PySide.QtGui import *
import time
class Form(QDialog):
def __init__(self,parent=None):
super(Form, self).__init__(parent)
self.browser = QTextBrowser()
lable = QLabel("Print Window:")
self.botton = QPushButton('Start Search')
self.botton.setMaximumWidth(150)
layout = QVBoxLayout()
layout.addWidget(lable)
layout.addWidget(self.browser)
layout.addWidget(self.botton)
self.setLayout(layout)
self.setWindowTitle("Test App")
self.setMinimumWidth(650)
self.connect(self.botton, SIGNAL('clicked()'), self.run)
def run(self):
TestList = ['loop 1','loop 2','loop 3','loop 4','loop 5']
for i in TestList:
self.browser.append(i)
time.sleep(1)
app = QApplication(sys.argv)
form = Form()
form.show()
app.exec_()
I have been learning python by myself for a couple of weeks, and thanks mainly to this website I already managed to learn a lot and create some apps.
hope someone can help me out with this one, I can't seem to figure it out. Thanks so much