Qt:Документация 4.3.2/q3multilineedit

Материал из Wiki.crossplatform.ru

Перейти к: навигация, поиск
40px Внимание: Актуальная версия перевода документации находится здесь

__NOTOC__

Image:qt-logo.png

Главная · Все классы · Основные классы · Классы по группам · Модули · Функции

Image:trolltech-logo.png

Содержание

[править] Q3MultiLineEdit Class Reference
[ Qt3Support module]

The Q3MultiLineEdit widget is a simple editor for inputting text. Далее...

 #include <Q3MultiLineEdit>

This class is part of the Qt 3 support library. It is provided to keep old source code working. Мы настоятельно не рекомендуем использовать этот класс в новом коде. See Porting to Qt 4 for more information.

Inherits Q3TextEdit.

[править] Свойства

  • 19 properties inherited from Q3TextEdit
  • 10 properties inherited from Q3ScrollView
  • 2 properties inherited from Q3Frame
  • 6 свойств, унаследованных от QFrame
  • 56 свойств, унаследованных от QWidget
  • 1 свойство, унаследованное от QObject

[править] Открытые функции

  • 51 public functions inherited from Q3TextEdit
  • 46 public functions inherited from Q3ScrollView
  • 4 public functions inherited from Q3Frame
  • 13 открытых функций, унаследованных от QFrame
  • 201 свойство, унаследованное от QWidget
  • 29 открытых функций, унаследованных от QObject
  • 12 открытых функций, унаследованных от QPaintDevice

[править] Открытые слоты

  • 60 public slots inherited from Q3TextEdit
  • 8 public slots inherited from Q3ScrollView
  • 19 открытых слотов, унаследованных от QWidget
  • 1 открытый слот, унаследованный от QObject

[править] Защищенные функции

  • 6 protected functions inherited from Q3TextEdit
  • 17 protected functions inherited from Q3ScrollView
  • 5 protected functions inherited from Q3Frame
  • 38 защищенных функций, унаследованных от QWidget
  • 7 защищенных функций, унаследованных от QObject
  • 1 защищенная функция, унаследованных от QPaintDevice

[править] Дополнительные унаследованные члены

  • 14 signals inherited from Q3TextEdit
  • 5 signals inherited from Q3ScrollView
  • 1 сигнал, унаследованный от QWidget
  • 1 сигнал, унаследованный от QObject
  • 4 статических открытых члена, унаследованных от QWidget
  • 5 статических открытых членов, унаследованных от QObject
  • 1 защищенный слот, унаследованый от QWidget

[править] Подробное описание

The Q3MultiLineEdit widget is a simple editor for inputting text.

The Q3MultiLineEdit was a simple editor widget in former Qt versions. Qt 3.0 includes a new richtext engine which obsoletes Q3MultiLineEdit. It is still included for compatibility reasons. It is now a subclass of Q3TextEdit, and provides enough of the old Q3MultiLineEdit API to keep old applications working.

If you implement something new with Q3MultiLineEdit, we suggest using Q3TextEdit instead and call Q3TextEdit::setTextFormat( Qt::PlainText).

Although most of the old Q3MultiLineEdit API is still available, there is a few difference. The old Q3MultiLineEdit operated on lines, not on paragraphs. As lines change all the time during wordwrap, the new richtext engine uses paragraphs as basic elements in the data structure. All functions ( numLines(), textLine(), etc.) that operated on lines, now operate on paragraphs. Further, getString() has been removed completely. It revealed too much of the internal data structure.

Applications which made normal and reasonable use of Q3MultiLineEdit should still work without problems. Some odd usage will require some porting. In these cases, it may be better to use Q3TextEdit now.

See also Q3TextEdit.


[править] Описание cвойств

[править]
alignment : Qt::Alignment

This property holds the editor's paragraph alignment.

Sets the alignment to flag, which must be Qt::AlignLeft, Qt::AlignHCenter, or Qt::AlignRight.

If flag is an illegal flag, nothing happens.

Функции доступа:

  • Qt::Alignment alignment () const
  • void setAlignment ( Qt::Alignment flags )

[править]
atBeginning : const bool

This property holds whether the cursor is placed at the beginning of the text.

Функции доступа:

  • bool atBeginning () const

See also atEnd.

[править]
atEnd : const bool

This property holds whether the cursor is placed at the end of the text.

Функции доступа:

  • bool atEnd () const

See also atBeginning.

[править]
edited : bool

This property holds whether the document has been edited by the user.

This is the same as Q3TextEdit's "modifed" property.

Функции доступа:

  • bool edited () const
  • void setEdited ( bool )

[править]
numLines : const int

This property holds the number of paragraphs in the editor.

The count includes any empty paragraph at top and bottom, so for an empty editor this method returns 1.

Функции доступа:

  • int numLines () const

[править] Описание функций-членов

[править]
Q3MultiLineEdit::Q3MultiLineEdit ( QWidget * parent = 0, const char * name = 0 )

Constructs a new, empty, Q3MultiLineEdit with parent parent called name.

[править]
Q3MultiLineEdit::~Q3MultiLineEdit ()

Деструктор.

[править]
bool Q3MultiLineEdit::autoUpdate () const

This function is a noop that always returns true.

[править]
void Q3MultiLineEdit::backspace () [virtual protected]

Deletes the character on the left side of the text cursor and moves the cursor one position to the left. If a text has been selected by the user (e.g. by clicking and dragging) the cursor is put at the beginning of the selected text and the selected text is removed.

del()

[править]
void Q3MultiLineEdit::cursorDown ( bool mark = false ) [virtual protected]

Moves the cursor one line down. If mark is true, the text is selected.

See also cursorUp(), cursorLeft(), and cursorRight().

[править]
void Q3MultiLineEdit::cursorLeft ( bool mark = false, bool wrap = true ) [virtual protected]

Moves the cursor one character to the left. If mark is true, the text is selected. The wrap parameter is currently ignored.

See also cursorRight(), cursorUp(), and cursorDown().

[править]
QPoint Q3MultiLineEdit::cursorPoint () const [protected]

Returns the top center point where the cursor is drawn.

[править]
void Q3MultiLineEdit::cursorRight ( bool mark = false, bool wrap = true ) [virtual protected]

Moves the cursor one character to the right. If mark is true, the text is selected. The wrap parameter is currently ignored.

See also cursorLeft(), cursorUp(), and cursorDown().

[править]
void Q3MultiLineEdit::cursorUp ( bool mark = false ) [virtual protected]

Moves the cursor up one line. If mark is true, the text is selected.

See also cursorDown(), cursorLeft(), and cursorRight().

[править]
void Q3MultiLineEdit::cursorWordBackward ( bool mark )

Moves the cursor one word to the left. If mark is true, the text is selected.

See also cursorWordForward().

[править]
void Q3MultiLineEdit::cursorWordForward ( bool mark )

Moves the cursor one word to the right. If mark is true, the text is selected.

See also cursorWordBackward().

[править]
void Q3MultiLineEdit::deselect () [slot]

[править]
void Q3MultiLineEdit::end ( bool mark = false ) [virtual protected]

Moves the text cursor to the right end of the line. If mark is true, text is selected toward the last position. If it is false and the cursor is moved, all selected text is unselected.

See also home().

[править]
bool Q3MultiLineEdit::getMarkedRegion ( int * line1, int * col1, int * line2, int * col2 ) const [protected]

If there is selected text, sets line1, col1, line2 and col2 to the start and end of the selected region and returns true. Returns false if there is no selected text.

[править]
bool Q3MultiLineEdit::hasMarkedText () const

Returns true if there is selected text.

[править]
void Q3MultiLineEdit::home ( bool mark = false ) [virtual protected]

Moves the text cursor to the left end of the line. If mark is true, text is selected toward the first position. If it is false and the cursor is moved, all selected text is unselected.

See also end().

[править]
void Q3MultiLineEdit::insertAndMark ( const QString & str, bool mark ) [virtual protected]

Inserts str at the current cursor position and selects the text if mark is true.

[править]
void Q3MultiLineEdit::insertAt ( const QString & s, int line, int col, bool mark ) [virtual]

Inserts string s at paragraph number line, after character number col in the paragraph. If s contains newline characters, new lines are inserted. If mark is true the inserted string will be selected.

The cursor position is adjusted.

[править]
void Q3MultiLineEdit::insertLine ( const QString & txt, int line = -1 ) [virtual]

Inserts txt at paragraph number line. If line is less than zero, or larger than the number of paragraphs, the new text is put at the end. If txt contains newline characters, several paragraphs are inserted.

The cursor position is not changed.

[править]
void Q3MultiLineEdit::killLine () [virtual protected]

Deletes text from the current cursor position to the end of the line. (Note that this function still operates on lines, not paragraphs.)

[править]
int Q3MultiLineEdit::lineLength ( int row ) const [protected]

Returns the number of characters at paragraph number row. If row is out of range, -1 is returned.

[править]
QString Q3MultiLineEdit::markedText () const

Returns a copy of the selected text.

[править]
int Q3MultiLineEdit::maxLines () const

See also setMaxLines().

[править]
void Q3MultiLineEdit::newLine () [virtual protected]

Splits the paragraph at the current cursor position.

[править]
void Q3MultiLineEdit::pageDown ( bool mark = false ) [virtual protected]

Moves the cursor one page down. If mark is true, the text is selected.

[править]
void Q3MultiLineEdit::pageUp ( bool mark = false ) [virtual protected]

Moves the cursor one page up. If mark is true, the text is selected.

[править]
void Q3MultiLineEdit::removeLine ( int paragraph ) [virtual]

Deletes the paragraph at paragraph number paragraph. If paragraph is less than zero or larger than the number of paragraphs, nothing is deleted.

[править]
void Q3MultiLineEdit::setCursorPosition ( int line, int col, bool mark ) [virtual]

Sets the cursor position to character number col in paragraph number line. The parameters are adjusted to lie within the legal range.

If mark is false, the selection is cleared. otherwise it is extended.

[править]
void Q3MultiLineEdit::setMaxLines ( int max )

Sets the maximum number of lines this Q3MultiLineEdit will hold to max.

See also maxLines().

[править]
QString Q3MultiLineEdit::textLine ( int line ) const

Returns the text at line number line (possibly the empty string), or a null if line is invalid.

[править]
int Q3MultiLineEdit::totalHeight () const

[править]
int Q3MultiLineEdit::totalWidth () const


Copyright © 2007 Trolltech Trademarks
Qt 4.3.2