Quantcast
Channel: QtWebEngine
Viewing all articles
Browse latest Browse all 13965

ItemIgnoresTransformations and Positioning it on the Scene.

$
0
0
I’m having a bad time trying to center-align ( horizontally and vertically ) a QGraphicsSimpleTextItem that has the ItemIgnoresTransformations flags on.    item = new QGraphicsLineItem(pos, m.y1(), pos, m.y1() + tickSize, this);    item->setPen(pen());    ticks.push_back(item);      label = new QGraphicsSimpleTextItem(textForValue(currValue), this);    label->setBrush(QBrush(textColor));    label->setFlag(ItemIgnoresTransformations);    labels.push_back(label); now, label->setPos ( Xpos – boundingRect().width() / 2, 0) doesn’t works because the boundingRect of the item is not affected by the scene transforms. =/

Viewing all articles
Browse latest Browse all 13965

Latest Images

Trending Articles



Latest Images