Hi,

I ran into a rather strange problem.
I have a custom QGraphics Item, that should just print a Text.
The Paint Function looks like this:
Qt Code:
  1. void text::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
  2. {
  3. QPen temppen=brushes::textpen;
  4. painter->setPen(temppen);
  5. QFont tempfont=fonts::standardfont;
  6. painter->setFont(tempfont);
  7.  
  8. painter->drawText(boundingRect(),Qt::AlignCenter,getUiname());
  9. }
To copy to clipboard, switch view to plain text mode 

But whenever this function is called the Text is shifted upwards, and are cut from the Top Border of the BoundingRect.

If I change the draw method to this:
Qt Code:
  1. painter->drawText(boundingRect(),Qt::AlignCenter,"Test");
To copy to clipboard, switch view to plain text mode 

The text is centered in the Bounding Rectangle as expected.

getUiname() is rather simple, I don't think that the problem is there.
Qt Code:
  1. QString uimodule::getUiname() const
  2. {
  3. return uiname;
  4. }
To copy to clipboard, switch view to plain text mode 

The only thing left to mention is that getUiname is in the Baseclass of my GraphicsItem. But this should make no difference in my opinion.
Is this a bug? Any ideas what I could try to fix it?