Movatterモバイル変換


[0]ホーム

URL:


We bake cookies in your browser for a better experience. Using this site means that you consent.Read More

Menu

Qt Documentation

  • Qt 4.8
  • Qt3SupportLight
  • Q3MultiLineEdit

Q3MultiLineEdit Class

TheQ3MultiLineEdit widget is a simple editor for inputting text.More...

Header:#include <Q3MultiLineEdit>
Inherits:Q3TextEdit

Properties

Public Functions

Q3MultiLineEdit(QWidget * parent = 0, const char * name = 0)
~Q3MultiLineEdit()
Qt::Alignmentalignment() const
boolatBeginning() const
boolatEnd() const
boolautoUpdate() const
voidcursorWordBackward(bool mark)
voidcursorWordForward(bool mark)
booledited() const
boolhasMarkedText() const
virtual voidinsertAt(const QString & s, int line, int col, bool mark)
virtual voidinsertLine(const QString & txt, int line = -1)
QStringmarkedText() const
intmaxLines() const
intnumLines() const
virtual voidremoveLine(int paragraph)
voidsetAlignment(Qt::Alignment flags)
virtual voidsetCursorPosition(int line, int col, bool mark)
voidsetEdited(bool)
voidsetMaxLines(int max)
QStringtextLine(int line) const
inttotalHeight() const
inttotalWidth() const

Reimplemented Public Functions

virtual voidinsertAt(const QString & s, int line, int col)
virtual voidsetCursorPosition(int line, int col)

Public Slots

voiddeselect()

Protected Functions

virtual voidbackspace()
virtual voidcursorDown(bool mark = false)
virtual voidcursorLeft(bool mark = false, bool wrap = true)
QPointcursorPoint() const
virtual voidcursorRight(bool mark = false, bool wrap = true)
virtual voidcursorUp(bool mark = false)
virtual voidend(bool mark = false)
boolgetMarkedRegion(int * line1, int * col1, int * line2, int * col2) const
virtual voidhome(bool mark = false)
virtual voidinsertAndMark(const QString & str, bool mark)
virtual voidkillLine()
intlineLength(int row) const
virtual voidnewLine()
virtual voidpageDown(bool mark = false)
virtual voidpageUp(bool mark = false)
  • 22 protected functions inherited fromQ3TextEdit
  • 26 protected functions inherited fromQ3ScrollView
  • 5 protected functions inherited fromQ3Frame
  • 3 protected functions inherited fromQFrame
  • 37 protected functions inherited fromQWidget
  • 8 protected functions inherited fromQObject
  • 1 protected function inherited fromQPaintDevice

Additional Inherited Members

Detailed Description

TheQ3MultiLineEdit widget is a simple editor for inputting text.

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

If you implement something new withQ3MultiLineEdit, we suggest usingQ3TextEdit instead and callQ3TextEdit::setTextFormat(Qt::PlainText).

Although most of the oldQ3MultiLineEdit API is still available, there is a few difference. The oldQ3MultiLineEdit 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 ofQ3MultiLineEdit should still work without problems. Some odd usage will require some porting. In these cases, it may be better to useQ3TextEdit now.

See alsoQ3TextEdit.

Property Documentation

alignment :Qt::Alignment

This property holds the editor's paragraph alignment.

Sets the alignment to flag, which must beQt::AlignLeft,Qt::AlignHCenter, orQt::AlignRight.

If flag is an illegal flag, nothing happens.

Access functions:

Qt::Alignmentalignment() const
voidsetAlignment(Qt::Alignment flags)

atBeginning : constbool

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

Access functions:

boolatBeginning() const

See alsoatEnd.

atEnd : constbool

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

Access functions:

boolatEnd() const

See alsoatBeginning.

edited :bool

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

This is the same asQ3TextEdit's "modifed" property.

Access functions:

booledited() const
voidsetEdited(bool)

numLines : constint

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.

Access functions:

intnumLines() const

Member Function Documentation

Q3MultiLineEdit::Q3MultiLineEdit(QWidget * parent = 0, constchar * name = 0)

Constructs a new, empty,Q3MultiLineEdit with parentparent calledname.

Q3MultiLineEdit::~Q3MultiLineEdit()

Destructor.

bool Q3MultiLineEdit::autoUpdate() const

This function is a noop that always returns true.

[virtual protected]void Q3MultiLineEdit::backspace()

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

[virtual protected]void Q3MultiLineEdit::cursorDown(bool mark = false)

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

See alsocursorUp(),cursorLeft(), andcursorRight().

[virtual protected]void Q3MultiLineEdit::cursorLeft(bool mark = false,bool wrap = true)

Moves the cursor one character to the left. Ifmark is true, the text is selected. Thewrap parameter is currently ignored.

See alsocursorRight(),cursorUp(), andcursorDown().

[protected]QPoint Q3MultiLineEdit::cursorPoint() const

Returns the top center point where the cursor is drawn.

[virtual protected]void Q3MultiLineEdit::cursorRight(bool mark = false,bool wrap = true)

Moves the cursor one character to the right. Ifmark is true, the text is selected. Thewrap parameter is currently ignored.

See alsocursorLeft(),cursorUp(), andcursorDown().

[virtual protected]void Q3MultiLineEdit::cursorUp(bool mark = false)

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

See alsocursorDown(),cursorLeft(), andcursorRight().

void Q3MultiLineEdit::cursorWordBackward(bool mark)

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

See alsocursorWordForward().

void Q3MultiLineEdit::cursorWordForward(bool mark)

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

See alsocursorWordBackward().

[slot]void Q3MultiLineEdit::deselect()

[virtual protected]void Q3MultiLineEdit::end(bool mark = false)

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

See alsohome().

[protected]bool Q3MultiLineEdit::getMarkedRegion(int * line1,int * col1,int * line2,int * col2) const

If there is selected text, setsline1,col1,line2 andcol2 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.

[virtual protected]void Q3MultiLineEdit::home(bool mark = false)

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

See alsoend().

[virtual protected]void Q3MultiLineEdit::insertAndMark(constQString & str,bool mark)

Insertsstr at the current cursor position and selects the text ifmark is true.

[virtual]void Q3MultiLineEdit::insertAt(constQString & s,int line,int col)

Reimplemented fromQ3TextEdit::insertAt().

[virtual]void Q3MultiLineEdit::insertAt(constQString & s,int line,int col,bool mark)

Inserts strings at paragraph numberline, after character numbercol in the paragraph. Ifs contains newline characters, new lines are inserted. Ifmark is true the inserted string will be selected.

The cursor position is adjusted.

[virtual]void Q3MultiLineEdit::insertLine(constQString & txt,int line = -1)

Insertstxt at paragraph numberline. Ifline is less than zero, or larger than the number of paragraphs, the new text is put at the end. Iftxt contains newline characters, several paragraphs are inserted.

The cursor position is not changed.

[virtual protected]void Q3MultiLineEdit::killLine()

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

[protected]int Q3MultiLineEdit::lineLength(int row) const

Returns the number of characters at paragraph numberrow. Ifrow is out of range, -1 is returned.

QString Q3MultiLineEdit::markedText() const

Returns a copy of the selected text.

int Q3MultiLineEdit::maxLines() const

See alsosetMaxLines().

[virtual protected]void Q3MultiLineEdit::newLine()

Splits the paragraph at the current cursor position.

[virtual protected]void Q3MultiLineEdit::pageDown(bool mark = false)

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

[virtual protected]void Q3MultiLineEdit::pageUp(bool mark = false)

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

[virtual]void Q3MultiLineEdit::removeLine(int paragraph)

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

[virtual]void Q3MultiLineEdit::setCursorPosition(int line,int col)

Reimplemented fromQ3TextEdit::setCursorPosition().

[virtual]void Q3MultiLineEdit::setCursorPosition(int line,int col,bool mark)

Sets the cursor position to character numbercol in paragraph numberline. The parameters are adjusted to lie within the legal range.

Ifmark is false, the selection is cleared. otherwise it is extended.

void Q3MultiLineEdit::setMaxLines(int max)

Sets the maximum number of lines thisQ3MultiLineEdit will hold tomax.

See alsomaxLines().

QString Q3MultiLineEdit::textLine(int line) const

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

int Q3MultiLineEdit::totalHeight() const

int Q3MultiLineEdit::totalWidth() const

© 2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of theGNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.


[8]ページ先頭

©2009-2025 Movatter.jp