Results 1 to 4 of 4

Thread: Send emit from QThread to QMainWindow

  1. #1

    Default Send emit from QThread to QMainWindow

    hello.
    i'm using a QThread and i must emit a vtkmageData to the MainWindow to affiche an evolution of the traitement.

    i must do the `emit()` in a funtion to send a few images.
    i tried to the `emit()` from the function who does the traitement but it does not work.

    My question is must i do the `emit` in the `run()` function or can i do it in an other function?
    Thank you.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,396
    Thanks
    37
    Thanked 1,542 Times in 1,493 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Send emit from QThread to QMainWindow

    You can do the emit in any method of the class that declares the signal.

    Have you checked that the connect() worked?

    Cheers,
    _

  3. #3

    Default Re: Send emit from QThread to QMainWindow

    Yes the connect Work well but when i emit the signal from a function it's not working.
    Thanks bro for your response

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,396
    Thanks
    37
    Thanked 1,542 Times in 1,493 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Send emit from QThread to QMainWindow

    Do you get any runtime errors?
    Have you tried with a signal without arguments.
    Can you show the code how you create and connect the thread?

    Cheers,
    _

Similar Threads

  1. Emit signal from QThread to main thread!!!
    By sanujas in forum Qt for Embedded and Mobile
    Replies: 2
    Last Post: 26th December 2013, 14:22
  2. [PyQt] send and emit an customer class....
    By cascoin in forum Qt Programming
    Replies: 5
    Last Post: 25th July 2013, 18:25
  3. QThread class does emit signal
    By saman_artorious in forum Qt Programming
    Replies: 2
    Last Post: 14th June 2012, 15:10
  4. Emit signal outside run() in QThread
    By naturalpsychic in forum Qt Programming
    Replies: 4
    Last Post: 26th March 2012, 16:31
  5. QThread don' stop (or the signal don't emit)
    By msdark in forum Qt Programming
    Replies: 1
    Last Post: 10th March 2011, 23:51

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.