[Qt-interest] I give up with qgraphicsscene and qgraphicsview with stationary items
Jan Ekholm
jan.ekholm at smultron.net
Tue Mar 23 12:02:52 CET 2010
On Tuesday 23 March 2010, Kari Laine wrote:
> What I have been trying is to have fixed texts, lines and polylines in
> relation to view. So that user scrolls scene those items stay put in
> relation to view.
> I was able to get stationary lines with drawForeground. But those are
> QPainterPaths which are not moveable and you can not select them.
> Is it so?
I had the same problem for a game view where there's a big scrolling map in
the background and "HUD like" information elements in the foreground. I solved
it by implementing own scrolling, ie. I don't use the scrollbars of the view
at all, but instead handle scrolling through "flicking" the map. Scrollbars
like that don't look ok in a game anyway, so it was no loss at all. The
flicking then just moves a single item which contains the game board/map. This
means that all other items that are toplevel (not children of the map) stay
put.
--
Jan Ekholm
jan.ekholm at smultron.net
More information about the Qt-interest-old
mailing list