| 90 | } |
| 91 | |
| 92 | QVariant 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 | |
| 128 | int QuickSceneGraphModel::rowCount(const QModelIndex &parent) const |
| 129 | { |