Qt-interest Archive, January 2007
QGraphicsView scroll to zero by adding a QGraphicsTextItem
Message 1 in thread
Hi,
QGraphicsView is always scrolling to 0,0 when I add a QGraphicsTextItem
on the Scene. It is not the case with QGraphicsSimpleTextItem
Am I doing something wrong or is it a bug?
I am working with Qt4.2.2
Best regards,
Sebastien
--
[ signature omitted ]
Message 2 in thread
On Tue, Jan 23, Sebastien Emonet wrote:
> Hi,
>
> QGraphicsView is always scrolling to 0,0 when I add a QGraphicsTextItem
> on the Scene. It is not the case with QGraphicsSimpleTextItem
>
> Am I doing something wrong or is it a bug?
>
Sounds familiar. IIRC I got around this by setting the position
correctly (default is (0,0)) and then making the text visible.
Grüsse,
Uwe
--
[ signature omitted ]
Message 3 in thread
Sebastien Emonet wrote:
> QGraphicsView is always scrolling to 0,0 when I add a QGraphicsTextItem
> on the Scene. It is not the case with QGraphicsSimpleTextItem
> Am I doing something wrong or is it a bug?
> I am working with Qt4.2.2
It's a known bug that was fixed in 4.3 a while back. If you want to patch up
your 4.2.2, look at a recent 4.3 snapshot, pull up qgraphicsitem.cpp, and
look at the QGraphicsTextItemPrivate::_q_ensureVisible() function.
Andreas
--
[ signature omitted ]