PDA

View Full Version : overloading zoom() function and privateData usage



jmsbc
29th July 2010, 19:04
Hi,

I am trying to inherit QwtPlotZoomer and overload the zoom() function. I want to make a small modification to the function, but I don't have access to PrivateData* d_data. How can I properly overload this function?

And then this leads to my next question, what is the purpose of PrivateData? What's the difference between doing like this vs placing those variables (public member variables from class PrivateData) directly into QwtPlotZoomer's private data?

Thanks

Uwe
30th July 2010, 07:50
I am trying to inherit QwtPlotZoomer and overload the zoom() function. I want to make a small modification to the function, but I don't have access to PrivateData* d_data.
That's the idea of "private".


And then this leads to my next question, what is the purpose of PrivateData? What's the difference between doing like this vs placing those variables (public member variables from class PrivateData) directly into QwtPlotZoomer's private data?
All declarations in the private sector are seen by the compiler when compiling application code, those in the PrivateData class not.

For libraries its important to hide as much as possible from the external API to be able to do changes/bugfixes without breaking binary compatibility. When writing an application its less important, but also used often to avoid dependencies or speed up compilation.

Uwe