diff options
Diffstat (limited to 'src/gui/widgets')
-rw-r--r-- | src/gui/widgets/qtoolbutton.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/gui/widgets/qtoolbutton.cpp b/src/gui/widgets/qtoolbutton.cpp index 6dcbfec..5d0a98a 100644 --- a/src/gui/widgets/qtoolbutton.cpp +++ b/src/gui/widgets/qtoolbutton.cpp @@ -378,7 +378,11 @@ void QToolButton::initStyleOption(QStyleOptionToolButton *option) const if (d->hasMenu()) option->features |= QStyleOptionToolButton::HasMenu; #endif - option->toolButtonStyle = d->toolButtonStyle; + if (d->toolButtonStyle == Qt::ToolButtonSystemDefault) { + option->toolButtonStyle = Qt::ToolButtonStyle(style()->styleHint(QStyle::SH_ToolButtonStyle, option, this)); + } else + option->toolButtonStyle = d->toolButtonStyle; + if (d->icon.isNull() && d->arrowType == Qt::NoArrow && !forceNoText) { if (!d->text.isEmpty()) option->toolButtonStyle = Qt::ToolButtonTextOnly; @@ -476,6 +480,10 @@ QSize QToolButton::minimumSizeHint() const The default is Qt::ToolButtonIconOnly. + If you want your toolbars to depend on system settings, + as is possible in GNOME and KDE desktop environments you should + use the ToolButtonSystemDefault. + QToolButton automatically connects this slot to the relevant signal in the QMainWindow in which is resides. */ |