MCPcopy Create free account
hub / github.com/XRay3D/GERBER_X3 / data

Method data

file_plugins/gerber/compnode.cpp:121–153  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

119}
120
121QVariant ComponentsNode::data(const QModelIndex& index, int role) const
122{
123 if (!name.isEmpty()) {
124 if (role == Qt::DisplayRole && index.column() == 0)
125 return name;
126 return {};
127 }
128
129 static const QStringList mountType(GbrObj::tr("TH|SMD|BGA|Other").split('|'));
130 if (role == Qt::DisplayRole) {
131 switch (index.column()) {
132 case 0: /* <field> Manufacturer. */
133 return component.refdes();
134 case 1: /* <field> Manufacturer part number. */
135 return component.manufacturer().partNumber;
136 case 2: /* <field> E.g. 220nF. */
137 return component.value();
138 case 3: /* (TH|SMD|BGA|Other) Mount type. */
139 return mountType.value(component.mount());
140 case 4: /* <field> Footprint name. It is strongly recommended to comply with the IPC-7351 footprint names and pin numbering for all standard components. */
141 return component.footprintName();
142 case 5: /* <field> Package name. It is strongly recommended to comply with the JEDEC JEP95 standard. */
143 return component.package().name;
144 case 6: /* <field> Package description. */
145 return component.package().description;
146 case 7: /* <decimal> Height, in the unit of the file. */
147 return component.height();
148 default:
149 return {};
150 }
151 }
152 return {};
153}
154
155int ComponentsNode::childCount() const { return childItems.count(); }
156}

Callers 2

rowMethod · 0.45
childMethod · 0.45

Calls 7

isEmptyMethod · 0.80
manufacturerMethod · 0.80
mountMethod · 0.80
footprintNameMethod · 0.80
packageMethod · 0.80
valueMethod · 0.45
heightMethod · 0.45

Tested by

no test coverage detected