Results 1 to 3 of 3

Thread: Panning with Qwt

  1. #1
    Join Date
    Jun 2011
    Location
    Porto Alegre, Brazil
    Posts
    482
    Thanks
    165
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Panning with Qwt

    Hello!

    I would like to use panning function in my software that uses Qwt, and considering what I did till now, everything works fine:

    Qt Code:
    1. pannerTend = new QwtPlotPanner(plotTend->canvas());
    2. pannerTend->setMouseButton(Qt::MiddleButton);
    3. pannerTend->setCursor(QCursor(Qt::ClosedHandCursor));
    To copy to clipboard, switch view to plain text mode 

    The problem is that when I grab the canvas with the mouse and perform the panning, it is not done automatically, i.e. the new part of the canvas is always clean and the axis don't move. Only when I release the mouse the canvas is reploted and the panning appears:

    panning.jpg

    Is there a way to change that, even if I have to change the .cpp/.h of Qwt, so always when the mouse moves the canvas is reploted with the panning changes (exactly as how is done in Google Maps or in Qt Example Light Maps)?

    Thanks!


    Momergil

  2. #2
    Join Date
    Jun 2011
    Location
    Porto Alegre, Brazil
    Posts
    482
    Thanks
    165
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Panning with Qwt

    Could somebody help? :x

  3. #3
    Join Date
    Sep 2011
    Location
    Manchester
    Posts
    538
    Thanks
    3
    Thanked 106 Times in 103 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Panning with Qwt

    I don't think what you want can be easily (if at all) done with panner, as it takes a copy of the plot and that's what it moves around.
    Even if you update the plot the pixmap held by panner will not change.

    I guess it would be easier done using zoomer.
    you could call QwtPlotZoomer::moveBy(double x, double y) on every mouse move which should do what you want.

    I've never done anything like that so I may be wrong here but I think it's worth a try.

Similar Threads

  1. Qlabel Image Panning
    By augusbas in forum Qt Programming
    Replies: 1
    Last Post: 12th November 2011, 07:43
  2. Need Help Regarding Image panning in QT
    By sekhar18k in forum Qt Programming
    Replies: 4
    Last Post: 28th September 2010, 07:18
  3. QGraphicsView and panning performance
    By prashant in forum Qt Programming
    Replies: 1
    Last Post: 27th November 2009, 19:40
  4. Panning QGraphicsScene
    By prashant in forum Qt Programming
    Replies: 1
    Last Post: 28th September 2009, 20:41
  5. Panning
    By linuxdev in forum The GraphicsView Framework
    Replies: 3
    Last Post: 30th December 2008, 06:40

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.