Created
March 24, 2013 23:57
-
-
Save pebreo/5234142 to your computer and use it in GitHub Desktop.
Qt code for looping throgh QTextDocument
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
QStringList images; | |
QTextBlock b = document->begin(); | |
while (b.isValid()) { | |
for (QTextBlock::iterator i = b.begin(); !i.atEnd(); ++i) { | |
QTextCharFormat format = i.fragment().charFormat(); | |
bool isImage = format.isImageFormat() | |
if (isImage) | |
images << format.toImageFormat().name(); | |
} | |
b = b.next(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment