PDA

View Full Version : mapping manager



sreedhar
13th February 2007, 14:01
Hi,
I want to develop an application which is sth. like a mapping manager.
I have two different lists of names and i shall be able to map them some how. One to many mapping is also feasible. (selecting many form the first list and many from the next list or one by one)

I did not see any gui app. like this before.

If there is any idea how it should look like then it would be of great help to me.

Please provide me any links of any other tools which already have it and if any code snippets are there it would be of great help

regards,
sree

chombium
13th February 2007, 14:35
Hi,

Try Using QPair http://doc.trolltech.com/4.2/qpair.html

You can use this class to connect two values of the lists.
Iterate trough the frist list and the second and create another list
of QPairs (from the selected names) that will connect the values.
If you have a gui (lets say two list widgets) you'll just
have to go trough the lists, see whats selected and
create the list.
This way you'll get linear structure which is easy to handle.

Another way using QPairs is to create a list where
the frist element is the name/index of the element of the
first list and second element will be a list of names/indexes
of the elements from the second list that are connected
to that element from the first list.


GREETZ, chombium

wysota
13th February 2007, 15:28
The situation seems perfect for using a relation - either through a relational database or simply having two data structures, one holding a list of "mappings" and the other holding a list of names together with a list of indices from the other data structure. You can then use a QListView or QTreeView (or their convinience class counterparts) to display this relation.

sreedhar
14th February 2007, 13:10
thanks for the reply.

I want to know how the look and feel.
How the mapping widgets should look like.
Two list etc. and the third list with the completed mappings etc. where i can delete mapping and the items are added back to the original lists.

How can i state with multiple selection in the two lists that this should be mapped to the other item in the second list. i.e. i want to support selection of multiple items from the first list and second list and state the pairs among them

regards

wysota
14th February 2007, 18:28
In my opinion you don't really need a third list. You can have two lists - one with "base" items and the other with all related items. Items in the second list may be checked or unchecked depending on whether an item from the first list contains a particular relation or not.

sreedhar
15th February 2007, 14:26
Initially there is no predefined mapping between the lists.

The user can map any element from the first list to any element in the second list.

The user must be able to define the mapping, and be able to delete the mapping he already specified.

If somebody saw such type of gui can you please provide me an idea how it should look like,
code snippets will be helpfull, or any web links might also be helpfull

regards,
sreedhar

wysota
16th February 2007, 13:48
I would do it like in the attached example.