qstate.sip 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. // qstate.sip generated by MetaSIP
  2. //
  3. // This file is part of the QtStateMachine 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 QState : public QAbstractState
  22. {
  23. %TypeHeaderCode
  24. #include <qstate.h>
  25. %End
  26. public:
  27. enum ChildMode
  28. {
  29. ExclusiveStates,
  30. ParallelStates,
  31. };
  32. enum RestorePolicy
  33. {
  34. DontRestoreProperties,
  35. RestoreProperties,
  36. };
  37. QState(QState *parent /TransferThis/ = 0);
  38. QState(QState::ChildMode childMode, QState *parent /TransferThis/ = 0);
  39. virtual ~QState();
  40. QAbstractState *errorState() const;
  41. void setErrorState(QAbstractState *state /KeepReference/);
  42. void addTransition(QAbstractTransition *transition /Transfer/);
  43. QSignalTransition *addTransition(SIP_PYOBJECT signal /TypeHint="pyqtBoundSignal"/, QAbstractState *target);
  44. %MethodCode
  45. QObject *sender;
  46. QByteArray signal_signature;
  47. if ((sipError = pyqt6_qtstatemachine_get_pyqtsignal_parts(a0, &sender, signal_signature)) == sipErrorNone)
  48. {
  49. sipRes = sipCpp->addTransition(sender, signal_signature.constData(), a1);
  50. }
  51. else
  52. {
  53. sipError = sipBadCallableArg(0, a0);
  54. }
  55. %End
  56. QAbstractTransition *addTransition(QAbstractState *target /Transfer/);
  57. void removeTransition(QAbstractTransition *transition /TransferBack/);
  58. QList<QAbstractTransition *> transitions() const;
  59. QAbstractState *initialState() const;
  60. void setInitialState(QAbstractState *state /KeepReference/);
  61. QState::ChildMode childMode() const;
  62. void setChildMode(QState::ChildMode mode);
  63. void assignProperty(QObject *object, const char *name, const QVariant &value);
  64. signals:
  65. void finished();
  66. void propertiesAssigned();
  67. void childModeChanged();
  68. void initialStateChanged();
  69. void errorStateChanged();
  70. protected:
  71. virtual void onEntry(QEvent *event);
  72. virtual void onExit(QEvent *event);
  73. virtual bool event(QEvent *e);
  74. };
  75. %ModuleHeaderCode
  76. // Imports from QtCore.
  77. typedef sipErrorState (*pyqt6_qtstatemachine_get_pyqtsignal_parts_t)(PyObject *, QObject **, QByteArray &);
  78. extern pyqt6_qtstatemachine_get_pyqtsignal_parts_t pyqt6_qtstatemachine_get_pyqtsignal_parts;
  79. %End
  80. %ModuleCode
  81. // Imports from QtCore.
  82. pyqt6_qtstatemachine_get_pyqtsignal_parts_t pyqt6_qtstatemachine_get_pyqtsignal_parts;
  83. %End
  84. %PostInitialisationCode
  85. // Imports from QtCore.
  86. pyqt6_qtstatemachine_get_pyqtsignal_parts = (pyqt6_qtstatemachine_get_pyqtsignal_parts_t)sipImportSymbol("pyqt6_get_pyqtsignal_parts");
  87. Q_ASSERT(pyqt6_qtstatemachine_get_pyqtsignal_parts);
  88. %End