<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<title></title>
</head>
<body text="#000000" bgcolor="#ffffff">
Le 13/12/11 20:46, Richard a écrit :
<blockquote
cite="mid:57fb3cd8-fae3-4818-a76d-ccd8ebd27c5b@c13g2000vbh.googlegroups.com"
type="cite">
<pre wrap="">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.translate("MainWindow",
self.S1.name, None, QtGui.QApplication.UnicodeUTF8))
n=n+1
How can I delete buttons?
Thanks,
Richard
</pre>
</blockquote>
With PyQt:<br>
<br>
<pre wrap="">self.S1.button.deleteLater()
self.S1.button.setParent(None)
</pre>
Probably the same with pyside.<br>
<br>
<div class="moz-signature">-- <br>
Vincent V.V.<br>
<a href="https://launchpad.net/oqapy">Oqapy</a> . <a
href="https://launchpad.net/qarte+7">Qarte+7</a> . <a
href="https://launchpad.net/paqager">PaQager</a></div>
</body>
</html>