| 354 | |
| 355 | |
| 356 | NodeDataType |
| 357 | Connection:: |
| 358 | dataType(PortType portType) const |
| 359 | { |
| 360 | if (_inNode && _outNode) |
| 361 | { |
| 362 | auto const & model = (portType == PortType::In) ? |
| 363 | _inNode->nodeDataModel() : |
| 364 | _outNode->nodeDataModel(); |
| 365 | PortIndex index = (portType == PortType::In) ? |
| 366 | _inPortIndex : |
| 367 | _outPortIndex; |
| 368 | |
| 369 | return model->dataType(portType, index); |
| 370 | } |
| 371 | else |
| 372 | { |
| 373 | Node* validNode; |
| 374 | PortIndex index = INVALID; |
| 375 | |
| 376 | if ((validNode = _inNode)) |
| 377 | { |
| 378 | index = _inPortIndex; |
| 379 | portType = PortType::In; |
| 380 | } |
| 381 | else if ((validNode = _outNode)) |
| 382 | { |
| 383 | index = _outPortIndex; |
| 384 | portType = PortType::Out; |
| 385 | } |
| 386 | |
| 387 | if (validNode) |
| 388 | { |
| 389 | auto const &model = validNode->nodeDataModel(); |
| 390 | |
| 391 | return model->dataType(portType, index); |
| 392 | } |
| 393 | } |
| 394 | |
| 395 | Q_UNREACHABLE(); |
| 396 | } |
| 397 | |
| 398 | |
| 399 | void |