| 1231 | } |
| 1232 | |
| 1233 | QString RichResourceTextFormat(ICaptureContext &ctx, QVariant var) |
| 1234 | { |
| 1235 | RichResourceTextInitialise(var, &ctx); |
| 1236 | if(var.userType() == qMetaTypeId<ResourceId>()) |
| 1237 | return GetTruncatedResourceName(ctx, var.value<ResourceId>()); |
| 1238 | |
| 1239 | if(var.userType() == qMetaTypeId<GPUAddressPtr>()) |
| 1240 | { |
| 1241 | var.value<GPUAddressPtr>()->cacheAddress(ctx); |
| 1242 | |
| 1243 | // a bit hacky, but recurse to pick up the 'name' of the pointer base buffer |
| 1244 | return RichResourceTextFormat(ctx, var.toString()); |
| 1245 | } |
| 1246 | |
| 1247 | if(var.userType() == qMetaTypeId<RichResourceTextPtr>()) |
| 1248 | var.value<RichResourceTextPtr>()->cacheText(ctx); |
| 1249 | |
| 1250 | // either it's something else and wasn't rich resource, in which case just return the string |
| 1251 | // representation, or it's a fully formatted rich resource document, where the cached text will do |
| 1252 | // the trick with ResIdTextToString. |
| 1253 | return var.toString(); |
| 1254 | } |
| 1255 | |
| 1256 | FullEditorDelegate::FullEditorDelegate(QWidget *parent) : QStyledItemDelegate(parent) |
| 1257 | { |
no test coverage detected