[PyKDE] Disappearing Layout Widget

Phil Thompson phil at riverbankcomputing.co.uk
Tue Aug 16 09:03:23 BST 2005


> On 8/11/05, Chad Brantly <cbrantly at darwin.sfbr.org> wrote:
>> This kind of works, but not exactly.
>> self.SearchCriteriaGroupBox.layout() is a QVBoxLayout, not the
>> QGridLayout.  I need to get to the QGridLayout created in the ui file
>> and insert another widget into it.  I tried changing the last line of
>> main.py to:
>>
>>      SearchCrteriaGroupBoxLayout = QGridLayout
>> (self.SearchCriteriaGroupBox.layout())
>>      SearchCriteriaGroupBoxLayout.addMultiCellWidget
>> (self.SearchCriteriaListView, 0, 0, 0, 4)
>>
>> But as you would expect, it just added a second QGridLayout below the
>> one created by ui.py.  Is there anyway to get to add a widget to the
>> QGridLayout that was created by ui.py?
>>
>
> It should be possible to navigate the various layout's children to get
> at the correct instance.    I haven't tried this, so you're going to
> have to experiment.  (Python's interactive shell is one of its best
> features.)

Note that this will be easier in the next release of PyQt because it
should work out the exact type of the layout.

Phil




More information about the PyQt mailing list