MCPcopy Create free account
hub / github.com/baldurk/renderdoc / lessThan

Method lessThan

qrenderdoc/Windows/ResourceInspector.cpp:116–137  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

114};
115
116bool ResourceSorterModel::lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const
117{
118 if(m_Sort == SortType::Creation)
119 {
120 return source_left.data(ResourceIdRole).value<ResourceId>() <
121 source_right.data(ResourceIdRole).value<ResourceId>();
122 }
123 else if(m_Sort == SortType::LastAccess)
124 {
125 uint a = source_left.data(LastAccessSortRole).toUInt();
126 uint b = source_right.data(LastAccessSortRole).toUInt();
127
128 // if they're different, sort by access. Otherwise fall through to alphabetical
129 // we invert the reason, so that high values (recent access) are first
130 if(a != b)
131 return a > b;
132
133 return QCollatorSortFilterProxyModel::lessThan(source_left, source_right);
134 }
135
136 return QCollatorSortFilterProxyModel::lessThan(source_left, source_right);
137}
138
139ResourceInspector::ResourceInspector(ICaptureContext &ctx, QWidget *parent)
140 : QFrame(parent), ui(new Ui::ResourceInspector), m_Ctx(ctx)

Callers

nothing calls this directly

Calls 2

lessThanFunction · 0.85
dataMethod · 0.45

Tested by

no test coverage detected