PDA

View Full Version : Is there any support in Qt for association management?



andre
29th October 2009, 17:18
I want to say hello to this nice forum with my first question:

As I understood, Qt provides support for handling of parent-child associations between QObjects. So far so good.

I am looking for something that supports dealing with more general or loose associations between objects. Something like

A [1] <------> B

where A has a method A::getBs() and B has a method B::getA(). Furthermore, the container returned by A::getBs() should be capable of dealing with insertions or deletions also on the other end, which means that if I attach a b:B with an a:A by doing a.getBs().add(b) then b.getA() should return a.

If there is no support for such things in Qt I will implement on my own (in my code generator). But before I dive into that I wanted to ask the community if something is already available that could fit my need or come close to it.

thanks!

high_flyer
29th October 2009, 17:37
Qt is a C++ framework, that offers implementations to many "low level" programming, allowing you to focus more on what it is you want to do, and not invent the wheel again.(very simply put)

To your question:
You can implement what you asked with Qt, but just as good with out it.
Qt will probably make some of the things easier to code, but it is still C++ , and you still have to implement what ever it is you want to implement.

andre
29th October 2009, 17:50
I'm very happy implementing it myself. But I just want to be sure given my newbee status on Qt (after a 10 years Java break) that I do not reinvent any existing wheel. So I conclude that I will need to implement that kind of bidirectional association management myself. Fine... ;)

high_flyer
29th October 2009, 17:52
Your first post is very general.
If you'll be more specific, we can point you to classes that can probably save you some work.