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.6.2 - c++11 support

QtCreator 2.6.2 - c++11 support

Scheduled Pinned Locked Moved Qt Creator and other tools
10 Posts 3 Posters 6.6k 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.
  • K Offline
    K Offline
    kantaki
    wrote on last edited by
    #1

    Hello,

    I am currently using @QMAKE_CXXFLAGS += -std=c++11@

    But a lot of features are still missing, are there any other options? Maybe some experimental features?

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

      [quote author="kantaki" date="1362246384"]
      But a lot of features are still missing, are there any other options? Maybe some experimental features?[/quote]

      Where are those feature missing?

      Qt creator is "only" an IDE. You are showing qmake flags which are also interpret by creator. Those are past on to the compiler. However, the compiler might be the limiting factor then.

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

      1 Reply Last reply
      0
      • K Offline
        K Offline
        kantaki
        wrote on last edited by
        #3

        I thought it also makes QtCreator aware that I am using c++11.

        Well, it doesn't matter. Features like vector initialization are missing. I am just asking if there is an experimental command to enable more c++11 IDE features.

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

          Qt creator awareness of c++11 should be somewhere in the plugins, I guess. However, I am nor aware of a place to set options.

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

          1 Reply Last reply
          0
          • L Offline
            L Offline
            lgeyer
            wrote on last edited by
            #5

            Please post an example of your non-working code, initializer lists should work for quite some time now (although I have to admit that I'm using the 2.7 branch, you might also try the clang branch).

            1 Reply Last reply
            0
            • K Offline
              K Offline
              kantaki
              wrote on last edited by
              #6

              Thanks I completely forgot about QtCreator clang. I will test it now.

              @
              struct points {
              GLint x;
              GLint y;

              points(GLint x, GLint y): x(x) , y(y) {}
              

              };

              vector<points> p {
              points(1,2)
              };@
              which compiles fine under gcc, clang.

              1 Reply Last reply
              0
              • K Offline
                K Offline
                kantaki
                wrote on last edited by
                #7

                Ok this works in the clang version. But I still have one major issue. It is not even an c++11 feature.

                If i create an vector something like @vector<myclass> v;@ and I acces and element via @v[0].@ I don't get any auto complete.

                This happend in all version that I tried. Maybe it is a bug? I am running Qtcreator on Linux.

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

                  As you stated it has nothing to do with c++11.

                  Tried with Qt creator 2.6.2
                  @
                  std::vector<int> v; // auto complete does work for vector

                  vector <double> v1; // auto complete does work for vector and double, but does not compile

                  using namespace std;
                  vector <double> thisIsANiceLongName; // auto complete does work for vector and double

                  thisIsANiceLongName = 0; // auto complete does work with the first 3 letters, but does not compile
                  @

                  v and v1 are a bit short for auto completion.

                  [edit: Just in case of any doubt, I have added the compile results. ;-) ]

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

                  1 Reply Last reply
                  0
                  • K Offline
                    K Offline
                    kantaki
                    wrote on last edited by
                    #9

                    Okay I think I made a mistake. I actually have no idea how it is called. In visual studio it is called intellisense.

                    @struct test{
                    int x;
                    };

                    vector<test> v;

                    test t1;

                    v.push_back(t1);

                    v[0]. // v now should list the member variables of class test, but it doesnt (by pressing ctrl + space)@

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

                      OK. I see what you mean.

                      In that respect there are some deficiencies compared to MSVC Instellisence. I got also used to it and miss it a bit. Also if you are using an iterator for one of the standard containers.
                      @
                      #include <map>
                      void foo1()
                      {
                      map<int, int > someMap;
                      for ( map<int, int>::const_iterator it = someMap.begin(); it != someMap.end(); ++it )
                      {
                      cout << it->first << endl;
                      }
                      }
                      @
                      Completion elements in the for line are offered including const_iterator, begin() and end(). But nothing comes up when typing it->

                      @
                      #include <QMap>
                      void foo()
                      {
                      QMap<int, int > someMap;
                      for ( QMapIterator it = someMap.begin(); it != someMap.end(); ++it )
                      {
                      cout << it.key () << endl;
                      }
                      for ( QMap<int, int>::ConstIterator it = someMap.begin(); it != someMap.end(); ++it )
                      {
                      cout << it.key () << endl;
                      }
                      }
                      @
                      For the QMap variant it is working for all possibilities. However, this does not look like a pointer.
                      Note: the above QMap code does probably not compile. The correct syntax seems to be actually different. For correct syntax check out "this":http://qt-project.org/doc/qt-4.8/qmapiterator.html

                      @
                      struct struct_tst {
                      double x;
                      double y;
                      };

                      void foo3 ()
                      {
                      struct_tst pnt;

                      pnt.x = 0;
                      
                      struct_tst *ptr = new struct_tst;
                      
                      ptr->x = 0;
                      

                      }
                      @

                      The auto-completion does feature also the pointer.

                      Overall I like qt creator's way better than Intellisense from msvc2005.

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

                      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