[Interest] List of QT_... defines?

Sze Howe Koh szehowe.koh at gmail.com
Sat Nov 1 02:47:02 CET 2014


On 1 November 2014 05:04, Thiago Macieira <thiago.macieira at intel.com> wrote:
>
> On Thursday 30 October 2014 10:35:42 Rainer Wiesenfarth wrote:
> > We just came along the question if there is a per-version list of QT_...
> > defines that could be used when building applications based on Qt.
> >
> > I know that in 5.3.2 there is QT_NO_CAST_FROM_ASCII, mentioned in the
> > QString docs, I saw QT_DISABLE_DEPRECATED_BEFORE on the <QtGlobal> page and
> > I know about some others. However, some defines used in earlier versions
> > (our software reaches back to the time of Qt 2.x) like QT_THREAD_SUPPORT are
> > no longer used.
> >
> > Is there any central place for "all defines supported by this version of
> > Qt"?
>
> No, sorry.
>
> Some of those macros are documented, so you can rely on them.
>
> You can grep the Qt headers to see what else is there, but note that there are
> plenty that are private and you should never use. In fact, the rule is that
> QT_xxx is private and Q_xxx is public, but obviously we failed to follow our
> own rule with those two macros you mentioned, even as recently as Qt 5.0.

The biggest list of macros is at [1]. This shows all the global
macros, but not module-specific or class-specific macros. There are 10
public QT_xxx macros listed here.

Also see [2] which lists every public function and macro in Qt.
Anything in ALL CAPS is a macro. However, things like "qDebug",
"qMove", and "QStringLiteral" are also macros.

To search for macros with contextual information attached to the
results, type this into Google: "site:qt-project.org/doc/qt-5/
macros".


Regards,
Sze Howe

[1] http://qt-project.org/doc/qt-5/qtglobal.html#macros
[2] http://qt-project.org/doc/qt-5/functions.html



More information about the Interest mailing list