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. Why list objects with static members not accessible during debug

Why list objects with static members not accessible during debug

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
creatordebugger helperstatic member
5 Posts 2 Posters 2.1k Views
  • 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.
  • N Offline
    N Offline
    nyakacs
    wrote on 28 Jun 2017, 17:41 last edited by
    #1

    Hello,

    I have been struggling to debug a large code using std::list extensively. It seems that objects in a list are not accessible in the debugger using Creator if they contain a static member. I tried various version including the latest 4.3.0.

    I managed to distil the problem to the below example. As shown in the attached image, objects of Test1 are labelled <not accessible>, whilst Test2 are fine inside the list. Objects outside of the list are accessible independently from having a static member or not.

    Any help would be greatly appreciated.

    #include <iostream>
    #include <list>
     
    class Test1
    {
    public:
        static const int NOPOS=-1;
        int a;
    };
     
    class Test2
    {
    public:
        const int NOPOS=-1;
        int a;
    };
     
    int main()
    {
        std::list<Test1> list1;
        Test1 t11;
        list1.push_back(t11);
        Test1 t12;
        list1.push_back(t12);
     
        std::list<Test2> list2;
        Test2 t21;
        list2.push_back(t21);
        Test2 t22;
        list2.push_back(t22);
     
        return 0;
    

    0_1498671545996_debug.jpg

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 28 Jun 2017, 22:03 last edited by
      #2

      Hi,

      Sounds like you may have found something.

      Which version of Qt are you running ? On what OS ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      N 1 Reply Last reply 30 Jun 2017, 07:20
      0
      • S SGaist
        28 Jun 2017, 22:03

        Hi,

        Sounds like you may have found something.

        Which version of Qt are you running ? On what OS ?

        N Offline
        N Offline
        nyakacs
        wrote on 30 Jun 2017, 07:20 last edited by
        #3

        Hi,

        It is the latest creator 4.3.0. I tried it with Qt5.3.1 and 5.9.1 so I assume all version in between at least. The OS is Win10.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 30 Jun 2017, 21:16 last edited by
          #4

          Did you also check with Qt Creator 4.3.1

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          N 1 Reply Last reply 1 Jul 2017, 22:37
          0
          • S SGaist
            30 Jun 2017, 21:16

            Did you also check with Qt Creator 4.3.1

            N Offline
            N Offline
            nyakacs
            wrote on 1 Jul 2017, 22:37 last edited by
            #5

            I have now. It was not out when I did the original test. Anyway with Creator 4.3.1 it seems to be OK independently from the compiler or Qt version. I guess this solves it. Thanks for pointing out.

            1 Reply Last reply
            0

            1/5

            28 Jun 2017, 17:41

            • Login

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