I had this problem with a "private class". Qt uses this model despite its code. I really liked it.
Basically, you have a privately declared class in the class definition of a public header file with a pointer to an instance of it as a member of the public class data. (Note. It may become easier for you to declare it as a friend class.)
Then create a private version of your class in the cpp file for the public. DO NOT create a header file for this private class. Do all the dirty work with this class. This hides the entire implementation of your public class, including other private members.
Without explaining what follows, here is an item related to this topic. To get Q_OBJECT working, I needed to add this to cpp:
#include "MyPublicClass.moc"
The cpp layout is as follows:
- Private class defined
- Mock for open class # included.
- An implementation of an open class is defined.
BuvinJ Mar 06 '14 at 22:37 2014-03-06 22:37
source share