[Development] On how to deprecate API

Kai Köhne Kai.Koehne at qt.io
Thu Feb 27 16:46:39 CET 2020


Hi,

After seeing many different ways to deprecate API in Qt 5.15, I thought it might make sense to assemble some best practices (comments & extensions welcome):

  https://codereview.qt-project.org/c/meta/quips/+/292255

One of the main takeaways is: Please also properly deprecate in the documentation (including giving users a hint what to use instead!)

Another thing I'm wondering about is the use of QT_DEPRECATED_SINCE in Qt's .cpp files. I see the benefit of QT_DEPRECATED_SINCE in the headers, because these are compiled into the user code, who in turn can use QT_DISABLE_DEPRECATED_BEFORE. Anyhow, for Qt modules, the define is always hardcoded to QT_DISABLE_DEPRECATED_BEFORE=0x050000 (or 0x040800 for Windows), so is there any point in adding checks in our .cpp files, or is that just cargo cult? Shouldn't we just delete code that we don't want to have in Qt 6 anymore?
 
Regards

Kai


--
Kai Köhne, Director R&D | The Qt Company

The Qt Company GmbH, Erich-Thilo-Straße 10, D-12489 Berlin
Geschäftsführer: Mika Pälsi, Juha Varelius, Mika Harjuaho
Sitz der Gesellschaft: Berlin, Registergericht: Amtsgericht Charlottenburg, HRB 144331 B



More information about the Development mailing list