[Qt-interest] using qt's private headers

Roopesh Chander roop at forwardbias.in
Wed Oct 12 14:44:13 CEST 2011


As long as you use only Qt public headers, you are ensured binary
compatibility - your program's executable will work irrespective of the
minor version of Qt4 (4.1 or 4.2, for e.g.) installed in the user's machine.
Private headers can change between Qt versions. If your executable was
compiled with one version of the header, and if Qt (that your executable
dynamically links to) was compiled with another version of the header,
there's a very good chance of your program crashing.

Details on why:
http://zchydem.enume.net/2010/01/19/qt-howto-private-classes-and-d-pointers/

Using private headers should be ok if either of these is true:
- you're linking to Qt statically, or
- you're using dynamic linking, but you ensure that when deployed, the
program will link to the exact same version of Qt that you used to compile
your program

roop.

On Wed, Oct 12, 2011 at 4:07 PM, Graham Labdon <
Graham.Labdon at avalonsciences.com> wrote:

>  Hello List****
>
> I am implementing a class to output the contents of a QTextDocument in a
> custom format.****
>
> I started to look at the code that outputs in odf format and this code
> makes use of the QTextDocumentPrivate class defined in
> Qt\4.7.4\src\gui\text\qtextdocument_p.h****
>
> ** **
>
> My question is – can I follow this lead and use these ‘private’ classes?**
> **
>
> ** **
>
> Thanks****
>
> ** **
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at qt.nokia.com
> http://lists.qt.nokia.com/mailman/listinfo/qt-interest
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20111012/a76bcbcc/attachment.html 


More information about the Qt-interest-old mailing list