Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Methods disabled by the Q_QDOC macro?



  • Hi.
    I was trying to use the

    QString decode(const QByteArray &ba);
    

    method of QStringDecoder as documented here:
    https://doc-snapshots.qt.io/qt6-dev/qstringdecoder.html#decode-1

    However, that method is currently disabled, since Q_QDOC is apparently
    not defined.

    #if defined(Q_QDOC)
        QString operator()(const QByteArray &ba);
        QString operator()(QByteArrayView ba);
        QString decode(const QByteArray &ba);
        QString decode(QByteArrayView ba);
    #else
    ...
    #endif
    

    What is the purpose of this? Does it mean that those methods will only be available in the next version (6.1?)


  • Lifetime Qt Champion

    Hi,

    No they are not, if you read the else part, you'll see they are implemented there. This ifdef allows the documentation tool to generate the documentation you see therr. The current implementation is more complex due to their templated nature however the end result is what you see in the documentation.


Log in to reply