PDA

View Full Version : Custom Qt "modules" from within a main QApplication



alitoh
26th July 2012, 19:41
I made two games with Qt, a Tetris and a Snake.

I want to be able to make a QApplication that will read a certain XML file which, in it, will describe which games I have "installed", and the paths to them, and then based on that, will generate buttons for each module (as if it were a Menu).

The thing is, I don't want to use my two games (tetris and snake) as independent, runnable QApplications. I want to use them as modules for this main application (as if they were addins).

I want the application to be flexible, that way if tomorrow I make a new game (dunno, Pac-man, for example), I just need to build it as a module for my QApp and then send the extension to whoever it is I want to have it (with the new config.xml, of course).

Is there any "easy" way to do this?

How would you proceed about the design of the "modules". I already have a Main QApplication that reads and XML file and generates QPushButtons based on what the XML says, but now I need to be able to connect those buttons to execution commands that will trigger the modules.

Is this possible/reasonable?

My main objective is to make an app that if, say, I create a new game, doens't require me to distribute a big binary file, instead I only need to distribute the new module. Same thing for updating old ones, I only need to redistribute the updated module (which will, in turn, be a smaller distribution).

amleto
27th July 2012, 00:09
qt plugins?

plugins-howto

alitoh
27th July 2012, 14:00
I *think* this is totally it. The Low Level API, to be precise.

I still need to see how to make it suit my particular needs, but I think I am in the right track now.

Thanks!