QGraphicsView

All and any discussion and development of the Mudlet Mapper.
Post Reply
User avatar
chris
Posts: 493
Joined: Fri Jun 17, 2011 5:39 am

QGraphicsView

Post by chris »

I came across QGraphicsView today while looking at some QT documentation. Is there a reason our mapper isn't using this layout? It seems like it would allow for a lot of functionality for very little work.

User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: QGraphicsView

Post by Vadi »

Heiko would have to answer that, I'm not certain.

User avatar
chris
Posts: 493
Joined: Fri Jun 17, 2011 5:39 am

Re: QGraphicsView

Post by chris »

I gave it a try and the rendering is slower than what we have going now, which is sort of expected since we call QPixmap which ties into the hardware.

User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: QGraphicsView

Post by Vadi »

CPU you mean?

GPU is hardware too, but it's brilliant for graphics.

User avatar
chris
Posts: 493
Joined: Fri Jun 17, 2011 5:39 am

Re: QGraphicsView

Post by chris »

I'm going to pursue this avenue for a bit, the performance on real maps when the code is unoptimized is indistinguishable from the current mapper. It also lets me treat each entity on the map as an object easily, set Z levels to automagically handle draw orders, etc. I can also subclass the graphic items, so I can subclass a Room, a Line, or a label, and within that subclass define the behavior/submenus from right/left clicking.

Anyone who wants to follow the progress can grab it from the GraphicsView branch on my git repo.

User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: QGraphicsView

Post by Vadi »

What is the latest news in this dept, if any?

User avatar
chris
Posts: 493
Joined: Fri Jun 17, 2011 5:39 am

Re: QGraphicsView

Post by chris »

It's on the backburner. Once you start adding in labels/rooms/exits the map slows down considerably when it gets to big enough sizes. I think it's better to make the current mapper use some of the QGraphicsView-like implementations (such as having rooms/lines/etc be a class).

User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: QGraphicsView

Post by Vadi »

Hm, yeah. I did try it out on a giant one-area-world map and it was way, way slow.

Post Reply