Results 1 to 20 of 26

Thread: Main thread - worker thread communication.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2007
    Posts
    23
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    3

    Default Re: Main thread - worker thread communication.

    Quote Originally Posted by wysota View Post
    You're not using signals and slots here. First of all you should use Qt threads instead of Python threads, otherwise there is a good chance it won't work properly.
    But i thought that i used Signals and Slots...Isn't the declaration "def on_start_clicked(self):" just an alternative way to the usual "QtCore.QObject.connect" call ?
    I mean, the Signals and Slots mechanism is underneath of both ways, isn't ??

    In run() method of the thread create an object that inherits QObject and there declare a signal which you then have to emit each time you want to change the progress bar value. Then connect the signal to the setValue slot in the progress bar and start the thread.
    Ok, i will try right know this and i let you know. Should i implement a QThread instead of a Python one ??

    And forget about processEvents() - you don't need it.
    Ok, i just did (forgot)
    Software Engineer, riding a Kona King Kikapu 2007

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Main thread - worker thread communication.

    Yes, provided that start is a button. Yes, you should use QThreads.

  3. #3
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts

    Default Re: Main thread - worker thread communication.

    Quote Originally Posted by kikapu View Post
    But i thought that i used Signals and Slots...Isn't the declaration "def on_start_clicked(self):" just an alternative way to the usual "QtCore.QObject.connect" call ?
    I mean, the Signals and Slots mechanism is underneath of both ways, isn't ??
    Connecting Signals and Slots
    J-P Nurmi

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
  •  
Qt is a trademark of The Qt Company.