[Qt-interest] GraphicsView standard practices?

Ryan McDougall sempuki1 at gmail.com
Sun Jan 17 15:45:42 CET 2010


On Sun, Jan 17, 2010 at 11:09 AM, Thomas Fjellstrom <tfjellstrom at shaw.ca> wrote:
> I've been working on a game, and the client happens to use the GraphicsView
> pretty heavily (and will use it for pretty much ALL of the ui in a future
> version), and so far its lead to a bit of a mess on my part.
>
> Basically is structured like so:
>
> MainWindow (QMainWindow)
>  - handles a lot of core logic, talks to the game server
>   through a special "Client" object
>  - contains a list of connected users as a dock window
>  - contains a tab widget containing an irc like chat interface
>
> MainWidget (QGraphicsView)
>  - contains the game board (GameBoard, clever eh?)
>  - contains a couple themed AnimatedDialog's (QGraphicsWidgets)
>   - LoginDialog, RegisterDialog (more to come later)
>
> GameBoard (QGraphicsWidget)
>  - contains a number of GameBoardSquare's (QGraphicsWidgets)
>
> The real problem is that a lot of the game logic is split between MainWindow
> (as it has access to the Client, which handles the actual network protocol,
> and the connection to the server), and the GameBoard (because its the board,
> and knows its own state).
>
> Right now there's a lot of signals and method calls flying through
> MainWidget so MainWindow and GameBoard can talk to each other.
>
> What would be the best way to organize something like this?
>

I'm not sure I can answer you question, but in case it's interesting
to you, we are making a 3D game (-like world viewer and server) with
the UI entirely made with QGraphicsView.

Here's a screenie:
http://tols17.oulu.fi/~jnauha/Ohjelmointi/realxtend/Naali-All-Widgets.png

Contact me if you're interested in this at all.

Cheers,
www.realxtend.org




More information about the Qt-interest-old mailing list