Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Q_NO_USING_KEYWORD
Forum Updated to NodeBB v4.3 + New Features

Q_NO_USING_KEYWORD

Scheduled Pinned Locked Moved General and Desktop
5 Posts 4 Posters 2.4k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    GrahamL
    wrote on last edited by
    #1

    Hi
    I am using a QStringList and wanted to use the documented
    @
    indexOf(const QString &str, int from = 0)
    @
    method.
    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 -
    @
    DEFINES += Q_NO_USING_KEYWORD
    @

    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

    1 Reply Last reply
    0
    • K Offline
      K Offline
      koahnig
      wrote on last edited by
      #2

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

      Vote the answer(s) that helped you to solve your issue(s)

      1 Reply Last reply
      0
      • G Offline
        G Offline
        GrahamL
        wrote on last edited by
        #3

        Hi
        I am using Qt 4.7.4 with gcc

        1 Reply Last reply
        0
        • V Offline
          V Offline
          viktor.benei
          wrote on last edited by
          #4

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

          1 Reply Last reply
          0
          • C Offline
            C Offline
            ChrisW67
            wrote on last edited by
            #5

            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"

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved