QtPython: removeChild/addChild QGroupBox

Threader Slash threaderslash at gmail.com
Mon Nov 23 04:35:26 EST 2009


Hi Everybody,

I am developing a system for a customer which is displayed in a set of
GroupBox.
Depending on mouse events, the container (groupBox) must be removed from the
centralwidget, or then added with new updated data for the table.
Here is a piece of the code that runs nicely and shows the a groupBox.

Now it starts to show some effects on removeWidget, but it is still didn't
clear the box completely.. just the right border of the box is erased.

   self.vLayout_wdg = QtGui.QWidget(self.centralwidget)
   self.vLayout_wdg.setGeometry(QtCore.QRect(40, 160, 171, 121))
   self.vLayout_wdg.setObjectName("vLayout_wdg")

   self.vLayoutBoxObj = QtGui.QVBoxLayout(self.vLayout_wdg)
   self.vLayoutBoxObj.setObjectName("vLayoutBoxObj")

   self.newGroupBox = QtGui.QGroupBox(self.vLayout_wdg)
   self.newGroupBox.setObjectName("newGroupBox")

   self.radioButton1 = QtGui.QRadioButton(self.newGroupBox)
   self.radioButton1.setGeometry(QtCore.QRect(30, 30, 101, 21))
   self.radioButton1.setObjectName("helloRadioButton")

   self.radioButton2 = QtGui.QRadioButton(self.newGroupBox)
   self.radioButton2.setGeometry(QtCore.QRect(30, 60, 111, 18 )
   self.radioButton2.setObjectName("niceRadioButton")

   self.vLayoutBoxObj.addWidget(self.newGroupBox)

   if removeContainer_Button_Pressed:
         self.vLayoutBoxObj.removeWidget(self.newGroupBox)
         self.newGroupBox.adjustSize()
         self.vLayoutBoxObj.deleteLater()
         self.vLayoutBoxObj.update()

All hints and comments are highly welcome and appreciated.
ThreaderSlash
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20091123/7172a546/attachment.html>


More information about the Python-list mailing list