Changing default in QToolBar::buttonStyle

Àlex Fiestas afiestas at kde.org
Mon Aug 12 16:06:41 UTC 2013


Hi there

One of the tasks that I'm working on is "Make QToolBar use KDE settings", 
which include the buttonStyle.

For those that don't know, the buttonStyle is whether the QToolButton created 
by QToolBar will have text along side, bottom, only text or no text at all.

While Qt is prepared to update this based on the loaded QStyle, it will only 
do that if QToolBar::toolButtonStyle is set to Qt::ToolButtonFollowStyle which 
is not the default (Qt::ToolButtonIconOnly is).

At first I thought on making this configurable somehow within Qt, or even 
updating/forcing it within our QPT (which is perfectly possible), but after 
seeing what the outcome is, I have discarded it:

Some of the most common Qt only application with the setting changed:

http://wstaw.org/m/2013/08/12/smplayer-style.png
http://wstaw.org/m/2013/08/12/smplayer-icons.png

http://wstaw.org/m/2013/08/12/scribus-style.png
http://wstaw.org/m/2013/08/12/scribus-icons1.png

http://wstaw.org/m/2013/08/12/qgit-style1.png
http://wstaw.org/m/2013/08/12/qgit-icons.png

http://wstaw.org/m/2013/08/12/designer-style.png
http://wstaw.org/m/2013/08/12/designer-icons2.png

As you can see, they completely break if we change the default :/

Since what we want is to offer QToolBar as an alternative to KToolBar for our 
app developers that don't want XMLGui we can do the following:

1-Modify Qt documentation to show Qt::ToolButtonFollowStyle in QToolBar and 
QMainWindow  documentation
2-Update Qt example: http://qt-project.org/doc/qt-5.1/qtwidgets/mainwindows-application.html
3-Add information in KDE5PORTING ?

What do you think?

Cheers !


More information about the Kde-frameworks-devel mailing list