Results 1 to 3 of 3

Thread: updating waterfall QwtSpectrogram

  1. #1
    Join Date
    Oct 2012
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default updating waterfall QwtSpectrogram

    Hi all, I'm stuck after implementing a waterfall with QwtSpectrogram. I've had a look at the other posts and I'm still stumped.

    I have a button that when clicked calls ui->myQwtPlot->replot(); and my spectrogram updates as many times as I click the button with almost no delay. However, if I place the replot(); call in a FOR loop under the button's callback, the spectrogram will not update. I included a sleep(1) in the FOR loop just in case there was some odd delay.

    Still no luck.

    Any ideas?

    Thanks,
    Tom

  2. #2
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,278
    Thanked 872 Times in 820 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: updating waterfall QwtSpectrogram

    Widgets are repainted inside of its paintEvent only ( beside a special mode that is available on X11 only ). Thus QwtPlot::replot doesn't repaint the plot - it adds events to to the event queue that have no effect as long as the event queue is not processed.

    You could add QApplication::processEvents() or QApplication::sendPostedEvents() to your button click handler.

    But when using QApplication::sendPostedEvents() note that QwtPlot is a composite widget and you have to process the events for all children of the plot. Also note that processing an event might initiate other events that also need to be processed.

    HTH,
    Uwe

  3. #3
    Join Date
    Oct 2012
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: updating waterfall QwtSpectrogram

    Hi Uwe, I'm very appreciative you are so active on the forum.

    I added the line you suggested and my immediate problems have been resolved :-) . I understand being leary about requesting that all the events be processed. I'm not sure what effect this will have on my long term development - I will have to figure it out. But , in any event, you're post was very helpful!

    Best,
    Tom

Similar Threads

  1. How to adddata for qwtspectrogram
    By centroid in forum Qwt
    Replies: 2
    Last Post: 2nd August 2010, 13:36
  2. Replies: 1
    Last Post: 4th March 2010, 17:57
  3. x-axis for waterfall plot
    By janK in forum Qwt
    Replies: 8
    Last Post: 29th July 2009, 15:00
  4. waterfall display
    By jmsbc in forum Qt Programming
    Replies: 7
    Last Post: 15th November 2008, 08:29
  5. QwtSpectrogram example program
    By cgifford in forum Qwt
    Replies: 3
    Last Post: 2nd July 2008, 06:46

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.