pyside dynamic buttons

Discussion in 'Python' started by Richard, Dec 13, 2011.

  1. Richard

    Richard Guest

    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
    Richard, Dec 13, 2011
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Lauro Moura

    ANN: PySide has been released

    Lauro Moura, Aug 18, 2009, in forum: Python
    Replies:
    0
    Views:
    319
    Lauro Moura
    Aug 18, 2009
  2. rm

    PySide > PyQt

    rm, Oct 20, 2009, in forum: Python
    Replies:
    0
    Views:
    350
  3. rm

    PySide > PyQt

    rm, Oct 20, 2009, in forum: Python
    Replies:
    3
    Views:
    3,253
    Robert Kern
    Oct 21, 2009
  4. Matti Airas
    Replies:
    0
    Views:
    244
    Matti Airas
    Dec 18, 2010
  5. Aaron Scott
    Replies:
    1
    Views:
    744
    Kevin Walzer
    Sep 2, 2011
Loading...

Share This Page