Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qtextimagehandler.cpp File Reference
#include "qtextimagehandler_p.h"
#include <qguiapplication.h>
#include <qtextformat.h>
#include <qpainter.h>
#include <qdebug.h>
#include <qfile.h>
#include <private/qtextengine_p.h>
#include <qpalette.h>
#include <qthread.h>
#include "moc_qtextimagehandler_p.cpp"
+ Include dependency graph for qtextimagehandler.cpp:

Go to the source code of this file.

Functions

static QString findAtNxFileOrResource (const QString &baseFileName, qreal targetDevicePixelRatio, qreal *sourceDevicePixelRatio)
 
static QUrl fromLocalfileOrResources (QString path)
 
template<typename T >
static T getAs (QTextDocument *doc, const QTextImageFormat &format, const qreal devicePixelRatio=1.0)
 
template<typename T >
static QSize getSize (QTextDocument *doc, const QTextImageFormat &format)
 

Function Documentation

◆ findAtNxFileOrResource()

static QString findAtNxFileOrResource ( const QString baseFileName,
qreal  targetDevicePixelRatio,
qreal sourceDevicePixelRatio 
)
inlinestatic

Definition at line 20 of file qtextimagehandler.cpp.

References qt_findAtNxFile(), QString::sliced(), and QString::startsWith().

Referenced by getAs().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fromLocalfileOrResources()

static QUrl fromLocalfileOrResources ( QString  path)
inlinestatic

Definition at line 37 of file qtextimagehandler.cpp.

Referenced by getAs().

+ Here is the caller graph for this function:

◆ getAs()

template<typename T >
static T getAs ( QTextDocument doc,
const QTextImageFormat format,
const qreal  devicePixelRatio = 1.0 
)
static

Definition at line 45 of file qtextimagehandler.cpp.

References QTextDocument::addResource(), findAtNxFileOrResource(), fromLocalfileOrResources(), QTextDocument::ImageResource, QTextDocument::resource(), and url.

+ Here is the call graph for this function:

◆ getSize()

template<typename T >
static QSize getSize ( QTextDocument doc,
const QTextImageFormat format 
)
static

Definition at line 70 of file qtextimagehandler.cpp.

References QTextDocument::documentLayout(), QSizeF::height(), QTextFormat::ImageHeight, QTextFormat::ImageWidth, QPaintDevice::logicalDpiY(), QAbstractTextDocumentLayout::paintDevice(), qRound(), qt_defaultDpi(), QSizeF::setWidth(), and QSizeF::width().

+ Here is the call graph for this function: