| 166 | } |
| 167 | |
| 168 | QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override |
| 169 | { |
| 170 | if(index.isValid()) |
| 171 | { |
| 172 | int col = index.column(); |
| 173 | |
| 174 | // preview columns |
| 175 | if(col == 2 || col == 4) |
| 176 | { |
| 177 | if(role == Qt::SizeHintRole) |
| 178 | return QSize(16, 0); |
| 179 | } |
| 180 | |
| 181 | if(m_Loading) |
| 182 | { |
| 183 | if(role == Qt::DisplayRole && col == 0) |
| 184 | return tr("Loading..."); |
| 185 | |
| 186 | return QVariant(); |
| 187 | } |
| 188 | |
| 189 | if(role == Qt::DisplayRole) |
| 190 | { |
| 191 | QString uavName = IsD3D(m_Ctx.APIProps().pipelineType) ? lit("UAV") : lit("Storage"); |
| 192 | // main text |
| 193 | if(col == 0) |
| 194 | { |
| 195 | if(isEvent(index)) |
| 196 | { |
| 197 | const QList<PixelModification> &mods = getMods(index); |
| 198 | const ActionDescription *action = m_Ctx.GetAction(mods.front().eventId); |
| 199 | if(!action) |
| 200 | return QVariant(); |
| 201 | |
| 202 | QString ret; |
| 203 | QList<const ActionDescription *> actionstack; |
| 204 | const ActionDescription *parent = action->parent; |
| 205 | while(parent) |
| 206 | { |
| 207 | actionstack.push_back(parent); |
| 208 | parent = parent->parent; |
| 209 | } |
| 210 | |
| 211 | if(!actionstack.isEmpty()) |
| 212 | { |
| 213 | ret += lit("> ") + actionstack.back()->customName; |
| 214 | |
| 215 | if(actionstack.count() > 3) |
| 216 | ret += lit(" ..."); |
| 217 | |
| 218 | ret += lit("\n"); |
| 219 | |
| 220 | if(actionstack.count() > 2) |
| 221 | ret += lit("> ") + actionstack[1]->customName + lit("\n"); |
| 222 | if(actionstack.count() > 1) |
| 223 | ret += lit("> ") + actionstack[0]->customName + lit("\n"); |
| 224 | |
| 225 | ret += lit("\n"); |