Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Python (http://www.velocityreviews.com/forums/f43-python.html)
-   -   pyside dynamic buttons (http://www.velocityreviews.com/forums/t806920-pyside-dynamic-buttons.html)

Richard 12-13-2011 07:46 PM

pyside dynamic buttons
 
Hi,

We are making a screen with data driven buttons. I can add buttons but
can't redraw the buttons for new values. The buttuns are placed in a
frame.
I draw the buttons on the screen in a for loop:

def drawS1Butons(self):
n=0
for self.S1 in self.Org.getVpuChilds(self.Focus):
self.S1.button = QtGui.QPushButton(self.frame_2) # Add
method to the button class !?!?
self.S1.button.setGeometry(QtCore.QRect(80, n*30, 161,
23))
self.S1.button.setObjectName(self.S1.name)

self.S1.button.setText(QtGui.QApplication.translat e("MainWindow",
self.S1.name, None, QtGui.QApplication.UnicodeUTF8))
n=n+1


How can I delete buttons?

Thanks,
Richard


All times are GMT. The time now is 07:33 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.