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