Using custom widgets "using promoting approach" is no different than using them directly in hand-written C++ code. You always need to add the header and implementation file (provided they exist) to the project.
Using custom widgets "using promoting approach" is no different than using them directly in hand-written C++ code. You always need to add the header and implementation file (provided they exist) to the project.
Notice the words "when compiling the project". That is to say, the paths are sent to the C++ compiler as -I options or their equivalent. There a literally hundreds of include files involved in compiling your project, many (most) of which have nothing directly relating them to Qt. Qt does not assume that every possible include file is part of your project and does not scan every one of these files for the Q_OBJECT or other markers that trigger Qt code generation. Qmake uses the HEADERS variable to identify files that are part of your project and should be scanned for pre-processing triggers and, when found, generate and compile extra C++ source on your behalf.
In your case the C++ compiler is finding everything it needs to compile the project. The linker fails because code that is generated on your behalf has not been generated and included in the compilation, i.e. HEADERS is wrong.
tonnot (29th October 2010)
I understand your explanation.
At end, Is there any way to say QT that must investigate for Q_Object and other markes ?
Thanks
Bookmarks