Results 1 to 4 of 4

Thread: Linking QwtPlot panners

  1. #1
    Join Date
    Jul 2013
    Posts
    2
    Thanks
    2
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Linking QwtPlot panners

    Hi,
    Firstly thanks for offering a great library. I am impressed with the features and community!

    Now to my problem, I have created an application where I have added multiple QwtPlots.
    I've been able to follow the rasterview example to allow panning of the plot. I've been trying to link the panners so that If I pan one plot, the other plots are moved as well.

    I've been able to connect the panned signal to the movedCanvas slot, but this only updates each plot after mouse release. To get the realtime movement (as I hold and drag the mouse) I've tried to install an eventFilter on the parent widget containing the multiple plots and send forward the mouseEvents to the multiple plots but it does not seem to do anything.

    I'm also hoping to link a scrollbar to the parent widget containing the plots as another way to all pan the plots

    I'm looking for any guidance on how I should achieve this.
    Thanks
    psk

  2. #2
    Join Date
    Jun 2013
    Posts
    56
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Linking QwtPlot panners

    psk,
    What you want may cause performance problem . Is that necessary ?

  3. The following user says thank you to Nicho for this useful post:

    psk (4th July 2013)

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

    Default Re: Linking QwtPlot panners

    Quote Originally Posted by psk View Post
    I've been able to follow the rasterview example to allow panning of the plot. I've been trying to link the panners so that If I pan one plot, the other plots are moved as well.
    The panner grabs the current content of the plot to a pixmap and creates a widget overlay, that is moving this pixmap without modifying the plot. The reason for this implementation is that that a user has a visual feedback without having to replot, what is often too slow for operations like panning.

    If your application has plots, where replots are fast enough you might want to modify the real plot while scrolling/panning. F.e the eventFilter example shows how to scroll a plot with a QwtWheel - the code for several plots should be more or less the same.
    If you want to implement "real" panning I would implement a event filter ( QObject::installEventFilter() ) for the plot canvas, that translates the mouse events into setAxisScale() calls. If you want to sync other plots according to scale changes of a plot you can connect to the QwtScaleWidget::scaleDivChanged() signal ( see QwtPlot::axisWidget() ).

    HTH,
    Uwe

  5. The following user says thank you to Uwe for this useful post:

    psk (4th July 2013)

  6. #4
    Join Date
    Jul 2013
    Posts
    2
    Thanks
    2
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: Linking QwtPlot panners

    Thanks Nicho and Uwe for the clear explanation about the panner.
    I'm having a go at what you've suggested Uwe. Update once I'm done (or stuck again)
    Cheers,

Similar Threads

  1. Replies: 9
    Last Post: 25th October 2012, 19:55
  2. Replies: 3
    Last Post: 7th February 2012, 10:40
  3. Linking With Qt VS Add in
    By rcjohns in forum Newbie
    Replies: 2
    Last Post: 14th March 2010, 12:42
  4. Linking to a DLL
    By JohnGaby in forum Newbie
    Replies: 1
    Last Post: 14th October 2009, 19:52
  5. Replies: 6
    Last Post: 14th May 2009, 12:02

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.