[Interest] QML & QDeclarativeView

Bo Thorsen bo at fioniasoftware.dk
Fri May 4 09:07:42 CEST 2012


Hi Jeremy,

Den 04-05-2012 07:07, Jeremy skrev:
> Suppose you have a custom built UI, with forms and c++ and such. Within
> certain panes/tabs/etc of this custom view, you want to display qml
> driven content. Is it possible for the same QML data to drive the output
> in multiple QDeclarativeView ?
>
> For example:
> I'm writing a combination tile map editor and scenario setup for
> tabletop rpg games, sort of a virtual table sort of application. Here's
> the preliminary thoughts on how I am wanting to set it up.
>
>   * Application as a subclassed QDeclarativeView representing the
>     scenario map. I subclass so that I may draw the map, grids, etc in a
>     custom fashion.
>   * All the players/monsters/items/props/etc I would like to be provided
>     as QML objects, for customization of behavior and such based on what
>     is applicable for the game rules, etc.
>   * To narrow in one one example. Suppose QML defines a character for a
>     D&D character, complete with stats, skills, etc. This object
>     contains all this information.
>   * There is a list box, table view, or whatever in another pane of the
>     application that shows the list of players, and I would like to be
>     able to click on them and bring up their character sheet.
>   * I want this character sheet also to be created and managed by QML,
>     presumably as part of the character QML object, since that's where
>     all the data is.
>
> How can the QML data/state be shared among different views like this? I
> would prefer not to have to have all the data driven elements
> instantiated inside the main map view if I don't have to. It would be
> far more flexible for example to have each character sheet rendered via
> different QML views on separate tab pages for example, for quick and
> easy access.

The best way to do this is to have the state in C++ objects and export 
those to the QML app.

Short answer to a long question, I know :) If you need help with parts 
of this, just write another email.

Bo Thorsen,
Fionia Software.

-- 

Expert Qt and C++ developer for hire
Contact me if you need expert Qt help
http://www.fioniasoftware.dk



More information about the Interest mailing list