What are the private classes in Qt header files & how they useful ?
Hi,
When I go to Qt header file, I often see some private classes in header files. ex: in QAbstractItemModel we will see QAbstractItemModelPrivate.
What are this private classes actually & what is the use of this classes ?
is this concept specific to Qt or Some design pattern ?
Re: What are the private classes in Qt header files & how they useful ?
That's the PIMPL or D-Pointer idiom
https://en.wikipedia.org/wiki/Opaque_pointer
It is used to maintain binary compatibility over the long time of a Qt major version, i.e. to avoid binary incompatibility issues when classes need new or different data as they evolve.
Cheers,
_