49 #include <private/qtextengine_p.h> 76 #ifndef QT_NO_TEXTBROWSER 106 QSize size(width, height);
107 if (!hasWidth || !hasHeight) {
111 size.setWidth(pm.
width());
117 size.setHeight(pm.
height());
153 #ifndef QT_NO_TEXTBROWSER 162 name = format.
name();
181 QSize size(width, height);
182 if (!hasWidth || !hasHeight) {
185 size.setWidth(image.
width());
187 size.setHeight(image.
height());
The QVariant class acts like a union for the most common Qt data types.
QTextImageHandler(QObject *parent=0)
The QPainter class performs low-level painting on widgets and other paint devices.
static QSize getPixmapSize(QTextDocument *doc, const QTextImageFormat &format)
static QPixmap fromImage(const QImage &image, Qt::ImageConversionFlags flags=Qt::AutoColor)
Converts the given image to a pixmap using the specified flags to control the conversion.
#define QT_END_NAMESPACE
This macro expands to.
int width() const
Returns the width of the pixmap.
virtual QSizeF intrinsicSize(QTextDocument *doc, int posInDocument, const QTextFormat &format)
The intrinsicSize() function returns the size of the text object represented by format in the given d...
QString toString(FormattingOptions options=None) const
Returns the human-displayable string representation of the URL.
static QSize getImageSize(QTextDocument *doc, const QTextImageFormat &format)
QByteArray toUtf8() const Q_REQUIRED_RESULT
Returns a UTF-8 representation of the string as a QByteArray.
bool isNull() const
Returns true if it is a null image, otherwise returns false.
static QPixmap getPixmap(QTextDocument *doc, const QTextImageFormat &format)
QString & prepend(QChar c)
bool startsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string starts with s; otherwise returns false.
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
static Q_GUI_EXPORT ExternalImageLoaderFunction externalLoader
The QUrl class provides a convenient interface for working with URLs.
The QString class provides a Unicode character string.
qreal height() const
Returns the height of the rectangle occupied by the image.
QRect rect() const
Returns the enclosing rectangle (0, 0, width(), height()) of the image.
T * qobject_cast(QObject *object)
The QObject class is the base class of all Qt objects.
The QSizeF class defines the size of a two-dimensional object using floating point precision...
QUrl source
the name of the displayed document.
bool load(QIODevice *device, const char *format)
This function reads a QImage from the given device.
bool hasProperty(int propertyId) const
Returns true if the text format has a property with the given propertyId; otherwise returns false...
static QThread * currentThread()
Returns a pointer to a QThread which manages the currently executing thread.
The QTextImageFormat class provides formatting information for images in a QTextDocument.
#define QT_BEGIN_NAMESPACE
This macro expands to.
The QRectF class defines a rectangle in the plane using floating point precision. ...
static QImage getImage(QTextDocument *doc, const QTextImageFormat &format)
The QTextFormat class provides formatting information for a QTextDocument.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
The QImage class provides a hardware-independent image representation that allows direct access to th...
static const char * data(const QByteArray &arr)
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
bool loadFromData(const uchar *buf, uint len, const char *format=0, Qt::ImageConversionFlags flags=Qt::AutoColor)
Loads a pixmap from the len first bytes of the given binary data.
int width() const
Returns the width of the image.
QTextImageFormat toImageFormat() const
Returns this format as an image format.
Q_GUI_EXPORT int qt_defaultDpi()
QObject * parent() const
Returns a pointer to the parent object.
QAbstractTextDocumentLayout * documentLayout() const
Returns the document layout for this document.
The QTextBrowser class provides a rich text browser with hypertext navigation.
QPaintDevice * paintDevice() const
Returns the paint device used to render the document's layout.
void addResource(int type, const QUrl &name, const QVariant &resource)
Adds the resource resource to the resource cache, using type and name as identifiers.
int height() const
Returns the height of the image.
QRect rect() const
Returns the pixmap's enclosing rectangle.
void drawImage(const QRectF &targetRect, const QImage &image, const QRectF &sourceRect, Qt::ImageConversionFlags flags=Qt::AutoColor)
The QPixmap class is an off-screen image representation that can be used as a paint device...
The QTextDocument class holds formatted text that can be viewed and edited using a QTextEdit...
void drawPixmap(const QRectF &targetRect, const QPixmap &pixmap, const QRectF &sourceRect)
Draws the rectangular portion source of the given pixmap into the given target in the paint device...
int height() const
Returns the height of the pixmap.
The QSize class defines the size of a two-dimensional object using integer point precision.
QVariant resource(int type, const QUrl &name) const
Returns data of the specified type from the resource with the given name.
static QUrl fromEncoded(const QByteArray &url)
Parses input and returns the corresponding QUrl.
bool isNull() const
Returns true if this is a null pixmap; otherwise returns false.
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
QImage(* ExternalImageLoaderFunction)(const QString &name, const QString &context)
virtual void drawObject(QPainter *p, const QRectF &rect, QTextDocument *doc, int posInDocument, const QTextFormat &format)
Draws this text object using the specified painter.
Q_DECL_CONSTEXPR int qRound(qreal d)
QString name() const
Returns the name of the image.
bool loadFromData(const uchar *buf, int len, const char *format=0)
Loads an image from the first len bytes of the given binary data.
qreal width() const
Returns the width of the rectangle occupied by the image.
T qvariant_cast(const QVariant &value)
Returns the given value converted to the template type T.