01 – Avoid deprecated Qt

Table of Contents

Avoid deprecated Qt


Avoid deprecated Qt


A defining quality of Qt is that it provides long-term API stability within a major release (e.g. Qt 5) which historically translates to roughly 7-8 years. To communicate up-front which APIs (or parts of an API) might be affected by a change in the next major release, deprecation warnings are added to the headers of Qt as a continuous process. Make sure to enable these deprecation warnings to stay up-to-date how your application might be affected by Qt API changes and to ease the transition to new Qt versions over time.





Implementation effort

Very minimal


New projects, new modules within existing projects. As a preparation for a porting effort.


  • Might conflict with -Werror.
  • Doesn't help to catch the usage of deprecated QML modules.

See also

Implementation hints

Variant1: my.pro

QMAKE_CXXFLAGS += -Wdeprecated

Generates one warning for each use of a Qt method marked as deprecated. Very coarse grained. No specific Qt version can be selected.

Variant2: my.pro


Removes everything that has deprecated since Qt 5.2 from the Qt headers (causing the build to fail of deprecated code is used).

Post history - Last 5 commits

17/02/2020 09:24:54 - A number of small improvements for "avoid deprecated Qt" (Frank Meerkötter)

14/02/2020 14:56:59 - remove dangling reference (Frank Meerkötter)

14/02/2020 14:08:33 - Give all tools a number prefix to allow for sorting The number prefix is the same as the card number. (Frank Meerkötter)

Leave a Reply

Your email address will not be published. Required fields are marked *

Share on facebook
Share on twitter
Share on linkedin
Share on reddit
Share on xing
Share on email
Share on stumbleupon
Share on whatsapp
Share on pocket