Results 1 to 10 of 10

Thread: Qwt: Is it possible to perform GUI operations from a separate QProcess?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #5
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Qwt: Is it possible to perform GUI operations from a separate QProcess?

    how could I use the signal and slot mechanism to notify when I am finished painting?
    You're probably not going to have an actual paintEvent() in your thread, but instead you will have some other method that creates a new QImage with the current data. For whatever class it is that implements this updating, be sure it is derived from QObject (so it can emit signals), and implement a signal with a signature something like:

    Qt Code:
    1. signals:
    2.  
    3. void imageUpdated( const QImage & image );
    To copy to clipboard, switch view to plain text mode 

    In the GUI thread, add a slot to whatever QWidget class will display the image, and connect that slot to the thread's signal:

    Qt Code:
    1. public slots:
    2. void onImageUpdated( const QImage & image );
    To copy to clipboard, switch view to plain text mode 

    In that slot, copy the image, then call QWidget::update() to schedule a paintEvent().

    I am not familiar enough with the current state of Qwt to know how you would integrate this QImage-based rendering into a QwtPlot. Perhaps you would need to actually paint the entire QwtPlot into the QImage in your thread, or perhaps Qwt has a spectrogram-like plot where a QImage can be substituted for a calculated spectrogram.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  2. The following user says thank you to d_stranz for this useful post:

    seanj (23rd December 2020)

Similar Threads

  1. How to perform HSV Color mixing ?
    By Ashketchup in forum Qt Programming
    Replies: 1
    Last Post: 12th April 2012, 20:28
  2. Replies: 10
    Last Post: 30th January 2012, 11:01
  3. how to perform search in QTableWidget?
    By aurora in forum Qt Programming
    Replies: 3
    Last Post: 5th January 2012, 04:25
  4. Replies: 15
    Last Post: 24th December 2011, 12:07
  5. Problem with QProcess in two separate threads
    By viheaho in forum Qt Programming
    Replies: 2
    Last Post: 18th March 2010, 22:52

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.