Results 1 to 8 of 8

Thread: QwtPolar change scale steps problem

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2016
    Posts
    14
    Thanks
    2
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Unhappy QwtPolar change scale steps problem

    Hello everyone!
    I ran into a problem with scaling.
    This is my code to change scale:
    Qt Code:
    1. // class Scale : public QDockWidget
    2. // QComboBox::m_cbScale;
    3. // QComboBox::m_cbAzimuth;
    4. // QComboBox::m_cbDistance;
    5. // QwtPolarPlot::m_screen
    6. const double MAX_DISPLAY_FACTOR = 0.99; // for squared displaying
    7.  
    8. void Scale::changedScale()
    9. {
    10. // Azimuth scale
    11. m_screen->setScale(QwtPolar::Azimuth, 360, 0, m_cbAzimuth->currentText().toDouble());
    12. // Distance scale
    13. m_screen->setScale(QwtPolar::Radius, 0, 600.0, m_cbDistance->currentText().toDouble());
    14. m_screen->setScaleMaxMajor(QwtPolar::Radius, 600.0 / m_cbDistance->currentText().toDouble());
    15. // Zoom scale
    16. if(qFuzzyCompare(m_cbScale->currentText().toDouble(), 600.0)) {
    17. m_screen->zoom(QwtPointPolar(0, 0), MAX_DISPLAY_FACTOR);
    18. } else {
    19. m_screen->zoom(QwtPointPolar(0, 0), m_cbScale->currentText().toDouble() / 600.0);
    20. }
    21. m_screen->replot();
    22. }
    To copy to clipboard, switch view to plain text mode 

    How to set major ticks to be fixed - not auto calculated.

    Scale 200 steps 100 - good.
    scale200_step100.jpg
    Scale 150 steps 100 - bad - steps setted to 100, but displaying 50. In here I want to be displayed only 100 without 50 and 150.
    scale150_step100.jpg
    Scale 50 steps 100 - bad - steps setted to 100, but displaying 20. In here I want to be displayed nothing. If I change distance step to 50 - only 50 major tick are displayed. If I change distance step to 10, I want to be displayed 10, 20, 30, 40 and 50.
    scale50_step100.jpg
    Last edited by BulSV; 14th May 2017 at 16:08.

Similar Threads

  1. Replies: 5
    Last Post: 25th January 2021, 17:01
  2. Replies: 2
    Last Post: 13th November 2016, 19:30
  3. Replies: 7
    Last Post: 13th April 2011, 09:42
  4. Replies: 1
    Last Post: 19th May 2009, 12:14
  5. Steps in solving a programming problem?
    By triperzonak in forum General Programming
    Replies: 8
    Last Post: 5th August 2008, 09:47

Tags for this Thread

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.