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. QtCharts runtime crashing when I attempt to rescale X and Y axis?
Forum Updated to NodeBB v4.3 + New Features

QtCharts runtime crashing when I attempt to rescale X and Y axis?

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 740 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.
  • E Offline
    E Offline
    engsml
    wrote on last edited by engsml
    #1

    I have a button that is supposed to scroll up and down the plot. I want to be able to rescale the axis when I do this, but my program keeps crashing at runtime when I click the button to scroll. My code is the following:

    chart->scroll(10,0);
    xMin += 10;
    xMax += 10;
    xAxis->setRange(xMin, xMax);
    chart->setAxisX(xAxis);

    My xAxis variable is of type QValueAxis and my xMin and xMax are both ints. My chart is type QChart.
    I am not sure what the error is since it crashes and doesn't display any error messages at compile time. Any help as to solving this issue would be much appreciated!

    K 1 Reply Last reply
    0
    • E engsml

      I have a button that is supposed to scroll up and down the plot. I want to be able to rescale the axis when I do this, but my program keeps crashing at runtime when I click the button to scroll. My code is the following:

      chart->scroll(10,0);
      xMin += 10;
      xMax += 10;
      xAxis->setRange(xMin, xMax);
      chart->setAxisX(xAxis);

      My xAxis variable is of type QValueAxis and my xMin and xMax are both ints. My chart is type QChart.
      I am not sure what the error is since it crashes and doesn't display any error messages at compile time. Any help as to solving this issue would be much appreciated!

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

      @engsml

      Probably the best to compile in debug and use the debugger of your tool chain. It shall tell you where the crash is happening. From there you can continue to investigate.

      Possibly one the pointers you are using is not properly initialized. That would be the first guess. Anything more detailed requires a crystal ball.

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

      E 1 Reply Last reply
      2
      • K koahnig

        @engsml

        Probably the best to compile in debug and use the debugger of your tool chain. It shall tell you where the crash is happening. From there you can continue to investigate.

        Possibly one the pointers you are using is not properly initialized. That would be the first guess. Anything more detailed requires a crystal ball.

        E Offline
        E Offline
        engsml
        wrote on last edited by
        #3

        @koahnig Thank you! Yep it showed up as a segmentation fault in the debugger.

        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