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
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Kde-frameworks-devel mailing list Kde-frameworks-devel@kde.org https://mail.kde.org/mailman/listinfo/kde-frameworks-devel