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. set<int> in Qt creator and debugger
Forum Updated to NodeBB v4.3 + New Features

set<int> in Qt creator and debugger

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
creator 4.2.1windows 10 iotsetintmingwbug-17653
29 Posts 3 Posters 12.8k Views 3 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 koahnig

    @kshegunov
    The output to qDebug() is correct. You should see, it is part of the lower end of the picture.

    What do you mean with buckets?
    Whatever this would be, shouldn't it non-repeating?

    kshegunovK Offline
    kshegunovK Offline
    kshegunov
    Moderators
    wrote on last edited by kshegunov
    #10

    @koahnig said in set<int> in Qt creator and debugger:

    What do you mean with buckets?
    Whatever this would be, shouldn't it non-repeating?

    No, it can be repeating, it depends on the internal structure of std::set. I assumed (erroneously) the set is implemented as a hash-table (like in Qt), so that's where "buckets" come from - it's the index of the array where the actual data is kept. Anyway, after a quick lookup I see it's a red-black tree (i.e. like QMap), so my new hypothesis is you're looking at the node index be it left node or right. I'd even make a further step and speculate 0 is the root node, 1 is the left node and 2 is the right node (relative to the parent).

    In any case you should probably file a bug report on it, as the debug helpers don't seem to properly resolve the actual data.

    Read and abide by the Qt Code of Conduct

    K 1 Reply Last reply
    0
    • kshegunovK kshegunov

      @koahnig said in set<int> in Qt creator and debugger:

      What do you mean with buckets?
      Whatever this would be, shouldn't it non-repeating?

      No, it can be repeating, it depends on the internal structure of std::set. I assumed (erroneously) the set is implemented as a hash-table (like in Qt), so that's where "buckets" come from - it's the index of the array where the actual data is kept. Anyway, after a quick lookup I see it's a red-black tree (i.e. like QMap), so my new hypothesis is you're looking at the node index be it left node or right. I'd even make a further step and speculate 0 is the root node, 1 is the left node and 2 is the right node (relative to the parent).

      In any case you should probably file a bug report on it, as the debug helpers don't seem to properly resolve the actual data.

      K Offline
      K Offline
      koahnig
      wrote on last edited by
      #11

      @kshegunov

      Bug report filed QTCREATORBUG-17653

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

      1 Reply Last reply
      2
      • K koahnig

        @mrjj

        Sure!

        #include <set>
        #include <QDebug>
        
        int main(int argc, char *argv[])
        {
        
            std::set < int > setint;
        
            for ( unsigned i = 0; i < 20; ++i )
            {
                setint.insert (i);
            }
        
            for ( std::set<int>::const_iterator it = setint.begin(); it != setint.end(); ++it)
            {
                qDebug() << *it;
            }
        
            return 0;
        }
        

        and here the .pro file, which holds another surprise with new creator.

        QT += core
        QT -= gui
        
        CONFIG += c++11
        
        TARGET = TestDebugSet
        CONFIG += console
        CONFIG -= app_bundle
        
        TEMPLATE = app
        
        SOURCES += main.cpp
        
        # The following define makes your compiler emit warnings if you use
        # any feature of Qt which as been marked deprecated (the exact warnings
        # depend on your compiler). Please consult the documentation of the
        # deprecated API in order to know how to port your code away from it.
        DEFINES += QT_DEPRECATED_WARNINGS
        
        # You can also make your code fail to compile if you use deprecated APIs.
        # In order to do so, uncomment the following line.
        # You can also select to disable deprecated APIs only up to a certain version of Qt.
        #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
        
        

        Certainly it is good to do more testing. I did not expect that it is as easily reproducable.
        If you mean old-fashioned -> lazy , I'm old-fashioned too. ;)

        mrjjM Offline
        mrjjM Offline
        mrjj
        Lifetime Qt Champion
        wrote on last edited by
        #12

        @koahnig

        Hi
        "If you mean old-fashioned -> lazy , I'm old-fashioned too. ;)"
        Yes also that :))

        Tried at home with Qt5.7, Creator 4.1.0, win 10, mingw, gdb 7.10.1

        alt text

        K 2 Replies Last reply
        1
        • mrjjM mrjj

          @koahnig

          Hi
          "If you mean old-fashioned -> lazy , I'm old-fashioned too. ;)"
          Yes also that :))

          Tried at home with Qt5.7, Creator 4.1.0, win 10, mingw, gdb 7.10.1

          alt text

          K Offline
          K Offline
          koahnig
          wrote on last edited by
          #13

          @mrjj

          Thanks for checking.

          This reflects my memory. I had upgraded recently to latest qt creator version, but left all the different Qt lib version and their associated tools, respectively there might be an update somewhere, but not on all different Qt lib versions.

          I am pretty sure that the display worked prior to the upgrade of creator.

          Unfortunately, I cannot go back easily to previous Qt creator setup for checking. At least I will not dare to do, because there have been adaptations to project setups.

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

          1 Reply Last reply
          0
          • mrjjM mrjj

            @koahnig

            Hi
            "If you mean old-fashioned -> lazy , I'm old-fashioned too. ;)"
            Yes also that :))

            Tried at home with Qt5.7, Creator 4.1.0, win 10, mingw, gdb 7.10.1

            alt text

            K Offline
            K Offline
            koahnig
            wrote on last edited by
            #14

            @mrjj

            Took the liberty to add a comment and your screenshot to the bug report on JIRA.

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

            mrjjM 1 Reply Last reply
            1
            • K koahnig

              @mrjj

              Took the liberty to add a comment and your screenshot to the bug report on JIRA.

              mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on last edited by
              #15

              @koahnig
              Super. So we are thinking its related to Creator version and not so much Qt version?
              Sounds like. Was working in Creator 3.6 ? and then upgraded to 4.2.1 and
              it was now incorrect?

              K 1 Reply Last reply
              1
              • mrjjM mrjj

                @koahnig
                Super. So we are thinking its related to Creator version and not so much Qt version?
                Sounds like. Was working in Creator 3.6 ? and then upgraded to 4.2.1 and
                it was now incorrect?

                K Offline
                K Offline
                koahnig
                wrote on last edited by koahnig
                #16

                @mrjj
                Not sure, but I think I had a 4.1.x already bnefore upgrading. This would correlate with your findings.
                [edit:koahnig] Yes, the change to V4.2.1 brought up the problem.

                I am too "old-fashioned" to keep track of this.
                In general I am a slow upgrader, because "Never change a running system". Therefore, I am mainly using 5.4.2 at the moment. This gives the nasty message when starting up the application on win10, but it works and that is the point.

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

                mrjjM 1 Reply Last reply
                0
                • K koahnig

                  @mrjj
                  Not sure, but I think I had a 4.1.x already bnefore upgrading. This would correlate with your findings.
                  [edit:koahnig] Yes, the change to V4.2.1 brought up the problem.

                  I am too "old-fashioned" to keep track of this.
                  In general I am a slow upgrader, because "Never change a running system". Therefore, I am mainly using 5.4.2 at the moment. This gives the nasty message when starting up the application on win10, but it works and that is the point.

                  mrjjM Offline
                  mrjjM Offline
                  mrjj
                  Lifetime Qt Champion
                  wrote on last edited by
                  #17

                  @koahnig
                  So if I upgrade my Creator, i should get the same. maybe.
                  You just download other Creator from
                  https://download.qt.io/official_releases/qtcreator/4.2/4.2.1/
                  and run it ?

                  K 1 Reply Last reply
                  0
                  • mrjjM mrjj

                    @koahnig
                    So if I upgrade my Creator, i should get the same. maybe.
                    You just download other Creator from
                    https://download.qt.io/official_releases/qtcreator/4.2/4.2.1/
                    and run it ?

                    K Offline
                    K Offline
                    koahnig
                    wrote on last edited by
                    #18

                    @mrjj
                    No, I simply used the maintenance tool and used the second entry (updating/upgrading?).
                    Therefore, there could be also some updates invloved for the other tools. I did not pay attention, but it is probably save to assume that the installation for Qt5.4.2 stayed as it was.

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

                    mrjjM 1 Reply Last reply
                    0
                    • K koahnig

                      @mrjj
                      No, I simply used the maintenance tool and used the second entry (updating/upgrading?).
                      Therefore, there could be also some updates invloved for the other tools. I did not pay attention, but it is probably save to assume that the installation for Qt5.4.2 stayed as it was.

                      mrjjM Offline
                      mrjjM Offline
                      mrjj
                      Lifetime Qt Champion
                      wrote on last edited by
                      #19

                      @koahnig
                      Hi i used the update option and updated ONLY Creator.
                      ( and some docs that was not de-selectable)

                      And i have issue now
                      alt text

                      So it seems a bug in 4.2.1 .

                      Soo where is my downgrade option ? :)

                      K 1 Reply Last reply
                      1
                      • mrjjM mrjj

                        @koahnig
                        Hi i used the update option and updated ONLY Creator.
                        ( and some docs that was not de-selectable)

                        And i have issue now
                        alt text

                        So it seems a bug in 4.2.1 .

                        Soo where is my downgrade option ? :)

                        K Offline
                        K Offline
                        koahnig
                        wrote on last edited by
                        #20

                        @mrjj

                        Bad luck, I guess. ;)

                        At least I know that this is not an issue with my specific machine.

                        Somehow it would be good to have parallel installations of Qt creator as well. However, the implications might be huge.

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

                        mrjjM 1 Reply Last reply
                        0
                        • K koahnig

                          @mrjj

                          Bad luck, I guess. ;)

                          At least I know that this is not an issue with my specific machine.

                          Somehow it would be good to have parallel installations of Qt creator as well. However, the implications might be huge.

                          mrjjM Offline
                          mrjjM Offline
                          mrjj
                          Lifetime Qt Champion
                          wrote on last edited by
                          #21

                          @koahnig
                          Its really reproducible.
                          Just tried in virtual. Same result.

                          In theory , there should be nothing stopping us from having multiple Creators but
                          i wonder if a 3.6 version can load the plugins of 4.2.1

                          K 1 Reply Last reply
                          0
                          • mrjjM mrjj

                            @koahnig
                            Its really reproducible.
                            Just tried in virtual. Same result.

                            In theory , there should be nothing stopping us from having multiple Creators but
                            i wonder if a 3.6 version can load the plugins of 4.2.1

                            K Offline
                            K Offline
                            koahnig
                            wrote on last edited by
                            #22

                            @mrjj

                            I doubt that creator 3.6 can load plugins of version 4.2.1.

                            I had wasted a while ago my time with enhancing the doxygen plugin. My rational was that at least I can use while doing a complete compilation of creator with all plugins. However, I had found out that another plugin, which I was relying on, changed interface. Adding the mostly non-existing documentation for feaures and interfaces completes in my opinion the nightmare.

                            Do you know if you can use plugins the other way around (e.g. 3.6 plugins in 4.2)?
                            Respectively, can you mix MinGW plugins with VS plugins?
                            The latter one is probably killed by incompatibility of different compilers, or is that assumption wrong?

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

                            mrjjM 1 Reply Last reply
                            0
                            • K koahnig

                              @mrjj

                              I doubt that creator 3.6 can load plugins of version 4.2.1.

                              I had wasted a while ago my time with enhancing the doxygen plugin. My rational was that at least I can use while doing a complete compilation of creator with all plugins. However, I had found out that another plugin, which I was relying on, changed interface. Adding the mostly non-existing documentation for feaures and interfaces completes in my opinion the nightmare.

                              Do you know if you can use plugins the other way around (e.g. 3.6 plugins in 4.2)?
                              Respectively, can you mix MinGW plugins with VS plugins?
                              The latter one is probably killed by incompatibility of different compilers, or is that assumption wrong?

                              mrjjM Offline
                              mrjjM Offline
                              mrjj
                              Lifetime Qt Champion
                              wrote on last edited by
                              #23

                              @koahnig
                              yes i assume only minor version will work.
                              I have 2 creators installed currently. seems to work.
                              Im not sure how compatible the plugins are but going to try an older creator:)

                              We cannot use mingw plugins unless creator is compiled with mingw. I made such version to make
                              testing Designer plugins easier. but to run in the normal creator it must be compiled with vs 2013 or 2015 for 5.8

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

                                I am wondering if this has something to do with the debugging problems?
                                0_1485853394828_upload-12d41ddf-a50c-4398-a830-be85302d58b5

                                I am pretty sure that the settings where ok prior to creator update.

                                Also this looks strange
                                0_1485853551174_upload-d74f8f2c-6ed3-46fe-b244-ccb57ea6b692

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

                                mrjjM 1 Reply Last reply
                                0
                                • K koahnig

                                  I am wondering if this has something to do with the debugging problems?
                                  0_1485853394828_upload-12d41ddf-a50c-4398-a830-be85302d58b5

                                  I am pretty sure that the settings where ok prior to creator update.

                                  Also this looks strange
                                  0_1485853551174_upload-d74f8f2c-6ed3-46fe-b244-ccb57ea6b692

                                  mrjjM Offline
                                  mrjjM Offline
                                  mrjj
                                  Lifetime Qt Champion
                                  wrote on last edited by
                                  #25

                                  @koahnig
                                  Image upload is broken :)

                                  K 1 Reply Last reply
                                  0
                                  • mrjjM mrjj

                                    @koahnig
                                    Image upload is broken :)

                                    K Offline
                                    K Offline
                                    koahnig
                                    wrote on last edited by
                                    #26

                                    @mrjj

                                    Here are the links first pciture
                                    Second picture
                                    Is my handling wrong or is it a general issue with the upload?

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

                                    mrjjM 1 Reply Last reply
                                    0
                                    • K koahnig

                                      @mrjj

                                      Here are the links first pciture
                                      Second picture
                                      Is my handling wrong or is it a general issue with the upload?

                                      mrjjM Offline
                                      mrjjM Offline
                                      mrjj
                                      Lifetime Qt Champion
                                      wrote on last edited by mrjj
                                      #27

                                      @koahnig
                                      Its general issue. The image is in fact uploaded to cloud server but sadly that area is only
                                      available to the users on that Host. So it remains visible for some time to the poster and "some"
                                      and then its gone.

                                      K 1 Reply Last reply
                                      0
                                      • mrjjM mrjj

                                        @koahnig
                                        Its general issue. The image is in fact uploaded to cloud server but sadly that area is only
                                        available to the users on that Host. So it remains visible for some time to the poster and "some"
                                        and then its gone.

                                        K Offline
                                        K Offline
                                        koahnig
                                        wrote on last edited by
                                        #28

                                        @mrjj

                                        If I undertand you correctly I would need to install a previous version of Qt creator separately through creator install.exe. Are you aware of any downsides when you are downgrading from the buggy version?
                                        E.g. are there conflicts through the various files holding settings?

                                        As noted before, I am not really happy to downgrade of potential version conflicts, but as it looks to me, it might be the best alternative. I need to debug structures based on std::map now. The same problem there. Probably not surprising I guess.

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

                                        kshegunovK 1 Reply Last reply
                                        0
                                        • K koahnig

                                          @mrjj

                                          If I undertand you correctly I would need to install a previous version of Qt creator separately through creator install.exe. Are you aware of any downsides when you are downgrading from the buggy version?
                                          E.g. are there conflicts through the various files holding settings?

                                          As noted before, I am not really happy to downgrade of potential version conflicts, but as it looks to me, it might be the best alternative. I need to debug structures based on std::map now. The same problem there. Probably not surprising I guess.

                                          kshegunovK Offline
                                          kshegunovK Offline
                                          kshegunov
                                          Moderators
                                          wrote on last edited by kshegunov
                                          #29

                                          @koahnig said in set<int> in Qt creator and debugger:

                                          E.g. are there conflicts through the various files holding settings?

                                          There might be, you will probably at least need to reconfigure the project's kits (i.e. deleting the *.pro.user files). I'd try to load them directly first though, it might work fine.

                                          @koahnig said in set<int> in Qt creator and debugger:

                                          The same problem there.

                                          It's the same data structure, so no surprise at all, indeed.

                                          Read and abide by the Qt Code of Conduct

                                          1 Reply Last reply
                                          1

                                          • Login

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