diff --git qt5/style/qtcurve_api.cpp qt5/style/qtcurve_api.cpp
index 87a927f..02637d3 100644
|
|
Style::drawControl(ControlElement element, const QStyleOption *option, |
3197 | 3207 | drawControl(CE_PushButtonBevel, btn, painter, widget); |
3198 | 3208 | |
3199 | 3209 | QStyleOptionButton subopt(*btn); |
| 3210 | if (!btn->icon.isNull() |
| 3211 | && !(styleHint(SH_DialogButtonBox_ButtonsHaveIcons, btn, widget) || btn->text.isEmpty())) { |
| 3212 | // remove the icon from our local QStyleOptionButton copy |
| 3213 | subopt.icon = QIcon(); |
| 3214 | } |
3200 | 3215 | |
3201 | | subopt.rect = subElementRect(SE_PushButtonContents, btn, widget); |
| 3216 | subopt.rect = subElementRect(SE_PushButtonContents, &subopt, widget); |
3202 | 3217 | drawControl(CE_PushButtonLabel, &subopt, painter, widget); |
3203 | 3218 | |
3204 | 3219 | if (state & State_HasFocus && |
… |
… |
Style::drawControl(ControlElement element, const QStyleOption *option, |
3251 | 3266 | if (!styleHint(SH_UnderlineShortcut, button, widget)) |
3252 | 3267 | tf |= Qt::TextHideMnemonic; |
3253 | 3268 | |
3254 | | if (!button->icon.isNull()) |
| 3269 | if (!button->icon.isNull() |
| 3270 | && (styleHint(SH_DialogButtonBox_ButtonsHaveIcons, button, widget) || button->text.isEmpty())) |
3255 | 3271 | { |
3256 | 3272 | //Center both icon and text |
3257 | 3273 | QIcon::Mode mode(button->state&State_Enabled ? QIcon::Normal : QIcon::Disabled); |
… |
… |
QSize Style::sizeFromContents(ContentsType type, const QStyleOption *option, con |
6033 | 6049 | if (!opts.stdBtnSizes) { |
6034 | 6050 | // Cant rely on AutoDefaultButton |
6035 | 6051 | // - as VirtualBox does not set this!!! |
6036 | | if (qtcCheckType<QDialogButtonBox>(getParent(widget)) || |
6037 | | qtcCheckType(getParent(widget), "KFileWidget")) { |
| 6052 | bool allowIcon = styleHint(SH_DialogButtonBox_ButtonsHaveIcons, btn, widget) || btn->text.isEmpty(); |
| 6053 | if (allowIcon && (qtcCheckType<QDialogButtonBox>(getParent(widget)) || |
| 6054 | qtcCheckType(getParent(widget), "KFileWidget"))) { |
6038 | 6055 | int iconHeight = (btn->icon.isNull() ? |
6039 | 6056 | btn->iconSize.height() : 16); |
6040 | 6057 | if (size.height() < iconHeight + 2) { |