40 #ifndef QTEXTDOCUMENT_H
41 #define QTEXTDOCUMENT_H
43 #include <QtGui/qtguiglobal.h>
44 #include <QtCore/qobject.h>
45 #include <QtCore/qsize.h>
46 #include <QtCore/qrect.h>
47 #include <QtCore/qvariant.h>
48 #include <QtGui/qfont.h>
49 #include <QtCore/qurl.h>
50 #include <QtCore/qcontainerfwd.h>
83 virtual void redo() = 0;
96 Q_PROPERTY(
bool undoRedoEnabled READ isUndoRedoEnabled WRITE setUndoRedoEnabled)
97 Q_PROPERTY(
bool modified READ isModified WRITE setModified DESIGNABLE
false)
100 Q_PROPERTY(
bool useDesignMetrics READ useDesignMetrics WRITE setUseDesignMetrics)
105 #ifndef QT_NO_CSSPARSER
106 Q_PROPERTY(
QString defaultStyleSheet READ defaultStyleSheet WRITE setDefaultStyleSheet)
108 Q_PROPERTY(
int maximumBlockCount READ maximumBlockCount WRITE setMaximumBlockCount)
109 Q_PROPERTY(
qreal documentMargin READ documentMargin WRITE setDocumentMargin)
120 bool isEmpty()
const;
121 virtual void clear();
123 void setUndoRedoEnabled(
bool enable);
124 bool isUndoRedoEnabled()
const;
126 bool isUndoAvailable()
const;
127 bool isRedoAvailable()
const;
129 int availableUndoSteps()
const;
130 int availableRedoSteps()
const;
132 int revision()
const;
142 void setMetaInformation(MetaInformation
info,
const QString &);
143 QString metaInformation(MetaInformation
info)
const;
145 #ifndef QT_NO_TEXTHTMLPARSER
150 #if QT_CONFIG(textmarkdownwriter) || QT_CONFIG(textmarkdownreader)
151 enum MarkdownFeature {
152 MarkdownNoHTML = 0x0020 | 0x0040,
153 MarkdownDialectCommonMark = 0,
154 MarkdownDialectGitHub = 0x0004 | 0x0008 | 0x0400 | 0x0100 | 0x0200 | 0x0800 | 0x4000
160 #if QT_CONFIG(textmarkdownwriter)
161 QString toMarkdown(MarkdownFeatures features = MarkdownDialectGitHub)
const;
164 #if QT_CONFIG(textmarkdownreader)
165 void setMarkdown(
const QString &markdown, MarkdownFeatures features = MarkdownDialectGitHub);
176 FindBackward = 0x00001,
177 FindCaseSensitively = 0x00002,
178 FindWholeWords = 0x00004
185 #if QT_CONFIG(regularexpression)
197 QTextBlock findBlockByNumber(
int blockNumber)
const;
198 QTextBlock findBlockByLineNumber(
int blockNumber)
const;
209 QFont defaultFont()
const;
211 void setSuperScriptBaseline(
qreal baseline);
212 qreal superScriptBaseline()
const;
214 void setSubScriptBaseline(
qreal baseline);
215 qreal subScriptBaseline()
const;
217 void setBaselineOffset(
qreal baseline);
218 qreal baselineOffset()
const;
220 int pageCount()
const;
222 bool isModified()
const;
224 #ifndef QT_NO_PRINTER
232 StyleSheetResource = 3,
233 MarkdownResource = 4,
252 void markContentsDirty(
int from,
int length);
254 void setUseDesignMetrics(
bool b);
255 bool useDesignMetrics()
const;
260 qreal textWidth()
const;
262 qreal idealWidth()
const;
264 qreal indentWidth()
const;
267 qreal documentMargin()
const;
268 void setDocumentMargin(
qreal margin);
273 int blockCount()
const;
274 int lineCount()
const;
275 int characterCount()
const;
277 #ifndef QT_NO_CSSPARSER
278 void setDefaultStyleSheet(
const QString &sheet);
279 QString defaultStyleSheet()
const;
288 UndoAndRedoStacks = UndoStack | RedoStack
290 void clearUndoRedoStacks(Stacks historyToClear = UndoAndRedoStacks);
292 int maximumBlockCount()
const;
293 void setMaximumBlockCount(
int maximum);
299 void setBaseUrl(
const QUrl &
url);
320 void setModified(
bool m =
true);
The QAbstractTextDocumentLayout class is an abstract base class used to implement custom layouts for ...
virtual ~QAbstractUndoItem()=0
The QChar class provides a 16-bit Unicode character.
The QFont class specifies a query for a font used for drawing text.
The QObject class is the base class of all Qt objects.
The QPagedPaintDevice class represents a paint device that supports multiple pages.
The QPainter class performs low-level painting on widgets and other paint devices.
The QPoint class defines a point in the plane using integer precision.
The QRectF class defines a finite rectangle in the plane using floating point precision.
The QRect class defines a rectangle in the plane using integer precision.
The QRegularExpression class provides pattern matching using regular expressions.
The QSizeF class defines the size of a two-dimensional object using floating point precision.
The QString class provides a Unicode character string.
The QTextBlock class provides a container for text fragments in a QTextDocument. \inmodule QtGui.
The QTextCursor class offers an API to access and modify QTextDocuments.
The QTextDocument class holds formatted text.
void contentsChange(int from, int charsRemoved, int charsAdded)
void modificationChanged(bool m)
void baseUrlChanged(const QUrl &url)
void cursorPositionChanged(const QTextCursor &cursor)
void documentLayoutChanged()
std::function< QVariant(const QUrl &)> ResourceProvider
void blockCountChanged(int newBlockCount)
The QTextFormat class provides formatting information for a QTextDocument. \inmodule QtGui.
The QTextFrame class represents a frame in a QTextDocument. \inmodule QtGui.
The QTextListFormat class provides formatting information for lists in a QTextDocument....
The QTextObject class is a base class for different kinds of objects that can group parts of a QTextD...
The QTextOption class provides a description of general rich text properties. \inmodule QtGui.
The QUrl class provides a convenient interface for working with URLs.
The QVariant class acts like a union for the most common Qt data types.
backing_store_ptr info
[4]
Q_GUI_EXPORT QString convertFromPlainText(const QString &plain, WhiteSpaceMode mode=WhiteSpacePre)
Q_GUI_EXPORT bool mightBeRichText(const QString &)
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction function
#define Q_DECLARE_FLAGS(Flags, Enum)
#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags)
QT_END_INCLUDE_NAMESPACE typedef double qreal
#define Q_DISABLE_COPY(Class)
GLenum GLuint GLenum GLsizei length
GLboolean GLboolean GLboolean b
GLenum GLuint GLintptr GLsizeiptr size
[1]
QtPrivate::QRegularExpressionMatchIteratorRangeBasedForIterator begin(const QRegularExpressionMatchIterator &iterator)
QUrl url("http://www.example.com/List of holidays.xml")
[0]
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent
QDomElement find(const QString &tagName, const QDomElement &e)