[PyQt] widgets and references in python
noagbodjivictor at gmail.com
Tue Jun 29 09:50:49 BST 2010
i have encountered an issue that i have reduced to this sample code:
if __name__ == '__main__':
from PyQt4.QtGui import QLabel
from PyQt4.QtCore import QTimer
from PyQt4.QtGui import QApplication
app = QApplication(sys.argv)
for i in range(3):
l = QLabel('%d' % i)
because i'm using the same variable to reference the instances, only one
instance remains (the last one) which is not really what i expect.
what is the way to create several widgets in a loop? thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the PyQt