qtimer.sip 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. // qtimer.sip generated by MetaSIP
  2. //
  3. // This file is part of the QtCore 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 QTimer : public QObject
  22. {
  23. %TypeHeaderCode
  24. #include <qtimer.h>
  25. %End
  26. public:
  27. explicit QTimer(QObject *parent /TransferThis/ = 0);
  28. virtual ~QTimer();
  29. bool isActive() const;
  30. int timerId() const;
  31. void setInterval(int msec);
  32. int interval() const;
  33. bool isSingleShot() const;
  34. void setSingleShot(bool asingleShot);
  35. static void singleShot(int msec, SIP_PYOBJECT slot /TypeHint="PYQT_SLOT"/);
  36. %MethodCode
  37. QObject *receiver;
  38. QByteArray slot_signature;
  39. if ((sipError = pyqt6_get_connection_parts(a1, 0, "()", true, &receiver, slot_signature)) == sipErrorNone)
  40. {
  41. QTimer::singleShot(a0, receiver, slot_signature.constData());
  42. }
  43. else if (sipError == sipErrorContinue)
  44. {
  45. sipError = sipBadCallableArg(1, a1);
  46. }
  47. %End
  48. static void singleShot(int msec, Qt::TimerType timerType, SIP_PYOBJECT slot /TypeHint="PYQT_SLOT"/);
  49. %MethodCode
  50. QObject *receiver;
  51. QByteArray slot_signature;
  52. if ((sipError = pyqt6_get_connection_parts(a2, 0, "()", true, &receiver, slot_signature)) == sipErrorNone)
  53. {
  54. QTimer::singleShot(a0, a1, receiver, slot_signature.constData());
  55. }
  56. else if (sipError == sipErrorContinue)
  57. {
  58. sipError = sipBadCallableArg(2, a2);
  59. }
  60. %End
  61. public slots:
  62. void start(int msec);
  63. void start();
  64. void stop();
  65. signals:
  66. void timeout();
  67. protected:
  68. virtual void timerEvent(QTimerEvent *);
  69. public:
  70. void setTimerType(Qt::TimerType atype);
  71. Qt::TimerType timerType() const;
  72. int remainingTime() const;
  73. %If (Qt_6_8_0 -)
  74. int id() const;
  75. %MethodCode
  76. sipRes = qToUnderlying<Qt::TimerId>(sipCpp->id());
  77. %End
  78. %End
  79. };