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