qaction.sip 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. // qaction.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 QMenu /External/;
  22. class QAction : public QObject
  23. {
  24. %TypeHeaderCode
  25. #include <qaction.h>
  26. %End
  27. public:
  28. explicit QAction(QObject *parent /TransferThis/ = 0);
  29. QAction(const QString &text, QObject *parent /TransferThis/ = 0);
  30. QAction(const QIcon &icon, const QString &text, QObject *parent /TransferThis/ = 0);
  31. virtual ~QAction();
  32. void setActionGroup(QActionGroup *group /KeepReference/);
  33. QActionGroup *actionGroup() const;
  34. void setIcon(const QIcon &icon);
  35. QIcon icon() const;
  36. void setText(const QString &text);
  37. QString text() const;
  38. void setIconText(const QString &text);
  39. QString iconText() const;
  40. void setToolTip(const QString &tip);
  41. QString toolTip() const;
  42. void setStatusTip(const QString &statusTip);
  43. QString statusTip() const;
  44. void setWhatsThis(const QString &what);
  45. QString whatsThis() const;
  46. void setSeparator(bool b);
  47. bool isSeparator() const;
  48. void setShortcut(const QKeySequence &shortcut);
  49. QKeySequence shortcut() const;
  50. void setShortcutContext(Qt::ShortcutContext context);
  51. Qt::ShortcutContext shortcutContext() const;
  52. void setFont(const QFont &font);
  53. QFont font() const;
  54. void setCheckable(bool);
  55. bool isCheckable() const;
  56. QVariant data() const;
  57. void setData(const QVariant &var);
  58. bool isChecked() const;
  59. bool isEnabled() const;
  60. bool isVisible() const;
  61. enum ActionEvent
  62. {
  63. Trigger,
  64. Hover,
  65. };
  66. void activate(QAction::ActionEvent event);
  67. bool showStatusText(QObject *object = 0);
  68. protected:
  69. virtual bool event(QEvent *);
  70. public slots:
  71. void trigger();
  72. void hover();
  73. void setChecked(bool);
  74. void toggle();
  75. void setEnabled(bool);
  76. void setDisabled(bool b);
  77. void setVisible(bool);
  78. signals:
  79. void changed();
  80. void triggered(bool checked = false);
  81. void hovered();
  82. void toggled(bool);
  83. public:
  84. enum MenuRole
  85. {
  86. NoRole,
  87. TextHeuristicRole,
  88. ApplicationSpecificRole,
  89. AboutQtRole,
  90. AboutRole,
  91. PreferencesRole,
  92. QuitRole,
  93. };
  94. void setShortcuts(const QList<QKeySequence> &shortcuts);
  95. void setShortcuts(QKeySequence::StandardKey);
  96. QList<QKeySequence> shortcuts() const;
  97. void setAutoRepeat(bool);
  98. bool autoRepeat() const;
  99. void setMenuRole(QAction::MenuRole menuRole);
  100. QAction::MenuRole menuRole() const;
  101. QMenu *menu() const;
  102. %MethodCode
  103. typedef QMenu *(*pyqt6_qtgui_qaction_menu_t)(const QAction *);
  104. pyqt6_qtgui_qaction_menu_t pyqt6_qtgui_qaction_menu = (pyqt6_qtgui_qaction_menu_t)sipImportSymbol("pyqt6_qaction_menu");
  105. sipRes = (pyqt6_qtgui_qaction_menu ? pyqt6_qtgui_qaction_menu(sipCpp) : SIP_NULLPTR);
  106. %End
  107. void setMenu(QMenu *menu);
  108. %MethodCode
  109. typedef void *(*pyqt6_qtgui_qaction_set_menu_t)(QAction *, QMenu *);
  110. pyqt6_qtgui_qaction_set_menu_t pyqt6_qtgui_qaction_set_menu = (pyqt6_qtgui_qaction_set_menu_t)sipImportSymbol("pyqt6_qaction_set_menu");
  111. if (pyqt6_qtgui_qaction_set_menu)
  112. pyqt6_qtgui_qaction_set_menu(sipCpp, a0);
  113. %End
  114. void setIconVisibleInMenu(bool visible);
  115. bool isIconVisibleInMenu() const;
  116. enum Priority
  117. {
  118. LowPriority,
  119. NormalPriority,
  120. HighPriority,
  121. };
  122. void setPriority(QAction::Priority priority);
  123. QAction::Priority priority() const;
  124. void setShortcutVisibleInContextMenu(bool show);
  125. bool isShortcutVisibleInContextMenu() const;
  126. QList<QObject *> associatedObjects() const;
  127. public slots:
  128. void resetEnabled();
  129. signals:
  130. void enabledChanged(bool enabled);
  131. void checkableChanged(bool checkable);
  132. void visibleChanged();
  133. };