So basically, I'm writing a Qt app. It used to work fine, but ever since I reconfigured some of the file names (specifically, a long time ago, I had files called mainwindow.h and .cpp. I renamed them net.h and .cpp, respectively, and recently changed back to mainwindow.h and .cpp), it fails with several errors (at runtime):
Object::connect: No such slot QWidget::slotName()
Object::disconnect: No such signal QWidget::iconSizeChanged(QSize)
Object::disconnect: No such signal QWidget::toolButtonStyleChanged(Qt::ToolButtonStyle)
Object::connect: No such signal QWidget::iconSizeChanged(QSize)
Object::connect: No such signal QWidget::toolButtonStyleChanged(Qt::ToolButtonStyle)
The only slot I have registered within my class is the first one, slotName. I'm not sure why it's being listed as a member of QWidget instead of my class (which subclasses QWidget). I know I have it declared right, because I found it inside the moc_mainwindow.cpp file. And yes, I have Q_OBJECT in my class definition.
Another error also occurs, once per second while running:
QWidget::metric: Invalid metric command
QPainter::begin: Paint device returned engine == 0, type: 143256176
Like I said, all of this used to work perfectly, which is why I'm not going to post huge walls of code unless asked. I'm thinking it's more of a cache issue with QMake. I've tried deleting all the moc files, deleting the project file, emptying the project file and generating a new, empty Makefile, etc. Anyone have any ideas?
You should not develop code without version control, period. Leverage your version control system to clean up your working copy, or check out to a new location and recompile there. Then you won't be blaming who knows what.
In absence of version control, copy your project manually, file-by-file, to a new location, commit that to a new version control repository of your choice (a local one!) and compile there.
Note that Qt Creator has been defaulting to shadow builds -- i.e. builds that are not within your source folders. Wiping a shadow build is trivial: go one directory up above your source folder, and look for a folder with long name, starting with the name of your project. Wipe that and you're guaranteed that there is no "caches" of any sort.
Also note that QMake has no caches at all. It re-reads all files given in its input (.pro and its includes) and recreates all the Makefiles from scratch. You can run qmake && make clean
to clean up, but this won't take care of files from a differently configured project. Alas, such files should not interfere anyway.