Question

What is needed for errorfree compilation when adding a class that is flagged as

Q_OBJECT

? Should one run qmake file ?

New classes are written in .h .cpp files that are already added in .pro .pri files.

My metaphysics questions are

1/ is qmke_all.bat run and rebuild all enough to have Qt dependencies cleared up ? if not, what is procedure ?

2/ why is this procedure needed, what happens?

3/ what are .pro .pri for ? are both of them here for 'mapping' with qt ? should i change anything to them when adding classes but no .h .cpp files ?

I am with VS2010

thanks

Was it helpful?

Solution

If you've added Q_OBJECT to a self-defined class you need to run qmake prior to compilation, otherwise it won't generated the meta code needed for it.

1) Not sure what you mean here, sorry.

2) Or here.

3) The .pro and .pri are essentially directives files for qmake, much the same way Makefiles work for make. There's obvious differences, but you're not far off when you say they're for mapping, they're there to tell qmake how to generate the necessary compilation files. When you're adding new classes if they've not been auto-added then you need to add both the .cpp & .h files.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top