qlineedit.sip 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. // qlineedit.sip generated by MetaSIP
  2. //
  3. // This file is part of the QtWidgets 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 QLineEdit : public QWidget
  22. {
  23. %TypeHeaderCode
  24. #include <qlineedit.h>
  25. %End
  26. public:
  27. explicit QLineEdit(QWidget *parent /TransferThis/ = 0);
  28. QLineEdit(const QString &contents, QWidget *parent /TransferThis/ = 0);
  29. virtual ~QLineEdit();
  30. QString text() const;
  31. QString displayText() const;
  32. int maxLength() const;
  33. void setMaxLength(int);
  34. void setFrame(bool);
  35. bool hasFrame() const;
  36. enum EchoMode
  37. {
  38. Normal,
  39. NoEcho,
  40. Password,
  41. PasswordEchoOnEdit,
  42. };
  43. QLineEdit::EchoMode echoMode() const;
  44. void setEchoMode(QLineEdit::EchoMode);
  45. bool isReadOnly() const;
  46. void setReadOnly(bool);
  47. void setValidator(const QValidator * /KeepReference/);
  48. const QValidator *validator() const;
  49. virtual QSize sizeHint() const;
  50. virtual QSize minimumSizeHint() const;
  51. int cursorPosition() const;
  52. void setCursorPosition(int);
  53. int cursorPositionAt(const QPoint &pos);
  54. void setAlignment(Qt::Alignment flag);
  55. Qt::Alignment alignment() const;
  56. void cursorForward(bool mark, int steps = 1);
  57. void cursorBackward(bool mark, int steps = 1);
  58. void cursorWordForward(bool mark);
  59. void cursorWordBackward(bool mark);
  60. void backspace();
  61. void del();
  62. void home(bool mark);
  63. void end(bool mark);
  64. bool isModified() const;
  65. void setModified(bool);
  66. void setSelection(int, int);
  67. bool hasSelectedText() const;
  68. QString selectedText() const;
  69. int selectionStart() const;
  70. bool isUndoAvailable() const;
  71. bool isRedoAvailable() const;
  72. void setDragEnabled(bool b);
  73. bool dragEnabled() const;
  74. QString inputMask() const;
  75. void setInputMask(const QString &inputMask);
  76. bool hasAcceptableInput() const;
  77. void setText(const QString &);
  78. void clear();
  79. void selectAll();
  80. void undo();
  81. void redo();
  82. void cut();
  83. void copy() const;
  84. void paste();
  85. void deselect();
  86. void insert(const QString &);
  87. QMenu *createStandardContextMenu() /Transfer/;
  88. signals:
  89. void textChanged(const QString &);
  90. void textEdited(const QString &);
  91. void cursorPositionChanged(int, int);
  92. void returnPressed();
  93. void editingFinished();
  94. void selectionChanged();
  95. protected:
  96. virtual void initStyleOption(QStyleOptionFrame *option) const;
  97. virtual void mousePressEvent(QMouseEvent *);
  98. virtual void mouseMoveEvent(QMouseEvent *);
  99. virtual void mouseReleaseEvent(QMouseEvent *);
  100. virtual void mouseDoubleClickEvent(QMouseEvent *);
  101. virtual void keyPressEvent(QKeyEvent *);
  102. virtual void focusInEvent(QFocusEvent *);
  103. virtual void focusOutEvent(QFocusEvent *);
  104. virtual void paintEvent(QPaintEvent *);
  105. virtual void dragEnterEvent(QDragEnterEvent *);
  106. virtual void dragMoveEvent(QDragMoveEvent *e);
  107. virtual void dragLeaveEvent(QDragLeaveEvent *e);
  108. virtual void dropEvent(QDropEvent *);
  109. virtual void changeEvent(QEvent *);
  110. virtual void contextMenuEvent(QContextMenuEvent *);
  111. virtual void inputMethodEvent(QInputMethodEvent *);
  112. virtual void keyReleaseEvent(QKeyEvent *);
  113. QRect cursorRect() const;
  114. public:
  115. virtual QVariant inputMethodQuery(Qt::InputMethodQuery) const;
  116. virtual bool event(QEvent *);
  117. virtual void timerEvent(QTimerEvent *);
  118. void setCompleter(QCompleter *completer /KeepReference/);
  119. QCompleter *completer() const;
  120. void setTextMargins(int left, int top, int right, int bottom);
  121. void setTextMargins(const QMargins &margins);
  122. QMargins textMargins() const;
  123. QString placeholderText() const;
  124. void setPlaceholderText(const QString &);
  125. void setCursorMoveStyle(Qt::CursorMoveStyle style);
  126. Qt::CursorMoveStyle cursorMoveStyle() const;
  127. enum ActionPosition
  128. {
  129. LeadingPosition,
  130. TrailingPosition,
  131. };
  132. void setClearButtonEnabled(bool enable);
  133. bool isClearButtonEnabled() const;
  134. void addAction(QAction *);
  135. void addAction(QAction *action, QLineEdit::ActionPosition position);
  136. QAction *addAction(const QIcon &icon, QLineEdit::ActionPosition position) /Transfer/;
  137. QVariant inputMethodQuery(Qt::InputMethodQuery property, QVariant argument) const;
  138. int selectionEnd() const;
  139. int selectionLength() const;
  140. signals:
  141. void inputRejected();
  142. };