Message: previous - next
Month: December 2016

Re: [trinity-users] Displaying QMap objects in a dialog

From: Michele Calgaro <michele.calgaro@...>
Date: Tue, 6 Dec 2016 19:33:54 +0900
On 2016/12/06 01:14 PM, Leslie Turriff wrote:
> 	The application I'm writing will have a small group of key-value pairs 
> associated with each object.  Looking through the docs, I see widgets for 
> displaying elementary items (e.g. TQListBox), but nothing for something like 
> a TQMap (e.g. a TQlistBoxMap).  I could use a TQTable, but that strikes me as 
> akin to using a sledgehammer to kill flies.
> 	As a neophite c++ programmer, I know that in theory I can subclass 
> TQListBoxItem to do this, but how to go about that, I haven't a clue.  The 
> docs say merely that ' If you need to insert customized items into a 
> TQListBox you must inherit this class and reimplement paint(), height() and 
> width().'
> 	Any suggestions to help get me started with this would be appreciated.
> Leslie 

If I understand correctly, you want a two-column widget to show key-value from a map.
Easiest things that come to mind are:

1) use TQTable, probably the quickest way
2) use a TQListView with two columns, also quick quick

You can ofcourse do more fancy stuff with subclassing, but I don't really see a need for this here, as long as my
understanding is correct.