Compatibility Members for QLineEdit

以下成员源于类 QLineEdit are part of the Qt compatibility layer. We advise against using them in new code.

公共函数

QLineEdit (QWidget * parent , const char * name )
QLineEdit (const QString & contents , QWidget * parent , const char * name )
QLineEdit (const QString & contents , const QString & inputMask , QWidget * parent = 0, const char * name = 0)
int characterAt (int xpos , QChar * chr ) const
void clearModified ()
void clearValidator ()
void cursorLeft (bool mark , int steps = 1)
void cursorRight (bool mark , int steps = 1)
bool edited () const
bool frame () const
bool getSelection (int * start , int * end )
bool hasMarkedText () const
int margin () const
QString markedText () const
void setEdited (bool on )
void setMargin (int margin )

信号

void lostFocus ()

保护函数

void repaintArea (int a , int b )

成员函数文档编制

QLineEdit:: QLineEdit ( QWidget * parent , const char * name )

构造行编辑不采用文本。

最大文本长度被设为 32767 个字符。

The parent and name arguments are sent to the QWidget 构造函数。

另请参阅 setText () 和 setMaxLength ().

QLineEdit:: QLineEdit (const QString & contents , QWidget * parent , const char * name )

构造行编辑包含文本 contents .

光标位置被设为行尾,且最大文本长度被设为 32767 个字符。

The parent and name arguments are sent to the QWidget 构造函数。

另请参阅 text () 和 setMaxLength ().

QLineEdit:: QLineEdit (const QString & contents , const QString & inputMask , QWidget * parent = 0, const char * name = 0)

Constructs a line edit with an input inputMask 和文本 contents .

The cursor position is set to the end of the line and the maximum text length is set to the length of the mask (the number of mask characters and separators).

The parent and name arguments are sent to the QWidget 构造函数。

另请参阅 setMask () 和 text ().

int QLineEdit:: characterAt ( int xpos , QChar * chr ) const

There exists no equivalent functionality in Qt 4.

void QLineEdit:: clearModified ()

使用 setModified (false) instead.

另请参阅 isModified ().

void QLineEdit:: clearValidator ()

使用 setValidator (0) instead.

void QLineEdit:: cursorLeft ( bool mark , int steps = 1)

使用 cursorForward () with a negative number of steps instead. For example, cursorForward (mark, -steps).

void QLineEdit:: cursorRight ( bool mark , int steps = 1)

使用 cursorForward () 代替。

bool QLineEdit:: edited () const

使用 isModified () 代替。

另请参阅 setEdited ().

bool QLineEdit:: frame () const

使用 hasFrame () 代替。

另请参阅 setFrame ().

bool QLineEdit:: getSelection ( int * start , int * end )

使用 selectedText () 和 selectionStart () 代替。

bool QLineEdit:: hasMarkedText () const

使用 hasSelectedText () 代替。

[signal] void QLineEdit:: lostFocus ()

This signal is emitted when the line edit has lost focus.

使用 editingFinished () 代替

另请参阅 editingFinished () 和 returnPressed ().

int QLineEdit:: margin () const

Returns the width of the margin around the contents of the widget.

使用 QWidget::getContentsMargins () 代替。

另请参阅 setMargin () 和 QWidget::getContentsMargins ().

QString QLineEdit:: markedText () const

使用 selectedText () 代替。

[protected] void QLineEdit:: repaintArea ( int a , int b )

使用 update () 代替。

void QLineEdit:: setEdited ( bool on )

使用 setModified () 或 setText ().

另请参阅 edited ().

void QLineEdit:: setMargin ( int margin )

Sets the width of the margin around the contents of the widget to margin .

使用 QWidget::setContentsMargins () 代替。

另请参阅 margin () 和 QWidget::setContentsMargins ().