qsignalspy.sip 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. // qsignalspy.sip generated by MetaSIP
  2. //
  3. // This file is part of the QtTest 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. %If (Qt_6_8_0 -)
  22. class QSignalSpy
  23. {
  24. %TypeHeaderCode
  25. #include <qsignalspy.h>
  26. %End
  27. public:
  28. QSignalSpy(SIP_PYOBJECT signal /TypeHint="QtCore.pyqtBoundSignal"/) [(const QObject *obj, const char *aSignal)];
  29. %MethodCode
  30. QObject *sender;
  31. QByteArray signal_signature;
  32. if ((sipError = pyqt6_qttest_get_pyqtsignal_parts(a0, &sender, signal_signature)) == sipErrorNone)
  33. sipCpp = new QSignalSpy(sender, signal_signature.constData());
  34. else if (sipError == sipErrorContinue)
  35. sipError = sipBadCallableArg(0, a0);
  36. %End
  37. QSignalSpy(const QObject *obj, QMetaMethod signal);
  38. ~QSignalSpy();
  39. bool isValid() const;
  40. QByteArray signal() const;
  41. bool wait(int timeout = 5000) /ReleaseGIL/;
  42. Py_ssize_t __len__() const;
  43. %MethodCode
  44. sipRes = sipCpp->count();
  45. %End
  46. QList<QVariant> __getitem__(int i) const;
  47. %MethodCode
  48. Py_ssize_t idx = sipConvertFromSequenceIndex(a0, sipCpp->count());
  49. if (idx < 0)
  50. sipIsErr = 1;
  51. else
  52. sipRes = new QList<QVariant>(sipCpp->at((int)idx));
  53. %End
  54. void __setitem__(int i, const QList<QVariant> &value);
  55. %MethodCode
  56. int len = sipCpp->count();
  57. if ((a0 = (int)sipConvertFromSequenceIndex(a0, len)) < 0)
  58. sipIsErr = 1;
  59. else
  60. (*sipCpp)[a0] = *a1;
  61. %End
  62. void __delitem__(int i);
  63. %MethodCode
  64. if ((a0 = (int)sipConvertFromSequenceIndex(a0, sipCpp->count())) < 0)
  65. sipIsErr = 1;
  66. else
  67. sipCpp->removeAt(a0);
  68. %End
  69. private:
  70. QSignalSpy(const QSignalSpy &);
  71. };
  72. %End
  73. %If (- Qt_6_8_0)
  74. class QSignalSpy : QObject
  75. {
  76. %TypeHeaderCode
  77. #include <qsignalspy.h>
  78. %End
  79. public:
  80. QSignalSpy(SIP_PYOBJECT signal /TypeHint="QtCore.pyqtBoundSignal"/) [(const QObject *obj, const char *aSignal)];
  81. %MethodCode
  82. QObject *sender;
  83. QByteArray signal_signature;
  84. if ((sipError = pyqt6_qttest_get_pyqtsignal_parts(a0, &sender, signal_signature)) == sipErrorNone)
  85. sipCpp = new sipQSignalSpy(sender, signal_signature.constData());
  86. else if (sipError == sipErrorContinue)
  87. sipError = sipBadCallableArg(0, a0);
  88. %End
  89. QSignalSpy(const QObject *obj, const QMetaMethod &signal);
  90. bool isValid() const;
  91. QByteArray signal() const;
  92. bool wait(int timeout = 5000) /ReleaseGIL/;
  93. Py_ssize_t __len__() const;
  94. %MethodCode
  95. sipRes = sipCpp->count();
  96. %End
  97. QList<QVariant> __getitem__(int i) const;
  98. %MethodCode
  99. Py_ssize_t idx = sipConvertFromSequenceIndex(a0, sipCpp->count());
  100. if (idx < 0)
  101. sipIsErr = 1;
  102. else
  103. sipRes = new QList<QVariant>(sipCpp->at((int)idx));
  104. %End
  105. void __setitem__(int i, const QList<QVariant> &value);
  106. %MethodCode
  107. int len = sipCpp->count();
  108. if ((a0 = (int)sipConvertFromSequenceIndex(a0, len)) < 0)
  109. sipIsErr = 1;
  110. else
  111. (*sipCpp)[a0] = *a1;
  112. %End
  113. void __delitem__(int i);
  114. %MethodCode
  115. if ((a0 = (int)sipConvertFromSequenceIndex(a0, sipCpp->count())) < 0)
  116. sipIsErr = 1;
  117. else
  118. sipCpp->removeAt(a0);
  119. %End
  120. };
  121. %End
  122. %ModuleHeaderCode
  123. // Imports from QtCore.
  124. typedef sipErrorState (*pyqt6_qttest_get_pyqtsignal_parts_t)(PyObject *, QObject **, QByteArray &);
  125. extern pyqt6_qttest_get_pyqtsignal_parts_t pyqt6_qttest_get_pyqtsignal_parts;
  126. %End
  127. %ModuleCode
  128. // Imports from QtCore.
  129. pyqt6_qttest_get_pyqtsignal_parts_t pyqt6_qttest_get_pyqtsignal_parts;
  130. %End
  131. %PostInitialisationCode
  132. // Imports from QtCore.
  133. pyqt6_qttest_get_pyqtsignal_parts = (pyqt6_qttest_get_pyqtsignal_parts_t)sipImportSymbol("pyqt6_get_pyqtsignal_parts");
  134. Q_ASSERT(pyqt6_qttest_get_pyqtsignal_parts);
  135. %End