1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
|
// This is the SIP interface definition for QLineEdit.
//
// Copyright (c) 2007
// Riverbank Computing Limited <info@riverbankcomputing.co.uk>
//
// This file is part of PyQt.
//
// This copy of PyQt is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by the Free
// Software Foundation; either version 2, or (at your option) any later
// version.
//
// PyQt is supplied in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// details.
//
// You should have received a copy of the GNU General Public License along with
// PyQt; see the file LICENSE. If not, write to the Free Software Foundation,
// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
%ExportedDoc
<Sect2><Title>QLineEdit</Title>
<FuncSynopsis>
<FuncDef>int <Function>characterAt</Function></FuncDef>
<ParamDef>int <Parameter>xpos</Parameter></ParamDef>
<ParamDef>QChar *<Parameter>chr</Parameter></ParamDef>
</FuncSynopsis>
<Para>
This takes only the <Literal>xpos</Literal> parameter and returns the int
result and the <Literal>chr</Literal> value as a tuple. (Qt v3+)
</Para>
<FuncSynopsis>
<FuncDef>void <Function>del</Function></FuncDef>
<ParamDef></ParamDef>
</FuncSynopsis>
<Para>
This has been renamed <Literal>delChar</Literal> in Python. (Qt v2+)
</Para>
<FuncSynopsis>
<FuncDef>bool <Function>getSelection</Function></FuncDef>
<ParamDef>int *<Parameter>start</Parameter></ParamDef>
<ParamDef>int *<Parameter>end</Parameter></ParamDef>
</FuncSynopsis>
<Para>
This takes no parameters and returns the bool result and the
<Literal>start</Literal> and <Literal>end</Literal> values as a tuple.
(Qt v3+)
</Para>
</Sect2>
%End
%If (Qt_3_0_0 -)
class QLineEdit : QFrame
{
%TypeHeaderCode
#include <qlineedit.h>
%End
public:
QLineEdit(QWidget * /TransferThis/,const char * = 0);
QLineEdit(const QString &,QWidget * /TransferThis/,const char * = 0);
%If (Qt_3_2_0 -)
QLineEdit(const QString &,const QString &,QWidget * /TransferThis/,
const char * = 0);
%End
QString text() const;
QString displayText() const;
int maxLength() const;
bool frame() const;
enum EchoMode {
Normal,
NoEcho,
Password
};
EchoMode echoMode() const;
bool isReadOnly() const;
const QValidator *validator() const;
QSize sizeHint() const;
QSize minimumSizeHint() const;
int cursorPosition() const;
// Obsolete.
bool validateAndSet(const QString &,int,int,int);
int alignment() const;
void cursorForward(bool,int = 1);
void cursorBackward(bool,int = 1);
void cursorWordForward(bool);
void cursorWordBackward(bool);
void backspace();
void del() /PyName=delChar/;
void home(bool);
void end(bool);
%If (Qt_3_2_0 -)
bool isModified() const;
void clearModified();
%End
// Obsolete.
bool edited() const;
// Obsolete.
void setEdited(bool);
bool hasSelectedText() const;
QString selectedText() const;
%If (Qt_3_2_0 -)
int selectionStart() const;
%End
bool isUndoAvailable() const;
bool isRedoAvailable() const;
bool dragEnabled() const;
%If (Qt_3_2_0 -)
QString inputMask() const;
void setInputMask(const QString &);
bool hasAcceptableInput() const;
%End
public slots:
virtual void setText(const QString &);
virtual void selectAll();
virtual void deselect();
virtual void clearValidator();
virtual void insert(const QString &);
virtual void clear();
virtual void undo();
virtual void redo();
virtual void setMaxLength(int);
virtual void setFrame(bool);
virtual void setEchoMode(EchoMode);
virtual void setReadOnly(bool);
virtual void setValidator(const QValidator *);
virtual void setFont(const QFont &);
virtual void setPalette(const QPalette &);
virtual void setSelection(int,int);
virtual void setCursorPosition(int);
virtual void setAlignment(int);
%If (Qt_CLIPBOARD)
virtual void cut();
virtual void copy() const;
virtual void paste();
%End
virtual void setDragEnabled(bool);
signals:
void textChanged(const QString &);
void returnPressed();
%If (Qt_3_1_0 -)
void lostFocus();
%End
void selectionChanged();
protected:
bool event(QEvent *);
void mousePressEvent(QMouseEvent *);
void mouseMoveEvent(QMouseEvent *);
void mouseReleaseEvent(QMouseEvent *);
void mouseDoubleClickEvent(QMouseEvent *);
void keyPressEvent(QKeyEvent *);
void imStartEvent(QIMEvent *);
void imComposeEvent(QIMEvent *);
void imEndEvent(QIMEvent *);
void focusInEvent(QFocusEvent *);
void focusOutEvent(QFocusEvent *);
void resizeEvent(QResizeEvent *);
void drawContents(QPainter *);
%If (Qt_DRAGANDDROP)
void dragEnterEvent(QDragEnterEvent *);
void dragMoveEvent(QDragMoveEvent *);
void dragLeaveEvent(QDragLeaveEvent *);
void dropEvent(QDropEvent *);
%End
void contextMenuEvent(QContextMenuEvent *);
virtual QPopupMenu *createPopupMenu() /Factory/;
void windowActivationChange(bool);
public:
// These appeared in v3.0.2 but defined as incompatible 3.0 addons,
// until v3.1.0. v3.2.0 then defined them as internal and obsolete.
%If (Qt_3_1_0 -)
void setPasswordChar(QChar);
QChar passwordChar() const;
%End
// Obsolete.
SIP_PYTUPLE characterAt(int) const;
%MethodCode
int res;
QChar *chr;
Py_BEGIN_ALLOW_THREADS
chr = new QChar();
res = sipCpp -> characterAt(a0,chr);
Py_END_ALLOW_THREADS
sipRes = sipBuildResult(&sipIsErr,"(iB)",res,chr,sipClass_QChar,NULL);
%End
// Obsolete.
bool getSelection(int *,int *);
private:
QLineEdit(const QLineEdit &);
};
%End
%If (- Qt_3_0_0)
class QLineEdit : QWidget
{
%TypeHeaderCode
#include <qlineedit.h>
%End
public:
%If (- Qt_2_00)
QLineEdit(QWidget * /TransferThis/ = 0,const char * = 0);
%End
%If (Qt_2_00 -)
QLineEdit(QWidget * /TransferThis/,const char * = 0);
QLineEdit(const QString &,QWidget * /TransferThis/,const char * = 0);
%End
%If (- Qt_2_00)
const char *text() const;
%End
%If (Qt_2_00 -)
QString text() const;
QString displayText() const;
%End
%If (- Qt_2_00)
void setMaxLength(int);
%End
%If (Qt_2_00 -)
virtual void setMaxLength(int);
%End
int maxLength() const;
%If (- Qt_2_00)
void setFrame(bool);
%End
%If (Qt_2_00 -)
virtual void setFrame(bool);
%End
bool frame() const;
enum EchoMode {
Normal,
NoEcho,
Password
};
%If (- Qt_2_00)
void setEchoMode(EchoMode);
%End
%If (Qt_2_00 -)
virtual void setEchoMode(EchoMode);
%End
EchoMode echoMode() const;
%If (Qt_2_1_0 -)
void setReadOnly(bool);
%End
%If (Qt_2_1_0 -)
bool isReadOnly() const;
%End
%If (- Qt_2_00)
void setValidator(QValidator *);
QValidator *validator() const;
%End
%If (Qt_2_00 -)
virtual void setValidator(QValidator *);
%End
%If (Qt_2_00 -)
const QValidator *validator() const;
%End
QSize sizeHint() const;
%If (Qt_2_00 -)
QSize minimumSizeHint() const;
%End
%If (Qt_2_00 -)
QSizePolicy sizePolicy() const;
%End
%If (- Qt_2_00)
void setCursorPosition(int);
%End
%If (Qt_2_00 -)
virtual void setCursorPosition(int);
%End
int cursorPosition() const;
%If (- Qt_2_00)
bool validateAndSet(const char *,int,int,int);
%End
%If (Qt_2_00 -)
bool validateAndSet(const QString &,int,int,int);
%End
%If (Qt_2_00 -)
int alignment() const;
%End
%If (Qt_2_00 -)
void cursorLeft(bool,int = 1);
void cursorRight(bool,int = 1);
void cursorWordForward(bool);
void cursorWordBackward(bool);
void backspace();
void del() /PyName=delChar/;
void home(bool);
void end(bool);
void setEdited(bool);
bool edited() const;
%End
%If (Qt_2_00 -)
bool hasMarkedText() const;
QString markedText() const;
%End
%If (Qt_CLIPBOARD)
void cut();
void copy() const;
void paste();
%End
%If (- Qt_2_00)
void setEnabled(bool);
void setFont(const QFont &);
void setPalette(const QPalette &);
void setSelection(int,int);
%End
%If (Qt_2_00 -)
virtual void setEnabled(bool);
virtual void setFont(const QFont &);
virtual void setPalette(const QPalette &);
virtual void setSelection(int,int);
void setAlignment(int);
%End
public slots:
%If (- Qt_2_00)
void setText(const char *);
%End
%If (Qt_2_00 -)
virtual void setText(const QString &);
%End
void selectAll();
void deselect();
void clearValidator();
%If (- Qt_2_00)
void insert(const char *);
%End
%If (Qt_2_00 -)
void insert(const QString &);
%End
void clear();
signals:
%If (- Qt_2_00)
void textChanged(const char *);
%End
%If (Qt_2_00 -)
void textChanged(const QString &);
%End
void returnPressed();
protected:
%If (Qt_2_2_0 -)
bool event(QEvent *);
%End
void mousePressEvent(QMouseEvent *);
void mouseMoveEvent(QMouseEvent *);
void mouseReleaseEvent(QMouseEvent *);
void mouseDoubleClickEvent(QMouseEvent *);
void keyPressEvent(QKeyEvent *);
void focusInEvent(QFocusEvent *);
void focusOutEvent(QFocusEvent *);
void paintEvent(QPaintEvent *);
void resizeEvent(QResizeEvent *);
void leaveEvent(QEvent *);
void repaintArea(int,int);
%If (- Qt_2_00)
void timerEvent(QTimerEvent *);
bool event(QEvent *);
bool hasMarkedText() const;
QString markedText() const;
%End
%If (Qt_2_00 -)
%If (Qt_DRAGANDDROP)
void dragEnterEvent(QDragEnterEvent *);
void dropEvent(QDropEvent *);
%End
%End
private:
QLineEdit(const QLineEdit &);
};
%End
|