-
Odd Syntax
I haven't coded C++ in around five years so is it some sort of new syntax convention when you do this in your header files, or is it a QT thing?
/// somefile.h
#include <QLibrary>
class Classname;
class SomeOtherClassname;
class YourClass {
private:
// etc
public:
//etc
};
The bold underlined part is the one that's new to me.
-
Re: Odd Syntax
These are forward declarations.
You tell the compiler that those types are classes.
This is enough to use the type in declarations, define pointers or references to the type.
(It is not enough to derive from the type, or use it in another manner that requires knowledge about its size, its methods or any other things that are defined by a class definition.)
Reason: you do not have to include the header where that class is defined.
Thus you avoid a dependency and get quicker compile times.
HTH
-
Re: Odd Syntax
That's a forward declaration - its not just a Qt thing.