Add QStyle::standardPixmap support to all entries in QDialogButtonBox
QDialogButtonBox fetches icons from the qstyle for most of the buttons it creates, with the exception of 7. This patch adds support for the remaining buttons, so that all buttons can have icons added by the theme. Behavior is unchanged until a style implements these new enumerations. Change-Id: I2eba488a11e1b9979fff3b32dafbda11332a3d92 Reviewed-by: Kai Uwe Broulik <kde@privat.broulik.de> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
This commit is contained in:
parent
9eb50751b8
commit
785d2b9d07
@ -832,6 +832,13 @@ public:
|
|||||||
SP_MediaVolume,
|
SP_MediaVolume,
|
||||||
SP_MediaVolumeMuted,
|
SP_MediaVolumeMuted,
|
||||||
SP_LineEditClearButton,
|
SP_LineEditClearButton,
|
||||||
|
SP_DialogYesToAllButton,
|
||||||
|
SP_DialogNoToAllButton,
|
||||||
|
SP_DialogSaveAllButton,
|
||||||
|
SP_DialogAbortButton,
|
||||||
|
SP_DialogRetryButton,
|
||||||
|
SP_DialogIgnoreButton,
|
||||||
|
SP_RestoreDefaultsButton,
|
||||||
// do not add any values below/greater than this
|
// do not add any values below/greater than this
|
||||||
SP_CustomBase = 0xf0000000
|
SP_CustomBase = 0xf0000000
|
||||||
};
|
};
|
||||||
|
@ -387,12 +387,25 @@ QPushButton *QDialogButtonBoxPrivate::createButton(QDialogButtonBox::StandardBut
|
|||||||
icon = QStyle::SP_DialogNoButton;
|
icon = QStyle::SP_DialogNoButton;
|
||||||
break;
|
break;
|
||||||
case QDialogButtonBox::YesToAll:
|
case QDialogButtonBox::YesToAll:
|
||||||
|
icon = QStyle::SP_DialogYesToAllButton;
|
||||||
|
break;
|
||||||
case QDialogButtonBox::NoToAll:
|
case QDialogButtonBox::NoToAll:
|
||||||
|
icon = QStyle::SP_DialogNoToAllButton;
|
||||||
|
break;
|
||||||
case QDialogButtonBox::SaveAll:
|
case QDialogButtonBox::SaveAll:
|
||||||
|
icon = QStyle::SP_DialogSaveAllButton;
|
||||||
|
break;
|
||||||
case QDialogButtonBox::Abort:
|
case QDialogButtonBox::Abort:
|
||||||
|
icon = QStyle::SP_DialogAbortButton;
|
||||||
|
break;
|
||||||
case QDialogButtonBox::Retry:
|
case QDialogButtonBox::Retry:
|
||||||
|
icon = QStyle::SP_DialogRetryButton;
|
||||||
|
break;
|
||||||
case QDialogButtonBox::Ignore:
|
case QDialogButtonBox::Ignore:
|
||||||
|
icon = QStyle::SP_DialogIgnoreButton;
|
||||||
|
break;
|
||||||
case QDialogButtonBox::RestoreDefaults:
|
case QDialogButtonBox::RestoreDefaults:
|
||||||
|
icon = QStyle::SP_RestoreDefaultsButton;
|
||||||
break;
|
break;
|
||||||
case QDialogButtonBox::NoButton:
|
case QDialogButtonBox::NoButton:
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user