[Qt-interest] I give up with qgraphicsscene and qgraphicsview with stationary items

william.crocker at analog.com william.crocker at analog.com
Tue Mar 23 12:29:55 CET 2010



Jan Ekholm wrote:
> 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?
>


Place your stationary items on a transparent overlay widget
(assuming they are always to appear on top of the other items.)

Bill


> 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.
> 



More information about the Qt-interest-old mailing list