Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. The program has unexpectedly finished
QtWS25 Last Chance

The program has unexpectedly finished

Scheduled Pinned Locked Moved Unsolved General and Desktop
qt5charts
8 Posts 3 Posters 1.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.
  • D Offline
    D Offline
    deleted286
    wrote on 26 Mar 2021, 11:14 last edited by
    #1

    I add a button for clear series from my chart. So after series deleted, i can add new points on series.

    I have

      void Widget::on_clearChart_clicked()
    {
       chart->removeAllSeries();
    
    }
    

    But when i clicked button, and then, clicked my items on table widget for adding series, the program has unexpectedly finished.

    J 1 Reply Last reply 26 Mar 2021, 11:16
    0
    • D deleted286
      26 Mar 2021, 11:14

      I add a button for clear series from my chart. So after series deleted, i can add new points on series.

      I have

        void Widget::on_clearChart_clicked()
      {
         chart->removeAllSeries();
      
      }
      

      But when i clicked button, and then, clicked my items on table widget for adding series, the program has unexpectedly finished.

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 26 Mar 2021, 11:16 last edited by
      #2

      @suslucoder said in The program has unexpectedly finished:

      the program has unexpectedly finished

      First thing to do in such situation is to use debugger. So, please do so and see what exactly happens and where your app crashes.
      Is "chart" a valid pointer?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      D 1 Reply Last reply 26 Mar 2021, 11:33
      0
      • J jsulm
        26 Mar 2021, 11:16

        @suslucoder said in The program has unexpectedly finished:

        the program has unexpectedly finished

        First thing to do in such situation is to use debugger. So, please do so and see what exactly happens and where your app crashes.
        Is "chart" a valid pointer?

        D Offline
        D Offline
        deleted286
        wrote on 26 Mar 2021, 11:33 last edited by
        #3

        @jsulm yes it is valid.
        It clear the series.
        But after that, i cannot add new series.
        Should i write any connect?
        I did debug, it gives me the sıgnsev error

        J 1 Reply Last reply 26 Mar 2021, 11:34
        0
        • D deleted286
          26 Mar 2021, 11:33

          @jsulm yes it is valid.
          It clear the series.
          But after that, i cannot add new series.
          Should i write any connect?
          I did debug, it gives me the sıgnsev error

          J Offline
          J Offline
          jsulm
          Lifetime Qt Champion
          wrote on 26 Mar 2021, 11:34 last edited by
          #4

          @suslucoder said in The program has unexpectedly finished:

          I did debug, it gives me the sıgnsev error

          And how does the stack trace look like? Post it here.

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          D 1 Reply Last reply 26 Mar 2021, 13:08
          0
          • J jsulm
            26 Mar 2021, 11:34

            @suslucoder said in The program has unexpectedly finished:

            I did debug, it gives me the sıgnsev error

            And how does the stack trace look like? Post it here.

            D Offline
            D Offline
            deleted286
            wrote on 26 Mar 2021, 13:08 last edited by
            #5

            @jsulm Screenshot from 2021-03-26 16-07-05.png
            Screenshot from 2021-03-26 16-06-19.png

            D 1 Reply Last reply 26 Mar 2021, 13:14
            0
            • D deleted286
              26 Mar 2021, 13:08

              @jsulm Screenshot from 2021-03-26 16-07-05.png
              Screenshot from 2021-03-26 16-06-19.png

              D Offline
              D Offline
              deleted286
              wrote on 26 Mar 2021, 13:14 last edited by
              #6

              @suslucoder I did it like that it works without any problem but what is the difference between remove all series and remove them one by one

              chart->removeSeries(seri[0]);
                chart->removeSeries(seri[1]);
                chart->removeSeries(seri[2]);
                chart->removeSeries(seri[3]);
                chart->removeSeries(seri[4]);
                chart->removeSeries(seri[5]);
                chart->removeSeries(seri[6]);
                chart->removeSeries(seri[7]);
              
              P 1 Reply Last reply 26 Mar 2021, 13:20
              0
              • D deleted286
                26 Mar 2021, 13:14

                @suslucoder I did it like that it works without any problem but what is the difference between remove all series and remove them one by one

                chart->removeSeries(seri[0]);
                  chart->removeSeries(seri[1]);
                  chart->removeSeries(seri[2]);
                  chart->removeSeries(seri[3]);
                  chart->removeSeries(seri[4]);
                  chart->removeSeries(seri[5]);
                  chart->removeSeries(seri[6]);
                  chart->removeSeries(seri[7]);
                
                P Offline
                P Offline
                Pl45m4
                wrote on 26 Mar 2021, 13:20 last edited by Pl45m4
                #7

                @suslucoder said in The program has unexpectedly finished:

                what is the difference between remove all series and remove them one by one

                void QChart::removeAllSeries()

                Removes and deletes all series objects that have been added to the chart.
                

                (https://doc.qt.io/qt-5/qchart.html#removeAllSeries)

                While

                void QChart::removeSeries(QAbstractSeries *series)

                Removes the series series from the chart. The chart releases the ownership of the specified series object.
                

                (https://doc.qt.io/qt-5/qchart.html#removeSeries)

                I guess you are trying to double-delete the series pointers.


                If debugging is the process of removing software bugs, then programming must be the process of putting them in.

                ~E. W. Dijkstra

                D 1 Reply Last reply 26 Mar 2021, 14:25
                2
                • P Pl45m4
                  26 Mar 2021, 13:20

                  @suslucoder said in The program has unexpectedly finished:

                  what is the difference between remove all series and remove them one by one

                  void QChart::removeAllSeries()

                  Removes and deletes all series objects that have been added to the chart.
                  

                  (https://doc.qt.io/qt-5/qchart.html#removeAllSeries)

                  While

                  void QChart::removeSeries(QAbstractSeries *series)

                  Removes the series series from the chart. The chart releases the ownership of the specified series object.
                  

                  (https://doc.qt.io/qt-5/qchart.html#removeSeries)

                  I guess you are trying to double-delete the series pointers.

                  D Offline
                  D Offline
                  deleted286
                  wrote on 26 Mar 2021, 14:25 last edited by
                  #8

                  @Pl45m4 thank you

                  1 Reply Last reply
                  0

                  3/8

                  26 Mar 2021, 11:33

                  topic:navigator.unread, 5
                  • Login

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