Results 1 to 10 of 10

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

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2020
    Posts
    4
    Thanks
    5
    Qt products
    Qt5
    Platforms
    Unix/X11

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

    Quote Originally Posted by d_stranz View Post
    Don't know where you read this, but it is wrong. Signals can be emitted from any method. How they get handled depends on what type of signal/slot connection was made. See the documentation for QObject::connect().



    You realize you have set up an infinite loop here, right? You have connected the plotUpdated() signal to the onPlotUpdated() slot, and in that slot you emit the plotUpdated() signal, which calls the slot, which emits the signal, which calls the slot...



    I don't have any idea what you are trying to do with this QTimer. And if all you want to do is call the onPlotUpdated slot, then make that the slot connected to the timer's timeout signal. No need to add a special slot that simply emits the plotUpdated signal.
    1. I do not remember exactly, but I thought I read it in a Qt forum, I cannot find it anymore.

    2. I am aware of the infinite loop, my plan was to just add a counter variable and only emit the signal when the count is below a certain value.

    3. The sole reason I used a single shot timer is just so I could enter the event loop to emit a signal, but I now know that is not necessary.

    Thank you very much for the guidance, I really appreciate it.

  2. #2
    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?

    Signals can be emitted from any method.
    A small correction - the method has to be a member of a class derived from QObject that contains the Q_OBJECT macro in its class definition, and the signal function itself must be declared as a signal in that class. Otherwise the MOC compiler won't generate the boilerplate code that defines the signal and integrates it into signal / slot connections. Typically signals are private or protected class methods that can't be called except from within their own classes.
    <=== 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.

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.