101{
103
104 QDialogButtonBox::ButtonRole role = QDialogButtonBox::InvalidRole;
105 switch (key) {
108 role = QDialogButtonBox::HelpRole;
109 break;
112 role = QDialogButtonBox::ResetRole;
113 break;
115 role = QDialogButtonBox::AcceptRole;
116 break;
118 role = QDialogButtonBox::ApplyRole;
119 break;
122 role = QDialogButtonBox::YesRole;
123 break;
126 role = QDialogButtonBox::RejectRole;
127 break;
129 role = QDialogButtonBox::NoRole;
130 break;
134 role = QDialogButtonBox::ActionRole;
135 break;
136 default:
137 role = QDialogButtonBox::InvalidRole;
138 break;
139 }
140
141 if (role == QDialogButtonBox::InvalidRole) {
142 return;
143 }
144
145 QPushButton *
button =
new QPushButton;
146 KGuiItem::assign(
button, item);
148
150
151 QObject::connect(
button, &QPushButton::clicked, q, [=] { q->slotButtonClicked(key); });
152
154
156 }
157}
QHash< int, QPushButton * > mButtonList
A dialog base class with standard buttons and predefined layouts.
@ User2
Show User defined button 2.
@ Ok
Show Ok button. (this button accept()s the dialog; result set to QDialog::Accepted)
@ No
Show No button. (this button closes the dialog and sets the result to KoDialog::No)
@ Reset
Show Reset button.
@ Apply
Show Apply button.
@ User3
Show User defined button 3.
@ Yes
Show Yes button. (this button closes the dialog and sets the result to KoDialog::Yes)
@ Default
Show Default button.
@ User1
Show User defined button 1.
@ Details
Show Details button. (this button will show the detail widget set with setDetailsWidget)
@ Cancel
Show Cancel-button. (this button reject()s the dialog; result set to QDialog::Rejected)
@ Help
Show Help button. (this button will run the help set with setHelp)
@ Close
Show Close-button. (this button closes the dialog)
QString button(const QWheelEvent &ev)