Ask your own question, for FREE!
Computer Science 11 Online
OpenStudy (anonymous):

i want to update some label text in my program that written with python and pyqt4 i think that i have to use QTread can someone tell me how to use it .

OpenStudy (shadowfiend):

You shouldn't need a QThread to change label text. I'd have to see the specifics of how you've set things up, but usually you should just be able to refer to the label and call setText on it; e.g.: label = QtGui.QLabel(self) label.setText("My text")

OpenStudy (anonymous):

ah sorry i forget to say that i want to update it every 5 sec

OpenStudy (shadowfiend):

Got it. Look into QTimer. You can connect a QTimer's timeout signal to a slot in your class, causing it to fire every X amount of time (5 seconds in your case), and in that slot you can set the label text.

OpenStudy (anonymous):

thanks that exactly what i want .

OpenStudy (shadowfiend):

Sweet!

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Latest Questions
Arriyanalol: i need help
1 day ago 7 Replies 1 Medal
Arriyanalol: CONGRATS to me
2 days ago 8 Replies 2 Medals
Legomaster346: What colleges are good that are near Arab Alabama?
1 week ago 5 Replies 0 Medals
Arriyanalol: i need help
1 week ago 6 Replies 2 Medals
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!