[Gambas-user] Deletion of tabs from a TabStrip

Rob sourceforge-raindog2 at ...94...
Wed Jan 19 00:18:37 CET 2005


On Friday 14 January 2005 13:18, Rob Kendrick wrote:
> > Unfortunately, the tabs themselves aren't real controls and
> > therefore don't automatically have a delete method.  The
> > underlying Qt control, QTabBar, does have a removeTab method
> > and so it should be possible to add a .Remove or .Delete to
> > the .Tab virtual class in Gambas.  I'll look into it today
> > and see if I can submit a patch against gambas 1.9.x.
> That'd be great, thanks!  On another point, is it possible to
> create new widgets on a tab without having to first switch to
> it?  I've briefly played with this, but with little success.

My bad, it turns out TabStrip is based on a QTabWidget, not a 
QTabBar. QTabBar is a more similar widget to what TabStrip does, 
but seems to be deprecated or something.  QTabWidget uses a 
widget (in our case, a QPanel) for each tab, and while it's 
simple enough to remove the reference to that tab, I will need 
to patch the qt component to destroy the widget and all its 
contents, and I dunno how easy that is gonna be.

It is definitely possible to add widgets to a tab in a QTabWidget 
control, but the way the TabStrip is implemented I'm not sure 
this is practical.  When I have more time to hack at this, I'll 
see if I can do that.  Hopefully this won't make it too 
difficult to develop the gtk version of the TabStrip :)

Rob







More information about the User mailing list