Results 1 to 9 of 9

Thread: QPolarChart

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2020
    Posts
    47
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Re: QPolarChart

    I might have celebrated a bit prematurely, as the following code (adapted from the example in the QPolarChart Class doc.);
    Qt Code:
    1. m_angularAxis = new QValueAxis();
    2. m_angularAxis->setTickCount(9);
    3. m_angularAxis->setLabelFormat("%.1f");
    4. m_angularAxis->setShadesVisible(true);
    5. m_angularAxis->setShadesBrush(QBrush(QColor(249, 249, 255)));
    6. m_chart->addAxis(m_angularAxis, QPolarChart::PolarOrientationAngular);
    To copy to clipboard, switch view to plain text mode 
    craches the application. Looks like a segmentation error, although the error message just states that the application has crashed. The strange thing is that if I change the last line to
    Qt Code:
    1. m_chart->addAxis(m_radialAxis, QPolarChart::PolarOrientationRadial);
    To copy to clipboard, switch view to plain text mode 
    there is no crash. So it seems to be related to PolarOrientationAngular. Running it in the debugger causes the debugger to crash, so I must be doing something really daft. I suspect it could be related to my CMakeListe.txt file,

    Qt Code:
    1. find_package(Qt5Charts)
    2. target_link_libraries(myApp Qt5::Widgets Qt5::Charts)
    To copy to clipboard, switch view to plain text mode 
    but I cannot see what it might me. Am I missing something?

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QPolarChart

    If it runs in the debugger, then use the debugger to find where the crash occurs by looking at the call stack at the point of the crash. We aren't sitting there looking over your shoulder, so how are we to know what else you are doing that could cause a problem?

    If your CMake script builds an executable, then the problem is not in the CMake script. It's in your code (or your run time environment). Be sure that the Qt installation that find_package() is finding (and building against) is the same one that your run time is calling on to load shared libraries. Use the "ldd" command to find which libraries have been linked to and compare those with your path.

    using namespace QtCharts
    All of the classes in the QtCharts library are in the QtCharts namespace. If you don't want to have to qualify every class with the namespace, you add the "using" directive. Otherwise, every time you declare a QPolarChart instance, you have to declare it as QtCharts::QPolarChart and so forth.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  3. #3
    Join Date
    Jan 2020
    Posts
    47
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Re: QPolarChart

    The problem is solved. I had just committed a stupid mistake. Thanks for the help.

  4. #4
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QPolarChart

    I had just committed a stupid mistake.
    Wow, I've never done that.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. Radial Axis in QPolarChart
    By bobbyael in forum Qt Programming
    Replies: 1
    Last Post: 31st August 2015, 11:15

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.