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

Method data

qrenderdoc/Windows/BufferViewer.cpp:998–1361  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

996 }
997
998 QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override
999 {
1000 if(index.isValid())
1001 {
1002 if(role == Qt::SizeHintRole)
1003 {
1004 QStyleOptionViewItem opt = view->viewOptions();
1005 opt.features |= QStyleOptionViewItem::HasDisplay;
1006
1007 // pad these columns to allow for sufficiently wide data
1008 if(index.column() < reservedColumnCount())
1009 opt.text = lit("4294967295");
1010 else
1011 opt.text = data(index).toString();
1012
1013 opt.text.replace(QLatin1Char('\n'), QChar::LineSeparator);
1014
1015 opt.styleObject = NULL;
1016
1017 QStyle *style = opt.widget ? opt.widget->style() : QApplication::style();
1018 return style->sizeFromContents(QStyle::CT_ItemViewItem, &opt, QSize(), opt.widget);
1019 }
1020
1021 uint32_t row = index.row();
1022 int col = index.column();
1023
1024 if(config.pagingOffset > 0)
1025 {
1026 if(row == 0)
1027 {
1028 if(role == Qt::DisplayRole)
1029 return lit("...");
1030 return QVariant();
1031 }
1032 row--;
1033 }
1034
1035 if(role == columnGroupRole)
1036 {
1037 if(col < reservedColumnCount())
1038 return -1 - col;
1039 else
1040 return columnLookup[col - reservedColumnCount()];
1041 }
1042
1043 if((role == Qt::BackgroundRole || role == Qt::ForegroundRole) && col >= reservedColumnCount())
1044 {
1045 if(meshView)
1046 {
1047 int elIdx = columnLookup[col - reservedColumnCount()];
1048 int compIdx = componentForIndex(col);
1049
1050 float lightnessOn = qBound(0.25, view->palette().color(QPalette::Base).lightnessF(), 0.75);
1051 float lightnessOff = lightnessOn > 0.5f ? lightnessOn + 0.2f : lightnessOn - 0.2f;
1052
1053 static float a = 0.55f;
1054 static float b = 0.8f;
1055

Callers

nothing calls this directly

Calls 15

QLatin1CharClass · 0.85
contrastingColorFunction · 0.85
GetVariantsFunction · 0.85
GetVariantMetatypeFunction · 0.85
CalcIndexFunction · 0.85
getCaptureContextFunction · 0.85
RichResourceTextCheckFunction · 0.85
interpretVariantFunction · 0.85
paletteMethod · 0.80
toDoubleMethod · 0.80

Tested by

no test coverage detected