Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. QtCreator 2.1.0 final Nested QMap coloring error

QtCreator 2.1.0 final Nested QMap coloring error

Scheduled Pinned Locked Moved Qt Creator and other tools
10 Posts 5 Posters 4.9k 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.
  • R Offline
    R Offline
    raulgd
    wrote on last edited by
    #1

    On Qt Creator 2.1.0 final, I added a member function which returns a nested QMap defined as:
    QMap< QString, QMap<QString, QString> >

    But QtCreator colors it as an error, if I build my project everything works as it should, but I guess the text coloring parser has some problems coloring this. Here's a screenshot:

    !http://www.jimi.com.mx/u/nestedQMap.png(error)!

    just to be sure, I even removed the parameter name and just left the type (just in case the parser is super strict) but still no luck, keeps marking the error on both .h and .cpp so, what do you guys think, it's a bug? please someone else try it to see if it happens to anyone else as well so maybe we can report this.

    Raul Guerrero
    http://jimi.mx

    1 Reply Last reply
    0
    • D Offline
      D Offline
      dangelog
      wrote on last edited by
      #2

      You're missing a space between the two >> characters...

      Software Engineer
      KDAB (UK) Ltd., a KDAB Group company

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

        [quote author="peppe" date="1299798621"]You're missing a space between the two >> characters...[/quote]

        Indeed. The ">>" of the templates are interpreted as "operator >>" which is the stream input operator.

        http://www.catb.org/~esr/faqs/smart-questions.html

        1 Reply Last reply
        0
        • R Offline
          R Offline
          raulgd
          wrote on last edited by
          #4

          Ok, but that shouldn't happen right? because I'm declaring a return statement here, or can there be a return statement with stream operators?

          Raul Guerrero
          http://jimi.mx

          1 Reply Last reply
          0
          • D Offline
            D Offline
            dangelog
            wrote on last edited by
            #5

            Shouldn't happen what? Is that code automatically generated by Creator or did you mistype it?

            Software Engineer
            KDAB (UK) Ltd., a KDAB Group company

            1 Reply Last reply
            0
            • G Offline
              G Offline
              goetz
              wrote on last edited by
              #6

              [quote author="Raul" date="1299802219"]Ok, but that shouldn't happen right? because I'm declaring a return statement here, or can there be a return statement with stream operators?[/quote]

              That's a valid C++ error. Consider ">>" as a keyword - you can use it only where it is allowed.

              http://www.catb.org/~esr/faqs/smart-questions.html

              1 Reply Last reply
              0
              • S Offline
                S Offline
                stephenju
                wrote on last edited by
                #7

                Or once C++0x finally arrives in Qt land, you can then freely use them without space in nested templates. :)

                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  andre
                  wrote on last edited by
                  #8

                  Shouldn't that be "Or once C++0x finally arives. (period)"? AFAIK, it is still only a proposal, not a finalized standard?

                  1 Reply Last reply
                  0
                  • G Offline
                    G Offline
                    goetz
                    wrote on last edited by
                    #9

                    [quote author="Andre" date="1300011528"]Shouldn't that be "Or once C++0x finally arives. (period)"? AFAIK, it is still only a proposal, not a finalized standard?[/quote]

                    True. That's what I know too.

                    Time to change the beast's name to "C++1x" :-)

                    http://www.catb.org/~esr/faqs/smart-questions.html

                    1 Reply Last reply
                    0
                    • S Offline
                      S Offline
                      stephenju
                      wrote on last edited by
                      #10

                      Some of the C++0x features have made into to gcc/mingw. I am not sure nested right brackets is allowed but I used auto a lot until I find out Mac is stuck in the last century thanks to Apple.

                      I really hope LLVM/clang support in Qt is coming quickly. A common compiler target makes life a lot easier.

                      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