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 ().