[PyQt] QT4/QTabWidget tab add/remove/

S James S Stapleton stapleton at mps.ohio-state.edu
Sun Jun 10 03:04:13 BST 2007

Thanks, I'll try this stuff tomorrow (no time tonight unfortunately). Real 
quick though - is there any way to create my feature_boxes so that they go 
into the tabber, without using a temporary widget (I used the temp, to see if 
that fixed the issue, because I was using the ig_moduleapp.main widget 

-Jim Stapleton

On Saturday 09 June 2007 21:18, David Boddie wrote:
> On Sun Jun 10 00:18:35 BST 2007, S James S Stapleton wrote:
> > On Friday 08 June 2007 20:23, S James S Stapleton wrote:
> > > I have a tabwidget in an application where tabs are being added/removed
> > > at runtime, according to loaded data and user commands. The problem is,
> > > that when tabs are added, they appear in the background of the current
> > > tab, as an underlay. If I cycle through the loaded tabs they dissapear.
> > > but that's tedious to do every run while debugging.
> >
> > The files are located here:
> > http://www.thestapletons.org/jim/varapp.tbz
> >
> > If you load up the "creatures.fls" file, using the file->load features
> > option, you'll see the graphical glitches I was talking about.
> There are two types of graphical glitch here: the first is due to the
> delays in processing the data used for each tab; the second is a result of
> the way you've created widgets for use with the tab widget.
> There's not much that can be done about the delays you see when the data
> is loaded unless you ensure that the event loop is periodically run. This
> isn't causing the problems you see, so we won't look at this now.
> The underlay problem is caused when widgets are created with certain
> parents then reparented later. In this case, you create a feature_box
> widget and put it inside a QWidget ("tmp") before passing it (not the
> widget) to addTab().
> Ideally, you should pass the feature_box itself to addTab() but, if each
> feature_box is designed to have a parent widget, you should pass the "tmp"
> QWidget instead. If you do this, you might want to remove the resize
> handling code in feature_box and just place each instance of this class in
> a layout. Even if you just pass "tmp" to addTab(), this will solve the
> underlay effect you reported.
> I also noticed that you create various widgets, and call show() and hide()
> on them at various times. This might be the cause of the blank areas that
> temporarily appear in the main window.
> If you change line 398 of ig_moduleapp.py to
>             offset = tabber.addTab(tmp, name)
> does this fix some of the problems you were seeing?
> David
> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt

More information about the PyQt mailing list