Hi <br><br>I want to update the Qlabel after the widget is made , Problem is that updating is base on counter so i call that function after 4 seconds , but when it by pass the "if" statment it go through all the commands give me no errors but it does not update the widet although if i dont putt "if" statment all lines are executed and Qlabel update too . Can you please tell me where i am wrong<br>
<br>Here is code <br><br>import sys,os<br>from functools import partial<br>from PyQt4 import QtGui, QtCore<br>import time<br><br><br>class main():<br><br>def f2(self):<br> print "f2"<br> global count<br>
count +=1<br> if ( count == 2):<br> msg_label["user"] = QtGui.QLabel("update",widget)<br> msg_label["user"].setGeometry(10, 10, 100, 100)<br>
print count<br> QtCore.QTimer.singleShot(4000, self.f2)<br><br><br>app = QtGui.QApplication(sys.argv)<br>widget = QtGui.QWidget()<br>layout = QtGui.QVBoxLayout()<br>buttons = {}<br>count = 0<br>
msg_label = {}<br>sk = main()<br>sk.f2()<br>widget.show()<br>sys.exit(app.exec_())<br>