[Updated]
When changing a specific source file, at building the project compilation takes approx. 10 minutes. Changes of other source files lead to more or less instant build times. I figured that if I move the most changed parts to a pimpl
class, the compile time is no longer affected.
I do not understand why this is the case. I did not change the header file of the class. The header itself does only #include <QWidget>
and forward declares 10 classes. What reasons could there be that lead to recompilation (in the build directory I see all object files regenerated) when changing a source file that is nowhere directly included? It is strange that the pimpl works then...
Here is the header of the class:
#ifndef EXPLORER_H
#define EXPLORER_H
#include <QWidget>
... here coming 10 forward declared classes ...
class Explorer : public QWidget
{
Q_OBJECT
public:
explicit Explorer(QWidget *parent = 0);
~Explorer();
signals:
...
public slots:
...
private:
ExplorerPrivate *p; // pimpl (QObject)
...pointers to objects of forward declared classes
};
#endif // EXPLORER_H
EDIT
Building with QtCreator 3.2.1
Using Qt5.3 with mingw
As I said the cpp file is nowhere included (searched for it)
qmake.exe project.pro -r -spec win32-g++ "CONFIG+=debug"
- Make: mingw32-make.exe
The compiler console spits out endless repetitions of g++ -c -pipe -fno-keep-inline-dllexport -O2 -std=c++0x -frtti -Wall -Wextra -fexceptions -mthreads [include flags and directories here]
and at the end something like -o objects\moc_runtimedata.o moc\moc_runtimedata.cpp
or similar.