Login procedures have been improved. Check this page for details.

Binary Compatibility Workarounds

From QtProject
Revision as of 15:39, 23 January 2012 by Ogoffart (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This page describes some workarounds for keeping binary compatibility in patch releases.

You should read the KDE reference: http://techbase.kde.org/Policies/Binary_Compatibility_Issues_With_C++

I need to add a private slot

Use a Q_PRIVATE_SLOT:

    class A: public QObject
    {
        Q_OBJECT
        ...
    private:
        Q_PRIVATE_SLOT(d_func(), void myPrivateSlot())
    };
 
    /* in .cpp file */
 
    void APrivate::myPrivateSlot() {...}
 
    #include "moc_a.cpp"

Pitfalls to avoid:

  • Don't include `a.moc`, but `moc_a.cpp` in your .cpp file
  • Q_PRIVATE_SLOT takes the complete signature of the private slot, not just its name
Personal tools
license
Attribution-ShareAlike 2.5 Unported