A strange class definition at h and cpp

I have found at QT files then next 'way' of declare a class :
Anybody can help me to understand it ?

At file.h :
class QLCDNumberPrivate;

At file cpp
class QLCDNumberPrivate : public QFramePrivate
{
Q_DECLARE_PUBLIC(QLCDNumber)

////////////////////////////////////////// at global.h
#define Q_DECLARE_PRIVATE(Class) \
inline Class##Private* d_func() { return reinterpret_cast<Class##Private *>(qGetPtrHelper(d_ptr)); } \
inline const Class##Private* d_func() const { return reinterpret_cast<const Class##Private *>(qGetPtrHelper(d_ptr)); } \
friend class Class##Private;

#define Q_DECLARE_PRIVATE_D(Dptr, Class) \
inline Class##Private* d_func() { return reinterpret_cast<Class##Private *>(Dptr); } \
inline const Class##Private* d_func() const { return reinterpret_cast<const Class##Private *>(Dptr); } \
friend class Class##Private;

#define Q_DECLARE_PUBLIC(Class) \
inline Class* q_func() { return static_cast<Class *>(q_ptr); } \
inline const Class* q_func() const { return static_cast<const Class *>(q_ptr); } \
friend class Class;
That's what QT does. Lots of macros.
The result is
1
2
3
4
5
6
class QLCDNumberPrivate : public QFramePrivate
{
    inline QLCDNumber* q_func() { return static_cast<QLCDNumber*>(q_ptr); } \
    inline const QLCDNumber* q_func() const { return static_cast<const QLCDNumber*>(q_ptr); } \
    friend class QLCDNumber;
}

I have no idea what q_ptr is though.
Topic archived. No new replies allowed.