[review] [PyKDE] Removing tabs from QTabWidget

Jim Bublitz jbublitz at nwinternet.com
Thu Oct 16 19:23:01 BST 2003


On Wednesday October 15 2003 23:21, Trevor Phillips wrote:
> What is the best way to remove (and delete) all pages/tabs
> under a QTabWidget?

> I'm creating the content of a set of tabs dynamically, and
> within the run of the app, I also need to be able to recreate
> the same output. ie; Deleting all tabs, and adding in the new
> revised ones.

> At the moment I'm setting the current page to 0, and then
> while there's a current page, calling removePage. I've read,
> though, that this just hides the page, and doesn't deallocate
> it in memory. Is this an issue in the python implementation?

That's how the C++ Qt objects behave (QTabWidget or QWidgetStack)

Wouldn't it be easier just to destroy the entire QTabWidget and 
recreate it? I'm not sure if you'd still need to delete the page 
objects manually - I'm guessing you'd have to, but haven't tried 
it.

Jim




More information about the PyQt mailing list