[Interest] Generic Table's row to 2 columns property/value tree

André Somers andre at familiesomers.nl
Wed Dec 28 09:13:18 CET 2016


Hi,


Op 28/12/2016 om 00:24 schreef Ch'Gans:
> Hi there,
>
> In my application i'm dealing a lot with displaying a list of property
> value based on user's selection, the selection can be made either from
> a table view (a row) or a graphicsview item (both selections are
> synchronised).
> My application is laid out with dock widgets on the left (several
> list/table views, per 'topic' that display a selection of most
> relevant columns from a table model), a graphicsview as a central
> widget where graphical items are highlighted/selected, and another
> dockwidget on the right which is context/selection dependent.
> The left widget can be considered a 'navigation' panel, and the right
> widget a 'object detail'.
>
> I'm looking for a nice and somehow generic solution to transform a row
> of data from a table model (the user's selection) into a list of
> property/value pair (with possibility of nested sub-property a bit
> like Qt designer property browser).
>
> Actually I have tried to use the property browser from Qt Solution in
> the past, but found it a bit complicated as it requires lot of boiler
> plate (I might have fail to use it properly).
>
> Does anyone knows any sort of tricks or pattern to achieve this, or
> maybe have a list of gotcha or do/don't? Or maybe knows a ready made
> component (GPL accepted).
>
> I haven't yet tried to code anything yet, I'm still in the 'thinking
> about' phase (i definitely need a re-usable component). I might even
> give another go at the Property Browser Qt solution.
> Any kind of comment, hint, tip would be much appreciated.
>
Many years ago I wrote a similar application, that used an extended 
version of an open source solution I found online. It is still online, 
you can find it here:
https://app.assembla.com/spaces/saint/git/source/master/common/propertyeditor

Note that it does not support nested properties, but it may serve as a 
nice start. The basic idea is that it generates an item in the editor 
for every Qt property in the object you set on it. You can use some 
specially formatted dynamic properties to set some meta data that 
influences what ends up in the editor and in what way.

André





More information about the Interest mailing list