Hi, During kdepim porting I saw that it was not possible to add a ActionButton as QButtonBox is protected. => we can do it if we create a derived class. But it’s not a very easy method for just add a button.
I would like to add a new method to do it. I created a patch for it. What do you think about it ? (Example when we need to add a ActionButton, it’s when we have a old "User1" button). Regards -- Laurent Montel | laurent.mon...@kdab.com | KDE/Qt Senior Software Engineer KDAB (France) S.A.S., a KDAB Group company Tel. France +33 (0)4 90 84 08 53, http://www.kdab.fr
diff --git a/src/kpagedialog.cpp b/src/kpagedialog.cpp index b9096ca..b52fad7 100644 --- a/src/kpagedialog.cpp +++ b/src/kpagedialog.cpp @@ -134,6 +134,11 @@ QPushButton *KPageDialog::button(QDialogButtonBox::StandardButton which) const return d_func()->mButtonBox->button(which); } +void KPageDialog::addActionButton(QAbstractButton *button) +{ + d_func()->mButtonBox->addButton(button, QDialogButtonBox::ActionRole); +} + KPageWidget *KPageDialog::pageWidget() { return d_func()->mPageWidget; diff --git a/src/kpagedialog.h b/src/kpagedialog.h index 09691a8..493698f 100644 --- a/src/kpagedialog.h +++ b/src/kpagedialog.h @@ -196,6 +196,11 @@ public: */ QPushButton *button(QDialogButtonBox::StandardButton which) const; + /** + * Set an action button. + */ + void addActionButton(QAbstractButton *button); + Q_SIGNALS: /** * This signal is emitted whenever the current page has changed.
_______________________________________________ Kde-frameworks-devel mailing list Kde-frameworks-devel@kde.org https://mail.kde.org/mailman/listinfo/kde-frameworks-devel