qdialogbuttonbox.sip 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. // qdialogbuttonbox.sip generated by MetaSIP
  2. //
  3. // This file is part of the QtWidgets Python extension module.
  4. //
  5. // Copyright (c) 2026 Riverbank Computing Limited <info@riverbankcomputing.com>
  6. //
  7. // This file is part of PyQt6.
  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. class QDialogButtonBox : public QWidget
  22. {
  23. %TypeHeaderCode
  24. #include <qdialogbuttonbox.h>
  25. %End
  26. public:
  27. enum ButtonLayout
  28. {
  29. WinLayout,
  30. MacLayout,
  31. KdeLayout,
  32. GnomeLayout,
  33. AndroidLayout,
  34. };
  35. enum ButtonRole
  36. {
  37. InvalidRole,
  38. AcceptRole,
  39. RejectRole,
  40. DestructiveRole,
  41. ActionRole,
  42. HelpRole,
  43. YesRole,
  44. NoRole,
  45. ResetRole,
  46. ApplyRole,
  47. };
  48. enum StandardButton /BaseType=Flag/
  49. {
  50. NoButton,
  51. Ok,
  52. Save,
  53. SaveAll,
  54. Open,
  55. Yes,
  56. YesToAll,
  57. No,
  58. NoToAll,
  59. Abort,
  60. Retry,
  61. Ignore,
  62. Close,
  63. Cancel,
  64. Discard,
  65. Help,
  66. Apply,
  67. Reset,
  68. RestoreDefaults,
  69. };
  70. typedef QFlags<QDialogButtonBox::StandardButton> StandardButtons;
  71. QDialogButtonBox(QWidget *parent /TransferThis/ = 0);
  72. QDialogButtonBox(Qt::Orientation orientation, QWidget *parent /TransferThis/ = 0);
  73. QDialogButtonBox(QDialogButtonBox::StandardButtons buttons, QWidget *parent /TransferThis/ = 0);
  74. QDialogButtonBox(QDialogButtonBox::StandardButtons buttons, Qt::Orientation orientation, QWidget *parent /TransferThis/ = 0);
  75. virtual ~QDialogButtonBox();
  76. void setOrientation(Qt::Orientation orientation);
  77. Qt::Orientation orientation() const;
  78. void addButton(QAbstractButton *button /Transfer/, QDialogButtonBox::ButtonRole role);
  79. QPushButton *addButton(const QString &text, QDialogButtonBox::ButtonRole role) /Transfer/;
  80. QPushButton *addButton(QDialogButtonBox::StandardButton button) /Transfer/;
  81. void removeButton(QAbstractButton *button /TransferBack/);
  82. void clear();
  83. QList<QAbstractButton *> buttons() const;
  84. QDialogButtonBox::ButtonRole buttonRole(QAbstractButton *button) const;
  85. void setStandardButtons(QDialogButtonBox::StandardButtons buttons);
  86. QDialogButtonBox::StandardButtons standardButtons() const;
  87. QDialogButtonBox::StandardButton standardButton(QAbstractButton *button) const;
  88. QPushButton *button(QDialogButtonBox::StandardButton which) const;
  89. void setCenterButtons(bool center);
  90. bool centerButtons() const;
  91. signals:
  92. void accepted();
  93. void clicked(QAbstractButton *button);
  94. void helpRequested();
  95. void rejected();
  96. protected:
  97. virtual void changeEvent(QEvent *event);
  98. virtual bool event(QEvent *event);
  99. };