qshortcut.sip 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. // qshortcut.sip generated by MetaSIP
  2. //
  3. // This file is part of the QtGui 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 QShortcut : public QObject
  22. {
  23. %TypeHeaderCode
  24. #include <qshortcut.h>
  25. %End
  26. public:
  27. QShortcut(QKeySequence::StandardKey key, QObject *parent /TransferThis/, SIP_PYOBJECT member /TypeHint="PYQT_SLOT"/ = 0, SIP_PYOBJECT ambiguousMember /TypeHint="PYQT_SLOT"/ = 0, Qt::ShortcutContext context = Qt::WindowShortcut) [(QKeySequence::StandardKey key, QObject *parent, const char *member = 0, const char *ambiguousMember = 0, Qt::ShortcutContext context = Qt::WindowShortcut)];
  28. %MethodCode
  29. // Construct the shortcut without any connections.
  30. Py_BEGIN_ALLOW_THREADS
  31. sipCpp = new sipQShortcut(a0, a1, 0, 0, a4);
  32. Py_END_ALLOW_THREADS
  33. if (a2)
  34. {
  35. QObject *rx2;
  36. QByteArray member2;
  37. if ((sipError = pyqt6_qtgui_get_connection_parts(a2, sipCpp, "()", false, &rx2, member2)) == sipErrorNone)
  38. {
  39. Py_BEGIN_ALLOW_THREADS
  40. QObject::connect(sipCpp, SIGNAL(activated()), rx2,
  41. member2.constData());
  42. Py_END_ALLOW_THREADS
  43. }
  44. else
  45. {
  46. delete sipCpp;
  47. if (sipError == sipErrorContinue)
  48. sipError = sipBadCallableArg(2, a2);
  49. }
  50. }
  51. if (a3)
  52. {
  53. QObject *rx3;
  54. QByteArray member3;
  55. if ((sipError = pyqt6_qtgui_get_connection_parts(a3, sipCpp, "()", false, &rx3, member3)) == sipErrorNone)
  56. {
  57. Py_BEGIN_ALLOW_THREADS
  58. QObject::connect(sipCpp, SIGNAL(activatedAmbiguously()), rx3,
  59. member3.constData());
  60. Py_END_ALLOW_THREADS
  61. }
  62. else
  63. {
  64. delete sipCpp;
  65. if (sipError == sipErrorContinue)
  66. sipError = sipBadCallableArg(3, a3);
  67. }
  68. }
  69. %End
  70. QShortcut(const QKeySequence &key, QObject *parent /TransferThis/, SIP_PYOBJECT member /TypeHint="PYQT_SLOT"/ = 0, SIP_PYOBJECT ambiguousMember /TypeHint="PYQT_SLOT"/ = 0, Qt::ShortcutContext context = Qt::WindowShortcut) [(const QKeySequence &key, QObject *parent, const char *member = 0, const char *ambiguousMember = 0, Qt::ShortcutContext context = Qt::WindowShortcut)];
  71. %MethodCode
  72. // Construct the shortcut without any connections.
  73. Py_BEGIN_ALLOW_THREADS
  74. sipCpp = new sipQShortcut(*a0, a1, 0, 0, a4);
  75. Py_END_ALLOW_THREADS
  76. if (a2)
  77. {
  78. QObject *rx2;
  79. QByteArray member2;
  80. if ((sipError = pyqt6_qtgui_get_connection_parts(a2, sipCpp, "()", false, &rx2, member2)) == sipErrorNone)
  81. {
  82. Py_BEGIN_ALLOW_THREADS
  83. QObject::connect(sipCpp, SIGNAL(activated()), rx2,
  84. member2.constData());
  85. Py_END_ALLOW_THREADS
  86. }
  87. else
  88. {
  89. delete sipCpp;
  90. if (sipError == sipErrorContinue)
  91. sipError = sipBadCallableArg(2, a2);
  92. }
  93. }
  94. if (a3)
  95. {
  96. QObject *rx3;
  97. QByteArray member3;
  98. if ((sipError = pyqt6_qtgui_get_connection_parts(a3, sipCpp, "()", false, &rx3, member3)) == sipErrorNone)
  99. {
  100. Py_BEGIN_ALLOW_THREADS
  101. QObject::connect(sipCpp, SIGNAL(activatedAmbiguously()), rx3,
  102. member3.constData());
  103. Py_END_ALLOW_THREADS
  104. }
  105. else
  106. {
  107. delete sipCpp;
  108. if (sipError == sipErrorContinue)
  109. sipError = sipBadCallableArg(3, a3);
  110. }
  111. }
  112. %End
  113. explicit QShortcut(QObject *parent /TransferThis/);
  114. virtual ~QShortcut();
  115. void setKey(const QKeySequence &key);
  116. QKeySequence key() const;
  117. void setEnabled(bool enable);
  118. bool isEnabled() const;
  119. void setContext(Qt::ShortcutContext context);
  120. Qt::ShortcutContext context() const;
  121. void setWhatsThis(const QString &text);
  122. QString whatsThis() const;
  123. void setAutoRepeat(bool on);
  124. bool autoRepeat() const;
  125. signals:
  126. void activated();
  127. void activatedAmbiguously();
  128. public:
  129. void setKeys(const QList<QKeySequence> &keys);
  130. void setKeys(QKeySequence::StandardKey key);
  131. QList<QKeySequence> keys() const;
  132. protected:
  133. virtual bool event(QEvent *e);
  134. };
  135. %ModuleHeaderCode
  136. // Imports from QtCore.
  137. typedef sipErrorState (*pyqt6_qtgui_get_connection_parts_t)(PyObject *, QObject *, const char *, bool, QObject **, QByteArray &);
  138. extern pyqt6_qtgui_get_connection_parts_t pyqt6_qtgui_get_connection_parts;
  139. %End
  140. %ModuleCode
  141. // Imports from QtCore.
  142. pyqt6_qtgui_get_connection_parts_t pyqt6_qtgui_get_connection_parts;
  143. %End
  144. %PostInitialisationCode
  145. // Imports from QtCore.
  146. pyqt6_qtgui_get_connection_parts = (pyqt6_qtgui_get_connection_parts_t)sipImportSymbol("pyqt6_get_connection_parts");
  147. Q_ASSERT(pyqt6_qtgui_get_connection_parts);
  148. %End