Qt 4.8
|
Public Functions | |
QTextDocumentWithImageResources (QDeclarativeText *parent) | |
int | resourcesLoading () const |
void | setText (const QString &) |
virtual | ~QTextDocumentWithImageResources () |
Public Functions inherited from QTextDocument | |
void | addResource (int type, const QUrl &name, const QVariant &resource) |
Adds the resource resource to the resource cache, using type and name as identifiers. More... | |
void | adjustSize () |
Adjusts the document to a reasonable size. More... | |
QVector< QTextFormat > | allFormats () const |
Returns a vector of text formats for all the formats used in the document. More... | |
int | availableRedoSteps () const |
Returns the number of available redo steps. More... | |
int | availableUndoSteps () const |
Returns the number of available undo steps. More... | |
QTextBlock | begin () const |
Returns the document's first text block. More... | |
int | blockCount () const |
QChar | characterAt (int pos) const |
Returns the character at position pos, or a null character if the position is out of range. More... | |
int | characterCount () const |
Returns the number of characters of this document. More... | |
virtual void | clear () |
Clears the document. More... | |
void | clearUndoRedoStacks (Stacks historyToClear=UndoAndRedoStacks) |
Clears the stacks specified by stacksToClear. More... | |
QTextDocument * | clone (QObject *parent=0) const |
Creates a new QTextDocument that is a copy of this text document. More... | |
Qt::CursorMoveStyle | defaultCursorMoveStyle () const |
The default cursor movement style is used by all QTextCursor objects created from the document. More... | |
QFont | defaultFont () const |
QString | defaultStyleSheet () const |
QTextOption | defaultTextOption () const |
the default text option will be set on all QTextLayout in the document. More... | |
QTextDocumentPrivate * | docHandle () const |
So that not all classes have to be friends of each other. More... | |
QAbstractTextDocumentLayout * | documentLayout () const |
Returns the document layout for this document. More... | |
qreal | documentMargin () const |
void | drawContents (QPainter *painter, const QRectF &rect=QRectF()) |
Draws the content of the document with painter p, clipped to rect. More... | |
QTextBlock | end () const |
This function returns a block to test for the end of the document while iterating over it. More... | |
QTextCursor | find (const QString &subString, int from=0, FindFlags options=0) const |
Finds the next occurrence of the string, subString, in the document. More... | |
QTextCursor | find (const QString &subString, const QTextCursor &from, FindFlags options=0) const |
Finds the next occurrence of the string, subString, in the document. More... | |
QTextCursor | find (const QRegExp &expr, int from=0, FindFlags options=0) const |
Finds the next occurrence, matching the regular expression, expr, in the document. More... | |
QTextCursor | find (const QRegExp &expr, const QTextCursor &from, FindFlags options=0) const |
Finds the next occurrence, matching the regular expression, expr, in the document. More... | |
QTextBlock | findBlock (int pos) const |
Returns the text block that contains the {pos}-th character. More... | |
QTextBlock | findBlockByLineNumber (int blockNumber) const |
Returns the text block that contains the specified lineNumber. More... | |
QTextBlock | findBlockByNumber (int blockNumber) const |
Returns the text block with the specified blockNumber. More... | |
QTextBlock | firstBlock () const |
Returns the document's first text block. More... | |
QTextFrame * | frameAt (int pos) const |
Returns the frame that contains the text cursor position pos. More... | |
qreal | idealWidth () const |
Returns the ideal width of the text document. More... | |
qreal | indentWidth () const |
bool | isEmpty () const |
Returns true if the document is empty; otherwise returns false. More... | |
bool | isModified () const |
bool | isRedoAvailable () const |
Returns true if redo is available; otherwise returns false. More... | |
bool | isUndoAvailable () const |
Returns true if undo is available; otherwise returns false. More... | |
bool | isUndoRedoEnabled () const |
QTextBlock | lastBlock () const |
Returns the document's last (valid) text block. More... | |
int | lineCount () const |
Returns the number of lines of this document (if the layout supports this). More... | |
void | markContentsDirty (int from, int length) |
Marks the contents specified by the given position and length as "dirty", informing the document that it needs to be laid out again. More... | |
int | maximumBlockCount () const |
QString | metaInformation (MetaInformation info) const |
Returns meta information about the document of the type specified by info. More... | |
QTextObject * | object (int objectIndex) const |
Returns the text object associated with the given objectIndex. More... | |
QTextObject * | objectForFormat (const QTextFormat &) const |
Returns the text object associated with the format f. More... | |
int | pageCount () const |
returns the number of pages in this document. More... | |
QSizeF | pageSize () const |
void | print (QPrinter *printer) const |
Prints the document to the given printer. More... | |
QTextDocument (QObject *parent=0) | |
Constructs an empty QTextDocument with the given parent. More... | |
QTextDocument (const QString &text, QObject *parent=0) | |
Constructs a QTextDocument containing the plain (unformatted) text specified, and with the given parent. More... | |
void | redo (QTextCursor *cursor) |
Redoes the last editing operation on the document if redo is available. More... | |
QVariant | resource (int type, const QUrl &name) const |
Returns data of the specified type from the resource with the given name. More... | |
int | revision () const |
Returns the document's revision (if undo is enabled). More... | |
QTextFrame * | rootFrame () const |
Returns the document's root frame. More... | |
void | setDefaultCursorMoveStyle (Qt::CursorMoveStyle style) |
Sets the default cursor movement style to the given style. More... | |
void | setDefaultFont (const QFont &font) |
Sets the default font to use in the document layout. More... | |
void | setDefaultStyleSheet (const QString &sheet) |
void | setDefaultTextOption (const QTextOption &option) |
Sets the default text option. More... | |
void | setDocumentLayout (QAbstractTextDocumentLayout *layout) |
Sets the document to use the given layout. More... | |
void | setDocumentMargin (qreal margin) |
void | setHtml (const QString &html) |
Replaces the entire contents of the document with the given HTML-formatted text in the html string. More... | |
void | setIndentWidth (qreal width) |
Sets the width used for text list and text block indenting. More... | |
void | setMaximumBlockCount (int maximum) |
void | setMetaInformation (MetaInformation info, const QString &) |
Sets the document's meta information of the type specified by info to the given string. More... | |
void | setPageSize (const QSizeF &size) |
void | setPlainText (const QString &text) |
Replaces the entire contents of the document with the given plain text. More... | |
void | setTextWidth (qreal width) |
void | setUndoRedoEnabled (bool enable) |
void | setUseDesignMetrics (bool b) |
QSizeF | size () const |
qreal | textWidth () const |
QString | toHtml (const QByteArray &encoding=QByteArray()) const |
Returns a string containing an HTML representation of the document. More... | |
QString | toPlainText () const |
Returns the plain text contained in the document. More... | |
void | undo (QTextCursor *cursor) |
Undoes the last editing operation on the document if undo is available. More... | |
bool | useDesignMetrics () const |
~QTextDocument () | |
Destroys the document. More... | |
Public Functions inherited from QObject | |
bool | blockSignals (bool b) |
If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke anything connected to it). More... | |
const QObjectList & | children () const |
Returns a list of child objects. More... | |
bool | connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const |
bool | disconnect (const char *signal=0, const QObject *receiver=0, const char *member=0) |
bool | disconnect (const QObject *receiver, const char *member=0) |
void | dumpObjectInfo () |
Dumps information about signal connections, etc. More... | |
void | dumpObjectTree () |
Dumps a tree of children to the debug output. More... | |
QList< QByteArray > | dynamicPropertyNames () const |
Returns the names of all properties that were dynamically added to the object using setProperty(). More... | |
virtual bool | event (QEvent *) |
This virtual function receives events to an object and should return true if the event e was recognized and processed. More... | |
virtual bool | eventFilter (QObject *, QEvent *) |
Filters events if this object has been installed as an event filter for the watched object. More... | |
template<typename T > | |
T | findChild (const QString &aName=QString()) const |
Returns the child of this object that can be cast into type T and that is called name, or 0 if there is no such object. More... | |
template<typename T > | |
QList< T > | findChildren (const QString &aName=QString()) const |
Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. More... | |
template<typename T > | |
QList< T > | findChildren (const QRegExp &re) const |
bool | inherits (const char *classname) const |
Returns true if this object is an instance of a class that inherits className or a QObject subclass that inherits className; otherwise returns false. More... | |
void | installEventFilter (QObject *) |
Installs an event filter filterObj on this object. More... | |
bool | isWidgetType () const |
Returns true if the object is a widget; otherwise returns false. More... | |
void | killTimer (int id) |
Kills the timer with timer identifier, id. More... | |
virtual const QMetaObject * | metaObject () const |
Returns a pointer to the meta-object of this object. More... | |
void | moveToThread (QThread *thread) |
Changes the thread affinity for this object and its children. More... | |
QString | objectName () const |
QObject * | parent () const |
Returns a pointer to the parent object. More... | |
QVariant | property (const char *name) const |
Returns the value of the object's name property. More... | |
Q_INVOKABLE | QObject (QObject *parent=0) |
Constructs an object with parent object parent. More... | |
void | removeEventFilter (QObject *) |
Removes an event filter object obj from this object. More... | |
void | setObjectName (const QString &name) |
void | setParent (QObject *) |
Makes the object a child of parent. More... | |
bool | setProperty (const char *name, const QVariant &value) |
Sets the value of the object's name property to value. More... | |
void | setUserData (uint id, QObjectUserData *data) |
bool | signalsBlocked () const |
Returns true if signals are blocked; otherwise returns false. More... | |
int | startTimer (int interval) |
Starts a timer and returns a timer identifier, or returns zero if it could not start a timer. More... | |
QThread * | thread () const |
Returns the thread in which the object lives. More... | |
QObjectUserData * | userData (uint id) const |
virtual | ~QObject () |
Destroys the object, deleting all its child objects. More... | |
Protected Functions | |
QVariant | loadResource (int type, const QUrl &name) |
Loads data of the specified type from the resource with the given name. More... | |
Protected Functions inherited from QTextDocument | |
virtual QTextObject * | createObject (const QTextFormat &f) |
Creates and returns a new document object (a QTextObject), based on the given format. More... | |
QTextDocument (QTextDocumentPrivate &dd, QObject *parent) | |
Protected Functions inherited from QObject | |
virtual void | childEvent (QChildEvent *) |
This event handler can be reimplemented in a subclass to receive child events. More... | |
virtual void | connectNotify (const char *signal) |
This virtual function is called when something has been connected to signal in this object. More... | |
virtual void | customEvent (QEvent *) |
This event handler can be reimplemented in a subclass to receive custom events. More... | |
virtual void | disconnectNotify (const char *signal) |
This virtual function is called when something has been disconnected from signal in this object. More... | |
QObject (QObjectPrivate &dd, QObject *parent=0) | |
int | receivers (const char *signal) const |
Returns the number of receivers connected to the signal. More... | |
QObject * | sender () const |
Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; otherwise it returns 0. More... | |
int | senderSignalIndex () const |
virtual void | timerEvent (QTimerEvent *) |
This event handler can be reimplemented in a subclass to receive timer events for the object. More... | |
Private Slots | |
void | requestFinished () |
Properties | |
QHash< QUrl, QDeclarativePixmap * > | m_resources |
int | outstanding |
Static Private Attributes | |
static QSet< QUrl > | errors |
Additional Inherited Members | |
Public Types inherited from QTextDocument | |
enum | FindFlag { FindBackward = 0x00001, FindCaseSensitively = 0x00002, FindWholeWords = 0x00004 } |
This enum describes the options available to QTextDocument's find function. More... | |
enum | MetaInformation { DocumentTitle, DocumentUrl } |
This enum describes the different types of meta information that can be added to a document. More... | |
enum | ResourceType { HtmlResource = 1, ImageResource = 2, StyleSheetResource = 3, UserResource = 100 } |
This enum describes the types of resources that can be loaded by QTextDocument's loadResource() function. More... | |
enum | Stacks { UndoStack = 0x01, RedoStack = 0x02, UndoAndRedoStacks = UndoStack | RedoStack } |
Public Slots inherited from QTextDocument | |
void | appendUndoItem (QAbstractUndoItem *) |
Appends a custom undo item to the undo stack. More... | |
void | redo () |
Redoes the last editing operation on the document if redo is available. More... | |
void | setModified (bool m=true) |
void | undo () |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
Public Slots inherited from QObject | |
void | deleteLater () |
Schedules this object for deletion. More... | |
Signals inherited from QTextDocument | |
void | blockCountChanged (int newBlockCount) |
This signal is emitted when the total number of text blocks in the document changes. More... | |
void | contentsChange (int from, int charsRemoves, int charsAdded) |
This signal is emitted whenever the document's content changes; for example, when text is inserted or deleted, or when formatting is applied. More... | |
void | contentsChanged () |
This signal is emitted whenever the document's content changes; for example, when text is inserted or deleted, or when formatting is applied. More... | |
void | cursorPositionChanged (const QTextCursor &cursor) |
This signal is emitted whenever the position of a cursor changed due to an editing operation. More... | |
void | documentLayoutChanged () |
This signal is emitted when a new document layout is set. More... | |
void | modificationChanged (bool m) |
This signal is emitted whenever the content of the document changes in a way that affects the modification state. More... | |
void | redoAvailable (bool) |
This signal is emitted whenever redo operations become available (available is true) or unavailable (available is false). More... | |
void | undoAvailable (bool) |
This signal is emitted whenever undo operations become available (available is true) or unavailable (available is false). More... | |
void | undoCommandAdded () |
This signal is emitted every time a new level of undo is added to the QTextDocument. More... | |
Signals inherited from QObject | |
void | destroyed (QObject *=0) |
This signal is emitted immediately before the object obj is destroyed, and can not be blocked. More... | |
Static Public Functions inherited from QObject | |
static bool | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection) |
Creates a connection of the given type from the signal in the sender object to the method in the receiver object. More... | |
static bool | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type=Qt::AutoConnection) |
static bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member) |
Disconnects signal in object sender from method in object receiver. More... | |
static bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &member) |
static uint | registerUserData () |
static QString | tr (const char *sourceText, const char *comment=0, int n=-1) |
static QString | trUtf8 (const char *sourceText, const char *comment=0, int n=-1) |
Static Public Variables inherited from QObject | |
static const QMetaObject | staticMetaObject |
This variable stores the meta-object for the class. More... | |
Protected Variables inherited from QObject | |
QScopedPointer< QObjectData > | d_ptr |
Static Protected Variables inherited from QObject | |
static const QMetaObject | staticQtMetaObject |
Related Functions inherited from QObject | |
T | qFindChildqFindChildren (const QObject *obj, const QString &name)() |
QList< T > | qFindChildrenqFindChildren (const QObject *obj, const QString &name)() |
QList< T > | qFindChildrenqFindChildren (const QObject *obj, const QRegExp ®Exp)() |
T * | qobject_cast (QObject *object) |
QObjectList | |
void * | qt_find_obj_child (QObject *parent, const char *type, const QString &name) |
Returns a pointer to the object named name that inherits type and with a given parent. More... | |
Definition at line 62 of file qdeclarativetext.cpp.
QTextDocumentWithImageResources::QTextDocumentWithImageResources | ( | QDeclarativeText * | parent | ) |
Definition at line 103 of file qdeclarativetext.cpp.
Referenced by QDeclarativeTextPrivate::ensureDoc().
|
virtual |
Definition at line 108 of file qdeclarativetext.cpp.
|
protectedvirtual |
Loads data of the specified type from the resource with the given name.
This function is called by the rich text engine to request data that isn't directly stored by QTextDocument, but still associated with it. For example, images are referenced indirectly by the name attribute of a QTextImageFormat object.
When called by Qt, type is one of the values of QTextDocument::ResourceType.
If the QTextDocument is a child object of a QTextEdit, QTextBrowser, or a QTextDocument itself then the default implementation tries to retrieve the data from the parent.
Reimplemented from QTextDocument.
Definition at line 114 of file qdeclarativetext.cpp.
Referenced by resourcesLoading().
|
privateslot |
Definition at line 146 of file qdeclarativetext.cpp.
Referenced by loadResource(), and resourcesLoading().
|
inline |
Definition at line 70 of file qdeclarativetext.cpp.
void QTextDocumentWithImageResources::setText | ( | const QString & | text | ) |
Definition at line 162 of file qdeclarativetext.cpp.
Definition at line 82 of file qdeclarativetext.cpp.
Referenced by loadResource(), and setText().
|
private |
Definition at line 79 of file qdeclarativetext.cpp.
Referenced by loadResource(), setText(), and ~QTextDocumentWithImageResources().
|
private |
Definition at line 81 of file qdeclarativetext.cpp.
Referenced by loadResource(), requestFinished(), resourcesLoading(), and setText().