Utils::PlainTextDocumentLayout Class
class Utils::PlainTextDocumentLayoutКлас PlainTextDocumentLayout реалізує верстку простого тексту для QTextDocument. Детальніше...
| Header: | #include <PlainTextDocumentLayout> |
Властивості
- cursorWidth : int
Публічні функції
| PlainTextDocumentLayout(QTextDocument *document) | |
| ~PlainTextDocumentLayout() | |
| int | cursorWidth() const |
| QSizeF | documentSize() const |
| void | draw(QPainter *, const int &) override |
| int | hitTest(const QPointF &, Qt::HitTestAccuracy) const |
| int | pageCount() const |
| void | requestUpdate() |
| void | setCursorWidth(int width) |
Захищені функції
| void | documentChanged(int from, int charsRemoved, int charsAdded) |
Детальний опис
Об'єкт PlainTextDocumentLayout необхідний для текстових документів, які можна відображати або редагувати в PlainTextEdit. Див. QTextDocument::setDocumentLayout().
PlainTextDocumentLayout використовує API QAbstractTextDocumentLayout, який вимагає QTextDocument, але частково перевизначає його для кращої підтримки простого тексту. Наприклад, він оперує не вертикальними пікселями, а абзацами (які називаються блоками). Висота документа дорівнює кількості абзаців, що в ньому містяться. Цей макет також не підтримує таблиць, вкладених рамок чи будь-яких складних макетів тексту, що виходять за межі списку абзаців із підсвічуванням синтаксису.
Документація щодо властивостей
cursorWidth : int
Цей параметр визначає ширину курсора в пікселях. Значення за замовчуванням — 1.
Функції доступу:
| int | cursorWidth() const |
| void | setCursorWidth(int width) |
Документація до функцій-членів
PlainTextDocumentLayout::PlainTextDocumentLayout(QTextDocument *document)
Створює макет документа у вигляді простого тексту для тексту document.
[noexcept] PlainTextDocumentLayout::~PlainTextDocumentLayout()
Видаляє макет документа у форматі простого тексту.
[protected] void PlainTextDocumentLayout::documentChanged(int from, int charsRemoved, int charsAdded)
QSizeF PlainTextDocumentLayout::documentSize() const
void PlainTextDocumentLayout::draw(QPainter *, const int &)
int PlainTextDocumentLayout::hitTest(const QPointF &, Qt::HitTestAccuracy) const
int PlainTextDocumentLayout::pageCount() const
void PlainTextDocumentLayout::requestUpdate()
Запитує повне оновлення всіх поглядів.
Copyright © The Qt Company Ltd. and other contributors. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU 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.