Results 1 to 2 of 2

Thread: overloading zoom() function and privateData usage

  1. #1
    Join Date
    Apr 2008
    Posts
    53
    Thanks
    10

    Default overloading zoom() function and privateData usage

    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

  2. #2
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,316
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: overloading zoom() function and privateData usage

    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

Similar Threads

  1. function returns QString, usage generates segfault
    By space_otter in forum General Programming
    Replies: 5
    Last Post: 8th March 2010, 15:54
  2. QWTPlot Zoom: cannot zoom negative value
    By jwieland in forum Qwt
    Replies: 0
    Last Post: 8th January 2010, 16:16
  3. Replies: 1
    Last Post: 16th November 2009, 05:25
  4. QGLWidget with text - zoom in / zoom out
    By h123 in forum Qt Programming
    Replies: 1
    Last Post: 16th November 2008, 09:56
  5. overloading ++ --
    By mickey in forum General Programming
    Replies: 13
    Last Post: 4th January 2008, 18:55

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.