Commit b8ab662a authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix generate img attribute

parent ee7dabe0
...@@ -121,6 +121,11 @@ MarkupDirector::processFragment(QTextBlock::iterator it, const QTextFragment &fr ...@@ -121,6 +121,11 @@ MarkupDirector::processFragment(QTextBlock::iterator it, const QTextFragment &fr
// Q_D( MarkupDirector ); // Q_D( MarkupDirector );
const auto charFormat = fragment.charFormat(); const auto charFormat = fragment.charFormat();
//Need to check if it's a image format.
if (charFormat.isImageFormat()) {
const auto imageFormat = charFormat.toImageFormat();
return processImage(it, imageFormat, doc);
}
if (charFormat.objectType() >= QTextFormat::UserObject) { if (charFormat.objectType() >= QTextFormat::UserObject) {
processCustomFragment(fragment, doc); processCustomFragment(fragment, doc);
...@@ -487,7 +492,7 @@ MarkupDirector::processCharTextObject(QTextBlock::iterator it, ...@@ -487,7 +492,7 @@ MarkupDirector::processCharTextObject(QTextBlock::iterator it,
QTextBlock::iterator QTextBlock::iterator
MarkupDirector::processImage(QTextBlock::iterator it, MarkupDirector::processImage(QTextBlock::iterator it,
const QTextImageFormat &imageFormat, const QTextImageFormat &imageFormat,
QTextDocument *doc) const QTextDocument *doc)
{ {
Q_UNUSED(doc) Q_UNUSED(doc)
// TODO: Close any open format elements? // TODO: Close any open format elements?
......
...@@ -197,7 +197,7 @@ public: ...@@ -197,7 +197,7 @@ public:
*/ */
virtual QTextBlock::iterator processImage(QTextBlock::iterator it, virtual QTextBlock::iterator processImage(QTextBlock::iterator it,
const QTextImageFormat &imageFormat, const QTextImageFormat &imageFormat,
QTextDocument *doc); QTextDocument const *doc);
/** /**
Directs the builder to create output for the contents of the single @p Directs the builder to create output for the contents of the single @p
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment