| 22 | using namespace GammaRay; |
| 23 | |
| 24 | static QString formatTypeToString(int type) |
| 25 | { |
| 26 | switch (type) { |
| 27 | case QTextFormat::InvalidFormat: |
| 28 | return QStringLiteral("Invalid"); |
| 29 | case QTextFormat::BlockFormat: |
| 30 | return QStringLiteral("Block"); |
| 31 | case QTextFormat::CharFormat: |
| 32 | return QStringLiteral("Char"); |
| 33 | case QTextFormat::ListFormat: |
| 34 | return QStringLiteral("List"); |
| 35 | case QTextFormat::FrameFormat: |
| 36 | return QStringLiteral("Frame"); |
| 37 | case QTextFormat::UserFormat: |
| 38 | return QStringLiteral("User"); |
| 39 | } |
| 40 | return QStringLiteral("Unknown format: %1").arg(type); |
| 41 | } |
| 42 | |
| 43 | TextDocumentModel::TextDocumentModel(QObject *parent) |
| 44 | : QStandardItemModel(parent) |