Ok thanks.
But when i try to include the Q_OBJECT macro i get those errors?
Ok thanks.
But when i try to include the Q_OBJECT macro i get those errors?
do you place Q_OBJECT in private section of your class ?
and remeber that your class should inherit someway from QObject class
There must be an earlier problem - the lines you post don't tell us anything. Also you did not tell us how you create the makefile. If you're using qmake then also show us your pro-File.
Did you also make sure that your class derives from QObject (either directly or indirectly)?
Vycke
I have edited my original post to show the code for my class and for my .pro file. Although i am not that clear yet on the purpose of the .pro file.
Did you rerun qmake after you added Q_OBJECT to your header?
And what's the actual error - as I said the error message you gave us isn't the first one you see and we can't say anything about the real problem.
The pro-file looks fine.
OT: But why did you put the implementation into the header? This isn't a good coding style.
Hi, thnanks for your time.
I put the implementation in the header, becauase when I do not i get an additional error message. Even if it is all in the same file.
undefined reference to `vtable for Window'
Also I am new to eclipse and qt, This might sound dumb but am I not rerunning qmake when i save the source and build all and run? or do i need to do something else.
Thanks
You have to rerun qmake every time you add/remove Q_OBJECT in an header - otherwise qmake can't create the moc calls for the headers and you get a vtable linker error.
How do I rerun qmake and what files do i need to pass.
Or does qmake get invoked by eclipse everytime I do a build project?
I tried this on cmd but I still get the errors.
qmake -makefile -win32 C:/Eclipse/buttonTest/buttonTest.pro
qmake -project -win32 C:/Eclipse/buttonTest/buttonTest.pro
and they both didn't output any errors when i run them. But still errors when i try to build the project.
Sorry my understanding is low.
Last edited by Toshikazu; 28th May 2008 at 04:15.
Bookmarks