1// qdialogbuttonbox.sip generated by MetaSIP 2// 3// This file is part of the QtWidgets Python extension module. 4// 5// Copyright (c) 2021 Riverbank Computing Limited <info@riverbankcomputing.com> 6// 7// This file is part of PyQt5. 8// 9// This file may be used under the terms of the GNU General Public License 10// version 3.0 as published by the Free Software Foundation and appearing in 11// the file LICENSE included in the packaging of this file. Please review the 12// following information to ensure the GNU General Public License version 3.0 13// requirements will be met: http://www.gnu.org/copyleft/gpl.html. 14// 15// If you do not wish to use this file under the terms of the GPL version 3.0 16// then you may purchase a commercial license. For more information contact 17// info@riverbankcomputing.com. 18// 19// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 20// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 21 22 23class QDialogButtonBox : QWidget 24{ 25%TypeHeaderCode 26#include <qdialogbuttonbox.h> 27%End 28 29public: 30 enum ButtonLayout 31 { 32 WinLayout, 33 MacLayout, 34 KdeLayout, 35 GnomeLayout, 36%If (Qt_5_10_0 -) 37 AndroidLayout, 38%End 39 }; 40 41 enum ButtonRole 42 { 43 InvalidRole, 44 AcceptRole, 45 RejectRole, 46 DestructiveRole, 47 ActionRole, 48 HelpRole, 49 YesRole, 50 NoRole, 51 ResetRole, 52 ApplyRole, 53 }; 54 55 enum StandardButton 56 { 57 NoButton, 58 Ok, 59 Save, 60 SaveAll, 61 Open, 62 Yes, 63 YesToAll, 64 No, 65 NoToAll, 66 Abort, 67 Retry, 68 Ignore, 69 Close, 70 Cancel, 71 Discard, 72 Help, 73 Apply, 74 Reset, 75 RestoreDefaults, 76 }; 77 78 typedef QFlags<QDialogButtonBox::StandardButton> StandardButtons; 79 QDialogButtonBox(QWidget *parent /TransferThis/ = 0); 80 QDialogButtonBox(Qt::Orientation orientation, QWidget *parent /TransferThis/ = 0); 81%If (Qt_5_2_0 -) 82 QDialogButtonBox(QDialogButtonBox::StandardButtons buttons, QWidget *parent /TransferThis/ = 0); 83%End 84%If (Qt_5_2_0 -) 85 QDialogButtonBox(QDialogButtonBox::StandardButtons buttons, Qt::Orientation orientation, QWidget *parent /TransferThis/ = 0); 86%End 87%If (- Qt_5_2_0) 88 QDialogButtonBox(QFlags<QDialogButtonBox::StandardButton> buttons, Qt::Orientation orientation = Qt::Horizontal, QWidget *parent /TransferThis/ = 0); 89%End 90 virtual ~QDialogButtonBox(); 91 void setOrientation(Qt::Orientation orientation); 92 Qt::Orientation orientation() const; 93 void addButton(QAbstractButton *button /Transfer/, QDialogButtonBox::ButtonRole role); 94 QPushButton *addButton(const QString &text, QDialogButtonBox::ButtonRole role) /Transfer/; 95 QPushButton *addButton(QDialogButtonBox::StandardButton button) /Transfer/; 96 void removeButton(QAbstractButton *button /TransferBack/); 97 void clear(); 98 QList<QAbstractButton *> buttons() const; 99 QDialogButtonBox::ButtonRole buttonRole(QAbstractButton *button) const; 100 void setStandardButtons(QDialogButtonBox::StandardButtons buttons); 101 QDialogButtonBox::StandardButtons standardButtons() const; 102 QDialogButtonBox::StandardButton standardButton(QAbstractButton *button) const; 103 QPushButton *button(QDialogButtonBox::StandardButton which) const; 104 void setCenterButtons(bool center); 105 bool centerButtons() const; 106 107signals: 108 void accepted(); 109 void clicked(QAbstractButton *button); 110 void helpRequested(); 111 void rejected(); 112 113protected: 114 virtual void changeEvent(QEvent *event); 115 virtual bool event(QEvent *event); 116}; 117 118QFlags<QDialogButtonBox::StandardButton> operator|(QDialogButtonBox::StandardButton f1, QFlags<QDialogButtonBox::StandardButton> f2); 119