Results 1 to 4 of 4

Thread: Scrollzoomer axis update

  1. #1
    Join Date
    Jul 2017
    Posts
    3
    Qt products
    Qt5
    Platforms
    Windows

    Default Scrollzoomer axis update

    Hi,

    I need help with scrollzoomer implementation. I copied scrollzoomer from qwt examples and I need to do some modification with this functionality. In my app I read some data from file and generate plot with zoomer enabled.
    Axis of the plot are initiated with max and min values from data and set using setAxisScale. My problem is to resolve situation when zoom area have a part outside of default plot region. It is ilustrated at below image:

    http://imgur.com/a/38nFm

    When user use vertical scrollbar, jump of the plot can be observed and I have a question how it is possible to avoid this situation. I suspect this is caused by zoomBase set up with default axis values, but I need some help how to figure it out to set axis/scrollbar value in proper way.

    thanks for any sugestions.

  2. #2
    Join Date
    Jul 2017
    Posts
    3
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Scrollzoomer axis update

    Can anyone help me?

  3. #3
    Join Date
    Jul 2017
    Posts
    3
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Scrollzoomer axis update

    I try to update the zoomBase when zoomRect is outside on default zoomBase values with below code:

    QRectF myBase;
    if (zoomRect().top() < zoomBase().top())
    {
    myBase.setTop(zoomRect().top());

    }
    else
    {
    myBase.setTop(zoomBase().top());

    }
    if (zoomRect().bottom() >= zoomBase().bottom())
    {
    myBase.setBottom(zoomRect().bottom());


    }
    else
    {
    myBase.setBottom(zoomBase().bottom());

    }
    for instance only in y axis, and next I do setZoomBase function:
    setZoomBase(&myBase);
    but as a result zoomBase is set to zoomRect not to proper values, can anyone help how to figure it out?

    thanks

  4. #4
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,309
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Scrollzoomer axis update

    What exactly goes wrong - calculating myBase ?

    Uwe

    PS: sorry for the late reply, but we have holidays in Bavaria

Similar Threads

  1. Replies: 0
    Last Post: 23rd October 2015, 15:00
  2. Replies: 0
    Last Post: 28th July 2015, 09:27
  3. Replies: 1
    Last Post: 16th December 2013, 21:30
  4. ScrollZoomer: ScrollbarAlwaysOn
    By FelixB in forum Qwt
    Replies: 0
    Last Post: 14th October 2010, 17:30
  5. ScrollZoomer not working properly..
    By Raghaw in forum Qwt
    Replies: 1
    Last Post: 30th October 2009, 07:51

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.