MCPcopy Create free account
hub / github.com/KDAB/GammaRay / data

Method data

plugins/quickinspector/quickscenegraphmodel.cpp:92–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90}
91
92QVariant QuickSceneGraphModel::data(const QModelIndex &index, int role) const
93{
94 if (!index.isValid())
95 return QVariant();
96
97 QSGNode *node = reinterpret_cast<QSGNode *>(index.internalPointer());
98
99 if (role == Qt::DisplayRole) {
100 if (index.column() == 0) {
101 return Util::addressToString(node);
102 }
103 if (index.column() == 1) {
104 switch (node->type()) {
105 case QSGNode::BasicNodeType:
106 return "Node";
107 case QSGNode::GeometryNodeType:
108 return "Geometry Node";
109 case QSGNode::TransformNodeType:
110 return "Transform Node";
111 case QSGNode::ClipNodeType:
112 return "Clip Node";
113 case QSGNode::OpacityNodeType:
114 return "Opacity Node";
115 case QSGNode::RootNodeType:
116 return "Root Node";
117 case QSGNode::RenderNodeType:
118 return "Render Node";
119 }
120 }
121 } else if (role == ObjectModel::ObjectRole) {
122 return QVariant::fromValue(node);
123 }
124
125 return QVariant();
126}
127
128int QuickSceneGraphModel::rowCount(const QModelIndex &parent) const
129{

Callers 1

setWindowMethod · 0.45

Calls 5

addressToStringFunction · 0.85
columnMethod · 0.80
QVariantClass · 0.50
isValidMethod · 0.45
typeMethod · 0.45

Tested by

no test coverage detected