Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. Qwt trying to draw symbol even it is null
QtWS25 Last Chance

Qwt trying to draw symbol even it is null

Scheduled Pinned Locked Moved Unsolved 3rd Party Software
7 Posts 3 Posters 634 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.
  • P Offline
    P Offline
    phenoboy
    wrote on last edited by
    #1

    I am getting a strange null pointer for symbols after attaching a QwtPlotCurve to the plot. For some reason in line 409 the code goes on and tries to draw a symbol even symbol is 0x0 like you can see in the debugger.

    cc288ea8-402e-402d-bcf0-86025e9e2de6-image.png

    History is that I have this compiled for 32bit and it has worked okay. Now I compiled qwt for 64bit and this problem has come up.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Which version of Qwt are you using ?
      With which version of Qt ?
      On which OS ?

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

      P 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi and welcome to devnet,

        Which version of Qwt are you using ?
        With which version of Qt ?
        On which OS ?

        P Offline
        P Offline
        phenoboy
        wrote on last edited by
        #3

        @SGaist
        Thanks!

        I use qwt development branch from git on Windows 11. I use latest Qt 5.15.2

        SGaistS 1 Reply Last reply
        0
        • P phenoboy

          @SGaist
          Thanks!

          I use qwt development branch from git on Windows 11. I use latest Qt 5.15.2

          SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Can you provide a minimal compilable example that shows this behaviour ?

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

          P 1 Reply Last reply
          0
          • SGaistS SGaist

            Can you provide a minimal compilable example that shows this behaviour ?

            P Offline
            P Offline
            phenoboy
            wrote on last edited by phenoboy
            #5

            @SGaist Thanks for the reply. I will try to do that.

            I have multithreaded application where one thread pushes data to QwtSeriesStore. When I attach that data to plot the crash happens. I don't understand why qwt code goes so far.

            JobData* gjr = JobData::instance();
             gjr->curveData()->lock();
             CustomQwtCurve* c = addCurve();
             CurveData* cd = gjr->curveData();
             c->setData(cd->getSeriesData());
             c->attach(this);
            

            JobData runs in one thread and of course UI is on another.

            After this it crashes where the original screenshot is.

            Christian EhrlicherC 1 Reply Last reply
            0
            • P phenoboy

              @SGaist Thanks for the reply. I will try to do that.

              I have multithreaded application where one thread pushes data to QwtSeriesStore. When I attach that data to plot the crash happens. I don't understand why qwt code goes so far.

              JobData* gjr = JobData::instance();
               gjr->curveData()->lock();
               CustomQwtCurve* c = addCurve();
               CurveData* cd = gjr->curveData();
               c->setData(cd->getSeriesData());
               c->attach(this);
              

              JobData runs in one thread and of course UI is on another.

              After this it crashes where the original screenshot is.

              Christian EhrlicherC Offline
              Christian EhrlicherC Offline
              Christian Ehrlicher
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @phenoboy said in Qwt trying to draw symbol even it is null:

              I have multithreaded application where one thread pushes data to QwtSeriesStore.

              So this is the reason. You must modify the gui only from the main (gui) thread.

              Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
              Visit the Qt Academy at https://academy.qt.io/catalog

              P 1 Reply Last reply
              1
              • Christian EhrlicherC Christian Ehrlicher

                @phenoboy said in Qwt trying to draw symbol even it is null:

                I have multithreaded application where one thread pushes data to QwtSeriesStore.

                So this is the reason. You must modify the gui only from the main (gui) thread.

                P Offline
                P Offline
                phenoboy
                wrote on last edited by
                #7

                @Christian-Ehrlicher

                If you look at qwt oscilloscope example the curve data is updated in another thread than GUI.
                I do the same. I update only the curve data and guard it with mutexes. In replot the data is locked. But I guess this must be the reason so I'll try to come up with a small compilable example to show the error.

                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