Main Toolbar/Toolbar in QToolBar

Kevin Ottens ervin+bluesystems at kde.org
Tue Aug 13 12:17:42 UTC 2013


On Tuesday 13 August 2013 14:00:37 Àlex Fiestas wrote:
> So, last thing to discuss about "Make QToolBar follow KDE settings" is the
> differentiation we do between Main Toolbar and just Toolbar.
> 
> Effectively a Main Toolbar is usually a toolbar that is a child of
> QMainWindow while a "ToolBar" is a toolbar who's parent is another QWidget.
> 
> While Qt doesn't call them "Main Toolbar" it can differentiate them by:
> QMainWindow::setButtonStyle and QMainWindow::setIconSize
> 
> So it seems that the way to go is make the differentiation in the Style,
> doing either of these two things:
> 
> QWidget *parent = qtoolbar->parentWidget();
> if (qobject_cast<QMainWIndow*>(parent)) {
> 	return MainToolbar;
> } else {
>  	return Toolbar;
> }
> 
> Some code like this should be in KStyle and oxygenstyle and all styles that
> are considered KDE (Note that the style plays an important role when
> integrating a platform in Qt, so we need K stuff in there)

Let's make that the fallback plan if...
 
> or we can also try to add new stylehints:
> -PM_MainWindowToolBarIconSize
> -PH_MainWindow_ToolBar_buttonStyle
> -PH_toolBar_buttonStyle
> 
> I think the second option (Adding stylehints) is the best one, these
> stylehints really make sense since Qt is already making the differentiation
> and allowing the developer to change those values by hand, so it only makes
> sense to allow the style to change those as well.

... that option fails. I think it's worth the effort to try the hints route, 
not sure it'll get accepted though, we'll find out by trying.

Cheers.
-- 
Kévin Ottens, http://ervin.ipsquad.net

Sponsored by BlueSystems and KDAB to work on KDE Frameworks
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20130813/bde9b999/attachment.sig>


More information about the Kde-frameworks-devel mailing list