[Development] QProperty and library coding guide

Thiago Macieira thiago.macieira at intel.com
Thu Jul 23 23:16:42 CEST 2020


On Thursday, 23 July 2020 13:50:26 PDT Bernhard Lindner wrote:
> I thought of something like a simple, manually maintained ABI version. Sure,
> on the one hand this wouldn't prevent uninentional BC breaks. On the other
> hand, BC changes could be done intentionally and managed in a safe way
> (without strange crashes).

We already have several.

See qhooks.cpp's qtHookData[6]:

    // TypeInformationVersion, an integral value, bumped whenever private
    // object sizes or member offsets that are used in Qt Creator's
    // data structure "pretty printing" change.
    //
    // The required sizes and offsets are tested in tests/auto/other/
toolsupport.
    // When this fails and the change was intentional, adjust the test and
    // adjust this value here.

See QObjectPrivate::checkForIncompatibleLibraryVersion(int version).

See the ELF versioning trick, which will permit loading Qt 5 and Qt 6 
(unnamespaced!) in the same process on ELF systems.

See the ability to configure Qt in a namespace and to insert an infix in the 
library name. I've been using the latter for 7 years:

$ ls -1 lib/libQt5Core*
lib/libQt5Core.la
lib/libQt5Core.t.prl
lib/libQt5Core.t.so
lib/libQt5Core.t.so.5
lib/libQt5Core.t.so.5.15
lib/libQt5Core.t.so.5.15.0

That way my builds of Qt don't interfere with the Qt-based applications I have 
in my desktop. It's highly annoying to fix a broken Qt when your desktop is 
broken.

I don't think we need more. Want to make BIC builds? Suit yourself. Here's the 
gun, the ammo and there's your foot.

At best, we could adjust: add the library infix to the ELF version and default 
to an infix for any non-standard build.

symbol _ZN7QObjectC1EPS_@@Qt6.qreal_float.nonouniqueaddress 
in library libQt6Core.qrealfloat.nonouniqueaddress.so.6
-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel DPG Cloud Engineering





More information about the Development mailing list