MCPcopy Create free account
hub / github.com/IENT/YUView / data

Method data

YUViewLib/src/parser/common/PacketItemModel.cpp:86–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84}
85
86QVariant PacketItemModel::data(const QModelIndex &index, int role) const
87{
88 if (!index.isValid())
89 return {};
90
91 auto item = static_cast<TreeItem *>(index.internalPointer());
92 if (role == Qt::ForegroundRole)
93 {
94 if (item->isError())
95 return QVariant(QBrush(QColor(255, 0, 0)));
96 return QVariant(QBrush());
97 }
98 if (role == Qt::BackgroundRole)
99 {
100 if (!useColorCoding)
101 return QVariant(QBrush());
102 const int idx = item->getStreamIndex();
103 if (idx >= 0)
104 return QVariant(
105 QBrush(functionsGui::toQColor(streamIndexColors.at(idx % streamIndexColors.size()))));
106 return QVariant(QBrush());
107 }
108 else if (role == Qt::DisplayRole || role == Qt::ToolTipRole)
109 {
110 if (index.column() == 0)
111 return QVariant(QString::fromStdString(item->getName(!showVideoOnly)));
112 else
113 return QVariant(QString::fromStdString(item->getData(index.column())));
114 }
115 return QVariant();
116}
117
118QModelIndex PacketItemModel::index(int row, int column, const QModelIndex &parent) const
119{

Callers 15

getPacketItemModelMethod · 0.45
getBitratePlotModelMethod · 0.45
ParserMethod · 0.45
getHRDPlotModelMethod · 0.45
parseExtradata_hevcMethod · 0.45
copyImgToByteArrayMethod · 0.45
copyImgToByteArrayMethod · 0.45
copyCurImageToBufferMethod · 0.45
pushDataMethod · 0.45
copyImgToByteArrayMethod · 0.45
copyImgToByteArrayMethod · 0.45
pushDataMethod · 0.45

Calls 7

isErrorMethod · 0.80
isValidMethod · 0.45
getStreamIndexMethod · 0.45
atMethod · 0.45
sizeMethod · 0.45
getNameMethod · 0.45
getDataMethod · 0.45

Tested by 2

testConversionToRGBAFunction · 0.36