Important: Please read the Qt Code of Conduct -


  • Hi
    I am using a QStringList and wanted to use the documented
    indexOf(const QString &str, int from = 0)
    My compiler did not like this because Q_NO_USING_KEYWORD is not defined.
    I can overcome this by adding the appropriate define in the .pro file -

    However, I do not fully understand the use of Q_NO_USING_KEYWORD and so am not sure if this has any other repercussions?

    I would therefore be grateful if someone could explain the use of Q_NO_USING_KEYWORD

    Thanks in advance

  • Which OS and compiler are you using?
    What is the Qt version?

  • Hi
    I am using Qt 4.7.4 with gcc

  • I can use QStringList's indexOf() without problem - could you give us some code where+how you use QStringList indexOf() ?

  • Q_NO_USING_KEYWORD controls the use of the C++ "using" keyword for compilers that do not support, or incorrectly support, it. In this particular instance it affects the implementation, but not the availability, of indexOf() and lastIndexof() in QStringList. Q_NO_USING_KEYWORD is set for some truly ancient versions of GCC only. What GCC version are you running (gcc -v)?

    Exactly what errors or warnings do you get?

    See "src/corelib/global/qglobal.h" and "src/corelib/tools/qstringlist.h"

Log in to reply