If so, it seems as though these files are not updating or rebuilding when I compile?
|
Are you using qmake ? It is this program that does all the moc stuff automatically (provided you have the
Q_OBJECT
in your file.
If I were to add some code (not to the generated files, my files) and recompile, would these files be different? |
Yes. The way I understand it from the web page in my last post, the moc takes care of the slots & signals, so if you add a function to implement a new slot, then this info will be included by the moc. Provided you don't make a silly mistake like I did, then this should work.
Qt reference:
The Meta-Object Compiler, moc, is the program that handles Qt's C++ extensions.
The moc tool reads a C++ header file. If it finds one or more class declarations that contain the Q_OBJECT macro, it produces a C++ source file containing the meta-object code for those classes. Among other things, meta-object code is required for the signals and slots mechanism, the run-time type information, and the dynamic property system.
The C++ source file generated by moc must be compiled and linked with the implementation of the class.
If you use qmake to create your makefiles, build rules will be included that call the moc when required, so you will not need to use the moc directly. |
It works SOME of the time, thats the most annoying bit! |
Another thought, have you tried doing a 'clean' followed by 'configure' then 'rebuild' ?
If you are keen on using Qt, consider downloading the Qt SDK, which is free, works on all the OS's and has the Qt Creator IDE, which is not surprisingly specifically for Qt.
It's not impossible to use other IDE's for Qt (I used KDevelop, a Linux IDE, with Qt for awhile), but it might be easier to use something that is designed for it.