LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 11-23-2009, 04:05 AM   #1
threaderslash
Member
 
Registered: Dec 2008
Location: HongKong
Distribution: Fedora/Centos/RedHat
Posts: 105

Rep: Reputation: 15
Cool QtPython: removeChild/addChild QGroupBox


Hello 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.
Code:
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.
 
  


Reply

Tags
member


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
QtPython QtreeWidget - sortingEnabled Problem threaderslash Programming 1 11-16-2009 09:38 PM


All times are GMT -5. The time now is 11:34 AM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration