KTabWidget task

David Faure faure+bluesystems at kde.org
Thu Mar 28 21:12:35 UTC 2013


On Tuesday 26 March 2013 23:48:26 David Gil Oliva wrote:
> Hi!
> 
> Before implementing setTabBarHidden(bool) and isTabBarHidden() from
> KTabWidget to QTabWidget, I have made a little program (you can find it
> attached, rename its extension to .tar.gz) to test whether these methods
> are really necessary.
> 
> The point is that it seems that the main purpose of setTabBarHidden(bool)
> is to get corner widgets also hidden. But corner widget also get hidden
> with QTabWidget::tabBar->hide(bool), as can be seen with the little program
> I've made, and therefore, as far as I can tell, the exact same result can
> be achieved with both methods.

Very interesting! Good thinking, testing this first.

I debugged it, and it turns out that hiding the tabbar makes the tabwidget re-
layout (QTabWidget::setUpLayout), which calculates a geometry for the corner 
widget with 0 height [negative, actually].

So indeed, this hides the corner widgets.

> This makes it much harder to defend the implementation of the
> hiding-related KTabWidget methods into QTabWidget.

Yep, let's just document that tabBar()->hide() is the replacement for 
setTabBarHidden. Can you make a patch with that, the deprecation macro, 
porting all existing code, and remove the task from the Qt-5.1todo list?

Thanks!

-- 
David Faure, faure at kde.org, http://www.davidfaure.fr
Sponsored by BlueSystems and KDAB to work on KDE Frameworks



More information about the Kde-frameworks-devel mailing list