PDA

View Full Version : choosing proper QWidget for drop site



ckw089
27th November 2010, 12:08
Hi,

I am new in Qt programming. I would like to create an application that is similar to those applications used to draw UML diagram, but my application is not really drawing UML diagram.

My application is to enable user to drag and drop different "nodes", and use lines to connect all these "nodes" to form a tree kind of structure. For each tree, there will be a root node, form root the tree will branch out, at the bottom will be all the leave nodes.

I know Qt supports drag and drop. And I probably can use QListView to display all the possible "nodes" for user to select from. I just not sure which QWidget is suitable for the drop site, where user is free to move and locate the nodes, and then connect them together with lines to build a tree.

rgds,

kc Wong

franz
27th November 2010, 19:15
QGraphicsView with QGraphicsScene would be the best guess there. Those are designed for particularly this purpose: showing graphical objects and being able to translate/rotate them without too much mucking about.

ckw089
28th November 2010, 01:16
Thanks Franz.

At least I know where to start now.

franz
28th November 2010, 19:29
I see you got the same advice at Qt DevNet :).

ckw089
29th November 2010, 00:50
Ya, I wasn't sure which forum to post this question.

Thus, I just did a google search and register myself to 4 different forums, hopefully I will get the answer.

But, thanks a lot for replying. At least I know this is still an active forum.