blog about qt and qxt related stuff

Dienstag, 22. Januar 2008

qxt po module

Hi there,

i know it has been a long time since i wrote my last blog. Sorry for that.
But now i'm back and want to introduce a new module that is currently
more in planning than in an implemented state, but it slowly evolves.
Me and Mark started to work on a module called the PO module. PO means Persistent Objects.
Now some of you will get excited because it seems object persistence is a feature that is really
needed out there. We still need to figure out some basic stuff but i want to show you the current state.

So what does it take to make your objects persistent? Here is the good part: Not much.
The PO module uses the Qt property system to load and save your object dynamically.
So your Objects only need to be derivered from QObject and add a small Macro:

QXT_DECLARE_PERSISTENT(YourObject);

Every Q_PROPERTY in your Object that sets STORED to true is pushed into the Database.
To register a Object with a database you have to create a QxtPOManager:

QxtPOManager manager;
manager.registerPOType < YourFirstObject > ();
manager.registerPOType < YourSecondObject > ();
manager.registerPOType < YourThirdObject > ();

Thats everything. After you did that work your classes are fully useable with the PO module.
The manager will handle load/save/deletetion of your objects.
Well there is still a lot of work to do so don't expect something in the next time. I guess before libqxt 0.3.3 or .0.3.4 there will be nothing useable. But we are working on it and will provide a tarball when there is something to test.
If someone is interested or has expirience with creating peristence frameworks and wants to contribute, post a comment to this blog, write me a mail or join the #qxt channel on irc freenode and just ask.

zbenjamin
"your friendly developer from the neighbourhood"

p.s. the ScheduleView is still in work, but we are currently testing if there is a better way to
implement it.