| 63 | } |
| 64 | |
| 65 | void |
| 66 | NodeGraphTextItem::paint(QPainter *painter, |
| 67 | const QStyleOptionGraphicsItem *option, |
| 68 | QWidget *widget) |
| 69 | { |
| 70 | bool isTooSmall = false; |
| 71 | |
| 72 | if (!_alwaysDrawText) { |
| 73 | if ( _graph->isDoingNavigatorRender() ) { |
| 74 | isTooSmall = true; |
| 75 | } else { |
| 76 | QFontMetrics fm( font() ); |
| 77 | QPoint topLeft = _graph->mapFromScene( mapToScene( QPointF(0, 0) ) ); |
| 78 | QPoint btmLeft = _graph->mapFromScene( mapToScene( QPointF( 0, fm.height() ) ) ); |
| 79 | int height = std::abs( btmLeft.y() - topLeft.y() ); |
| 80 | isTooSmall = height < NODEGRAPH_TEXT_ITEM_MIN_HEIGHT_PX; |
| 81 | } |
| 82 | } |
| 83 | if (isTooSmall) { |
| 84 | return; |
| 85 | } |
| 86 | QGraphicsTextItem::paint(painter, option, widget); |
| 87 | } |
| 88 | |
| 89 | NodeGraphSimpleTextItem::NodeGraphSimpleTextItem(NodeGraph* graph, |
| 90 | QGraphicsItem* parent, |
nothing calls this directly
no test coverage detected