| 275 | |
| 276 | |
| 277 | unsigned int |
| 278 | NodeGeometry:: |
| 279 | portWidth(PortType portType) const |
| 280 | { |
| 281 | unsigned width = 0; |
| 282 | |
| 283 | for (auto i = 0ul; i < _dataModel->nPorts(portType); ++i) |
| 284 | { |
| 285 | QString name = _dataModel->dataType(portType, i).name; |
| 286 | width = std::max(unsigned(_fontMetrics.width(name)), width); |
| 287 | } |
| 288 | |
| 289 | return width; |
| 290 | } |