In Qt Source files, there are two versions of header files, such as:
qxmlstream.h
qxmlstream_p.h
Why are there _p.h files?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
They’re generally private header files, used so that components of a subsystems know about everything but users don’t need to.
In other words, something that multiple C source files in Qt might want to know about would be in the private header files if the users of Qt didn’t need to know about them.
One example might be a customised memory allocator for your subsystem. Perhaps you know that every memory allocation you make is 128 bytes then you can provide such an allocator:
Since this is likely to be of dubious value to users of your subsystem, there’s no point publishing it as part of the official API but every single one of your own source files needs the prototype so you’d put it in the private header file.
Then your own code uses:
while users of your API use: