qwizard.sip 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. // qwizard.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 QWizard : public QDialog
  22. {
  23. %TypeHeaderCode
  24. #include <qwizard.h>
  25. %End
  26. public:
  27. enum WizardButton
  28. {
  29. BackButton,
  30. NextButton,
  31. CommitButton,
  32. FinishButton,
  33. CancelButton,
  34. HelpButton,
  35. CustomButton1,
  36. CustomButton2,
  37. CustomButton3,
  38. Stretch,
  39. };
  40. enum WizardPixmap
  41. {
  42. WatermarkPixmap,
  43. LogoPixmap,
  44. BannerPixmap,
  45. BackgroundPixmap,
  46. };
  47. enum WizardStyle
  48. {
  49. ClassicStyle,
  50. ModernStyle,
  51. MacStyle,
  52. AeroStyle,
  53. };
  54. enum WizardOption /BaseType=Flag/
  55. {
  56. IndependentPages,
  57. IgnoreSubTitles,
  58. ExtendedWatermarkPixmap,
  59. NoDefaultButton,
  60. NoBackButtonOnStartPage,
  61. NoBackButtonOnLastPage,
  62. DisabledBackButtonOnLastPage,
  63. HaveNextButtonOnLastPage,
  64. HaveFinishButtonOnEarlyPages,
  65. NoCancelButton,
  66. CancelButtonOnLeft,
  67. HaveHelpButton,
  68. HelpButtonOnRight,
  69. HaveCustomButton1,
  70. HaveCustomButton2,
  71. HaveCustomButton3,
  72. NoCancelButtonOnLastPage,
  73. %If (Qt_6_11_0 -)
  74. StretchBanner,
  75. %End
  76. };
  77. typedef QFlags<QWizard::WizardOption> WizardOptions;
  78. QWizard(QWidget *parent /TransferThis/ = 0, Qt::WindowFlags flags = Qt::WindowFlags());
  79. virtual ~QWizard();
  80. int addPage(QWizardPage *page /Transfer/);
  81. void setPage(int id, QWizardPage *page /Transfer/);
  82. QWizardPage *page(int id) const;
  83. bool hasVisitedPage(int id) const;
  84. QList<int> visitedIds() const;
  85. void setStartId(int id);
  86. int startId() const;
  87. QWizardPage *currentPage() const;
  88. int currentId() const;
  89. virtual bool validateCurrentPage();
  90. virtual int nextId() const;
  91. void setField(const QString &name, const QVariant &value);
  92. QVariant field(const QString &name) const;
  93. void setWizardStyle(QWizard::WizardStyle style);
  94. QWizard::WizardStyle wizardStyle() const;
  95. void setOption(QWizard::WizardOption option, bool on = true);
  96. bool testOption(QWizard::WizardOption option) const;
  97. void setOptions(QWizard::WizardOptions options);
  98. QWizard::WizardOptions options() const;
  99. void setButtonText(QWizard::WizardButton which, const QString &text);
  100. QString buttonText(QWizard::WizardButton which) const;
  101. void setButtonLayout(const QList<QWizard::WizardButton> &layout);
  102. void setButton(QWizard::WizardButton which, QAbstractButton *button /Transfer/);
  103. QAbstractButton *button(QWizard::WizardButton which) const /Transfer/;
  104. void setTitleFormat(Qt::TextFormat format);
  105. Qt::TextFormat titleFormat() const;
  106. void setSubTitleFormat(Qt::TextFormat format);
  107. Qt::TextFormat subTitleFormat() const;
  108. void setPixmap(QWizard::WizardPixmap which, const QPixmap &pixmap);
  109. QPixmap pixmap(QWizard::WizardPixmap which) const;
  110. void setDefaultProperty(const char *className, const char *property, SIP_PYOBJECT changedSignal /TypeHint="PYQT_SIGNAL"/);
  111. %MethodCode
  112. QByteArray signal_signature;
  113. if ((sipError = pyqt6_qtwidgets_get_signal_signature(a2, 0, signal_signature)) == sipErrorNone)
  114. {
  115. sipCpp->setDefaultProperty(a0, a1, signal_signature.constData());
  116. }
  117. else if (sipError == sipErrorContinue)
  118. {
  119. sipError = sipBadCallableArg(2, a2);
  120. }
  121. %End
  122. virtual void setVisible(bool visible);
  123. virtual QSize sizeHint() const;
  124. signals:
  125. void currentIdChanged(int id);
  126. void helpRequested();
  127. void customButtonClicked(int which);
  128. public slots:
  129. void back();
  130. void next();
  131. void restart();
  132. protected:
  133. virtual bool event(QEvent *event);
  134. virtual void resizeEvent(QResizeEvent *event);
  135. virtual void paintEvent(QPaintEvent *event);
  136. virtual void done(int result);
  137. virtual void initializePage(int id);
  138. virtual void cleanupPage(int id);
  139. public:
  140. void removePage(int id);
  141. QList<int> pageIds() const;
  142. void setSideWidget(QWidget *widget /Transfer/);
  143. QWidget *sideWidget() const;
  144. signals:
  145. void pageAdded(int id);
  146. void pageRemoved(int id);
  147. public slots:
  148. %If (Qt_6_4_0 -)
  149. void setCurrentId(int id);
  150. %End
  151. };
  152. class QWizardPage : public QWidget
  153. {
  154. %TypeHeaderCode
  155. #include <qwizard.h>
  156. %End
  157. public:
  158. explicit QWizardPage(QWidget *parent /TransferThis/ = 0);
  159. virtual ~QWizardPage();
  160. void setTitle(const QString &title);
  161. QString title() const;
  162. void setSubTitle(const QString &subTitle);
  163. QString subTitle() const;
  164. void setPixmap(QWizard::WizardPixmap which, const QPixmap &pixmap);
  165. QPixmap pixmap(QWizard::WizardPixmap which) const;
  166. void setFinalPage(bool finalPage);
  167. bool isFinalPage() const;
  168. void setCommitPage(bool commitPage);
  169. bool isCommitPage() const;
  170. void setButtonText(QWizard::WizardButton which, const QString &text);
  171. QString buttonText(QWizard::WizardButton which) const;
  172. virtual void initializePage();
  173. virtual void cleanupPage();
  174. virtual bool validatePage();
  175. virtual bool isComplete() const;
  176. virtual int nextId() const;
  177. signals:
  178. void completeChanged();
  179. protected:
  180. void setField(const QString &name, const QVariant &value);
  181. QVariant field(const QString &name) const;
  182. void registerField(const QString &name, QWidget *widget, const char *property = 0, SIP_PYOBJECT changedSignal /TypeHint="PYQT_SIGNAL"/ = 0) [void (const QString &name, QWidget *widget, const char *property = 0, const char *changedSignal = 0)];
  183. %MethodCode
  184. typedef sipErrorState (*pyqt6_get_signal_signature_t)(PyObject *, QObject *, QByteArray &);
  185. static pyqt6_get_signal_signature_t pyqt6_get_signal_signature = 0;
  186. if (!pyqt6_get_signal_signature)
  187. {
  188. pyqt6_get_signal_signature = (pyqt6_get_signal_signature_t)sipImportSymbol("pyqt6_get_signal_signature");
  189. Q_ASSERT(pyqt6_get_signal_signature);
  190. }
  191. QByteArray signal_signature;
  192. const char *signal = 0;
  193. if (a3 && a3 != Py_None)
  194. {
  195. if ((sipError = pyqt6_get_signal_signature(a3, a1, signal_signature)) == sipErrorNone)
  196. {
  197. signal = signal_signature.constData();
  198. }
  199. else if (sipError == sipErrorContinue)
  200. {
  201. sipError = sipBadCallableArg(3, a3);
  202. }
  203. }
  204. if (sipError == sipErrorNone)
  205. {
  206. Py_BEGIN_ALLOW_THREADS
  207. #if defined(SIP_PROTECTED_IS_PUBLIC)
  208. sipCpp->registerField(*a0, a1, a2, signal);
  209. #else
  210. sipCpp->sipProtect_registerField(*a0, a1, a2, signal);
  211. #endif
  212. Py_END_ALLOW_THREADS
  213. }
  214. %End
  215. QWizard *wizard() const;
  216. };