446 d->setDocument(document);
456 d->setDocument(document);
488 d->handlers.insert(formatType, h);
502 return handler.
iface;
523 if (!handler.component)
526 QSizeF s = handler.iface->intrinsicSize(
document(), posInDocument, format);
574 if (!handler.component)
577 handler.iface->drawObject(p, rect,
document(), posInDocument, format);
583 while (it != handlers.end())
584 if ((*it).component == obj)
585 it = handlers.erase(it);
601 return pieceTable->
find(pos).value()->format;
615 int idx = pieceTable->
find(pos).value()->format;
675 d->paintDevice = device;
686 return d->paintDevice;
691 #include "moc_qabstracttextdocumentlayout.cpp" The QPainter class performs low-level painting on widgets and other paint devices.
QTextCharFormat charFormat(int index) const
void registerHandler(int objectType, QObject *component)
Registers the given component as a handler for items of the given objectType.
The QTextCharFormat class provides formatting information for characters in a QTextDocument.
#define QT_END_NAMESPACE
This macro expands to.
QTextCharFormat format(int pos)
Returns the character format that is applicable at the given position.
#define it(className, varName)
QTextObjectInterface * handlerForObject(int objectType) const
Returns a handler for objects of the given objectType.
virtual void resizeInlineObject(QTextInlineObject item, int posInDocument, const QTextFormat &format)
Sets the size of the inline object item corresponding to the text format.
qreal width() const
Returns the width.
QTextObjectInterface * iface
virtual void drawInlineObject(QPainter *painter, const QRectF &rect, QTextInlineObject object, int posInDocument, const QTextFormat &format)
This function is called to draw the inline object, object, with the given painter within the rectangl...
QString formatType(const NamePool::Ptr &np, const T &type)
Formats ItemType and SequenceType.
The QPointF class defines a point in the plane using floating point precision.
qreal height() const
Returns the height.
QTextDocument * document() const
Returns the text document that this layout is operating on.
QString anchorHref() const
Returns the text format's hypertext link, or an empty string if none has been set.
The QString class provides a Unicode character string.
T * qobject_cast(QObject *object)
bool isValid() const
Returns true if this character format is valid; otherwise returns false.
QString anchorAt(const QPointF &pos) const
Returns the reference of the anchor the given position, or an empty string if no anchor exists at tha...
The QObject class is the base class of all Qt objects.
QPointer< QObject > component
The QSizeF class defines the size of a two-dimensional object using floating point precision...
FragmentMap::ConstIterator FragmentIterator
void setDescent(qreal d)
Sets the inline object's decent to d.
QAbstractTextDocumentLayout(QTextDocument *doc)
Creates a new text document layout for the given document.
#define QT_BEGIN_NAMESPACE
This macro expands to.
FragmentIterator find(int pos) const
The QRectF class defines a rectangle in the plane using floating point precision. ...
int objectType() const
Returns the text format's object type.
void destroyed(QObject *=0)
This signal is emitted immediately before the object obj is destroyed, and can not be blocked...
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 rece...
The QTextFormat class provides formatting information for a QTextDocument.
QTextFormatCollection * formatCollection()
static qreal component(const QPointF &point, unsigned int i)
The QTextObjectInterface class allows drawing of custom text objects in QTextDocument.
~QAbstractTextDocumentLayout()
void setWidth(qreal w)
Sets the inline object's width to w.
int formatIndex(int pos)
Returns the index of the format at position pos.
The QTextInlineObject class represents an inline object in a QTextLayout.
void _q_handlerDestroyed(QObject *obj)
void setAscent(qreal a)
Sets the inline object's ascent to a.
QObject * parent() const
Returns a pointer to the parent object.
QPaintDevice * paintDevice() const
Returns the paint device used to render the document's layout.
The QTextDocument class holds formatted text that can be viewed and edited using a QTextEdit...
void setPaintDevice(QPaintDevice *device)
Sets the paint device used for rendering the document's layout to the given device.
QTextCharFormat toCharFormat() const
Returns this format as a character format.
virtual void positionInlineObject(QTextInlineObject item, int posInDocument, const QTextFormat &format)
Lays out the inline object item using the given text format.
virtual int hitTest(const QPointF &point, Qt::HitTestAccuracy accuracy) const =0
Returns the cursor postion for the given point with the specified accuracy.
QImageIOHandler * handler
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
iterator Iterator
Qt-style synonym for QHash::iterator.
The QAbstractTextDocumentLayout class is an abstract base class used to implement custom layouts for ...