408 d->handlers.insert(objectType,
h);
421 const auto it =
d->handlers.constFind(objectType);
426 d->handlers.erase(
it);
441 return handler.
iface;
466 item.setWidth(
s.width());
467 item.setAscent(
s.height());
523 if ((*it).component ==
obj)
537 return pieceTable->
find(
pos).value()->format;
548 int idx = pieceTable->
find(
pos).value()->format;
572 return fmt.anchorHref();
604 int relativeCursorPos = cursorPos - block.
position();
605 const int preeditLength =
layout ?
layout->preeditAreaText().size() : 0;
606 if (preeditLength > 0 && relativeCursorPos >
layout->preeditAreaPosition())
607 cursorPos -=
qMin(cursorPos -
layout->preeditAreaPosition(), preeditLength);
610 block = block.
next();
643 block = block.
next();
680 return d->paintDevice;
685#include "moc_qabstracttextdocumentlayout.cpp"
IOBluetoothDevice * device
~QAbstractTextDocumentLayoutPrivate()
void _q_handlerDestroyed(QObject *obj)
virtual void resizeInlineObject(QTextInlineObject item, int posInDocument, const QTextFormat &format)
Sets the size of the inline object item corresponding to the text format.
QTextFormat formatAt(const QPointF &pos) const
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...
virtual void positionInlineObject(QTextInlineObject item, int posInDocument, const QTextFormat &format)
Lays out the inline object item using the given text format.
void unregisterHandler(int objectType, QObject *component=nullptr)
QTextDocument * document() const
Returns the text document that this layout is operating on.
QTextCharFormat format(int pos)
Returns the character format that is applicable at the given position.
void registerHandler(int objectType, QObject *component)
Registers the given component as a handler for items of the given objectType.
virtual QRectF blockBoundingRect(const QTextBlock &block) const =0
Returns the bounding rectangle of block.
QTextBlock blockWithMarkerAt(const QPointF &pos) const
QAbstractTextDocumentLayout(QTextDocument *doc)
\variable QAbstractTextDocumentLayout::Selection::format
void setPaintDevice(QPaintDevice *device)
Sets the paint device used for rendering the document's layout to the given device.
virtual int hitTest(const QPointF &point, Qt::HitTestAccuracy accuracy) const =0
Returns the cursor position for the given point with the specified accuracy.
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...
QPaintDevice * paintDevice() const
Returns the paint device used to render the document's layout.
~QAbstractTextDocumentLayout()
QString imageAt(const QPointF &pos) const
QTextObjectInterface * handlerForObject(int objectType) const
Returns a handler for objects of the given objectType.
\reentrant \inmodule QtGui
int height() const
Returns the height of the font.
iterator begin()
Returns an \l{STL-style iterators}{STL-style iterator} pointing to the first item in the hash.
iterator Iterator
Qt-style synonym for QHash::iterator.
iterator erase(const_iterator it)
iterator end() noexcept
Returns an \l{STL-style iterators}{STL-style iterator} pointing to the imaginary item after the last ...
static QMetaObject::Connection connect(const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiverPrivate, Func2 slot, Qt::ConnectionType type=Qt::AutoConnection)
static bool disconnect(const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiverPrivate, Func2 slot)
QObject * parent() const
Returns a pointer to the parent object.
void destroyed(QObject *=nullptr)
This signal is emitted immediately before the object obj is destroyed, after any instances of QPointe...
The QPainter class performs low-level painting on widgets and other paint devices.
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
constexpr qreal height() const noexcept
Returns the height of the rectangle.
constexpr qreal width() const noexcept
Returns the width of the rectangle.
bool contains(const QRectF &r) const noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
constexpr QRectF adjusted(qreal x1, qreal y1, qreal x2, qreal y2) const noexcept
Returns a new rectangle with dx1, dy1, dx2 and dy2 added respectively to the existing coordinates of ...
\macro QT_RESTRICTED_CAST_FROM_ASCII
MarkerType marker() const
int indent() const
Returns the paragraph's indent.
qreal leftMargin() const
Returns the paragraph's left margin.
qreal textIndent() const
Returns the paragraph's text indent.
QTextBlockFormat blockFormat() const
Returns the QTextBlockFormat that describes block-specific properties.
bool isValid() const
Returns true if this text block is valid; otherwise returns false.
QTextBlock next() const
Returns the text block in the document after this block, or an empty text block if this is the last o...
QTextLayout * layout() const
Returns the QTextLayout that is used to lay out and display the block's contents.
int position() const
Returns the index of the block's first character within the document.
QTextCharFormat charFormat() const
Returns the QTextCharFormat that describes the block's character format.
QTextList * textList() const
If the block represents a list item, returns the list that the item belongs to; otherwise returns \nu...
QFont font() const
Returns the font for this character format.
QTextFormatCollection * formatCollection()
static const QTextDocumentPrivate * get(const QTextDocument *document)
FragmentMap::ConstIterator FragmentIterator
FragmentIterator find(int pos) const
\reentrant \inmodule QtGui
QTextBlock firstBlock() const
QTextFormat format(int idx) const
QTextCharFormat charFormat(int index) const
QTextCharFormat toCharFormat() const
Returns this format as a character format.
QTextImageFormat toImageFormat() const
Returns this format as an image format.
bool hasProperty(int propertyId) const
Returns true if the text format has a property with the given propertyId; otherwise returns false.
int indent() const
Returns the list format's indentation.
QTextListFormat format() const
Returns the list's format.
The QTextObjectInterface class allows drawing of custom text objects in \l{QTextDocument}s.
virtual void drawObject(QPainter *painter, const QRectF &rect, QTextDocument *doc, int posInDocument, const QTextFormat &format)=0
Draws this text object using the specified painter.
virtual QSizeF intrinsicSize(QTextDocument *doc, int posInDocument, const QTextFormat &format)=0
The intrinsicSize() function returns the size of the text object represented by format in the given d...
virtual ~QTextObjectInterface()
Destroys this QTextObjectInterface.
QSet< QString >::iterator it
Combined button and popup list for selecting options.
constexpr const T & qMin(const T &a, const T &b)
GLint GLsizei GLsizei GLenum format
GLfloat GLfloat GLfloat GLfloat h
static qreal component(const QPointF &point, unsigned int i)
QVideoFrameFormat::PixelFormat fmt
QPointer< QObject > component
QTextObjectInterface * iface