Skip to content

Instantly share code, notes, and snippets.

@pebreo
Created March 24, 2013 23:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pebreo/5234142 to your computer and use it in GitHub Desktop.
Save pebreo/5234142 to your computer and use it in GitHub Desktop.
Qt code for looping throgh QTextDocument
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