lookicad.blogg.se

Plain text editor with paragraph
Plain text editor with paragraph






plain text editor with paragraph plain text editor with paragraph

While QPlainTextEdit does not support complex rich text rendering with tables and floats, it does support limited paragraph-based formatting that you may need in a log viewer. Text can be formatted in a limited way, either using a syntax highlighter (see below), or by appending html-formatted text with appendHtml(). The scrolling can be reduced with the centerOnScroll() property, making the log viewer even faster.

plain text editor with paragraph

The combination of setMaximumBlockCount() and appendPlainText() turns QPlainTextEdit into an efficient viewer for log text. If you want to limit the total number of paragraphs in a QPlainTextEdit, as it is for example useful in a log viewer, then you can use the maximumBlockCount property. The find() function can be used to find and select a given string within the text. If you use word wrap to the widget's width WidgetWidth, you can specify whether to break on whitespace or anywhere with setWordWrapMode(). The setLineWrapMode() function is used to specify the kind of line wrap you want, WidgetWidth or NoWrap if you don't want any wrapping. Text can be inserted using the QTextCursor class or using the convenience functions insertPlainText(), appendPlainText() or paste().īy default, the text edit wraps words at whitespace to fit within the text edit widget. The text is set or replaced using setPlainText() which deletes the existing text and replaces it with the text passed to setPlainText(). It can be changed through the viewport()'s cursor property. The shape of the mouse cursor on a QPlainTextEdit is Qt::IBeamCursor by default. Each character within a paragraph has its own attributes, for example, font and color. Paragraphs are separated by hard line breaks. A document consists of zero or more paragraphs. By default when reading plain text, one newline signifies a paragraph. A paragraph is a formatted string which is word-wrapped to fit into the width of the widget. QPlainTextEdit works on paragraphs and characters. QPlainText uses very much the same technology and concepts as QTextEdit, but is optimized for plain text handling. It is optimized to handle large documents and to respond quickly to user input. QPlainTextEdit is an advanced viewer/editor supporting plain text. ScrollContentsBy(int dx, int dy) overrideĭetailed Description Introduction and Concepts MouseReleaseEvent(QMouseEvent * e) override MousePressEvent(QMouseEvent * e) override MouseDoubleClickEvent(QMouseEvent * e) override InputMethodEvent(QInputMethodEvent * e) override SetWordWrapMode(QTextOption::WrapMode policy)ĬontextMenuEvent(QContextMenuEvent * event) overrideĭragEnterEvent(QDragEnterEvent * e) overrideĭragLeaveEvent(QDragLeaveEvent * e) overrideĭragMoveEvent(QDragMoveEvent * e) override SetTextInteractionFlags(Qt::TextInteractionFlags flags) SetTextCursor(const QTextCursor & cursor) SetPlaceholderText(const QString & placeholderText) SetLineWrapMode(QPlainTextEdit::LineWrapMode mode) SetExtraSelections(const QList & selections) SetCurrentCharFormat(const QTextCharFormat & format) MoveCursor(QTextCursor::MoveOperation operation, QTextCursor::MoveMode mode = QTextCursor::MoveAnchor) MergeCurrentCharFormat(const QTextCharFormat & modifier) LoadResource(int type, const QUrl & name) QPlainTextEdit(const QString & text, QWidget * parent = nullptr)ĬreateStandardContextMenu(const QPoint & position)ĬursorForPosition(const QPoint & pos) constĬursorRect(const QTextCursor & cursor) constįind(const QString & exp, QTextDocument::FindFlags options = QTextDocument::FindFlags())įind(const QRegularExpression & exp, QTextDocument::FindFlags options = QTextDocument::FindFlags()) QPlainTextEdit(QWidget * parent = nullptr)








Plain text editor with paragraph