diff options
author | dt <qtc-committer@nokia.com> | 2010-04-09 18:46:34 +0200 |
---|---|---|
committer | dt <qtc-committer@nokia.com> | 2010-04-12 15:05:29 +0200 |
commit | 2d908b558ad5891f70fad05d59854782105d92a4 (patch) | |
tree | 502caf36ca75d7be883d39da6270c1bce42b8056 /src/plugins/projectexplorer/taskwindow.cpp | |
parent | 5b2f892190a25f1d25e52d99ecdc5215766de545 (diff) | |
download | qt-creator-2d908b558ad5891f70fad05d59854782105d92a4.tar.gz |
Add text formatting to the TaskDelegate
Reviewed-By: hunger
Diffstat (limited to 'src/plugins/projectexplorer/taskwindow.cpp')
-rw-r--r-- | src/plugins/projectexplorer/taskwindow.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/plugins/projectexplorer/taskwindow.cpp b/src/plugins/projectexplorer/taskwindow.cpp index 5b7d700e62..a26b27376f 100644 --- a/src/plugins/projectexplorer/taskwindow.cpp +++ b/src/plugins/projectexplorer/taskwindow.cpp @@ -122,7 +122,7 @@ public: int sizeOfLineNumber(); void setFileNotFound(const QModelIndex &index, bool b); - enum Roles { File = Qt::UserRole, Line, Description, FileNotFound, Type, Category }; + enum Roles { File = Qt::UserRole, Line, Description, FileNotFound, Type, Category, Task_t }; QIcon iconFor(Task::TaskType type); @@ -337,6 +337,8 @@ QVariant TaskModel::data(const QModelIndex &index, int role) const return (int)m_tasks.at(index.row()).type; } else if (role == TaskModel::Category) { return m_tasks.at(index.row()).category; + } else if (role == TaskModel::Task_t) { + return QVariant::fromValue(m_tasks.at(index.row())); } return QVariant(); } @@ -879,6 +881,7 @@ void TaskDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, int height = 0; description.replace('\n', QChar::LineSeparator); QTextLayout tl(description); + tl.setAdditionalFormats(index.data(TaskModel::Task_t).value<ProjectExplorer::Task>().formats); tl.beginLayout(); while (true) { QTextLine line = tl.createLine(); |