Results 1 to 2 of 2

Thread: What are the private classes in Qt header files & how they useful ?

  1. #1
    Join Date
    Jun 2015
    Location
    India
    Posts
    185
    Thanks
    8
    Thanked 14 Times in 14 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default 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 ?
    Thanks :-)

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default 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,
    _

  3. The following user says thank you to anda_skoa for this useful post:

    prasad_N (9th April 2016)

Similar Threads

  1. qt's private headers and classes
    By GrahamLabdon in forum Qt Programming
    Replies: 1
    Last Post: 12th October 2011, 14:05
  2. 2 classes header file inclusion probleml !!
    By sujan.dasmahapatra in forum General Programming
    Replies: 4
    Last Post: 15th October 2009, 19:31
  3. [RESOLVED] Help in using private classes
    By kuzulis in forum Qt Programming
    Replies: 8
    Last Post: 27th August 2009, 14:03
  4. private classes in QT
    By talk2amulya in forum Qt Programming
    Replies: 3
    Last Post: 19th February 2009, 17:26
  5. Why does Qt use Private classes?
    By hyling in forum Qt Programming
    Replies: 2
    Last Post: 12th December 2006, 22:11

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.