#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2006
    Posts
    1
    Rep Power
    0

    Pyqt Threads and GUI


    Hello,

    I'm building an software that has 2 threads : one with the gui (A) and the other to run the app (B).

    I'm trying to make B update A's gui, especially additem to a QListWidget.

    I have no problem adding items but once I'm in the other thread it won't work properly.

    Before triggering the thread, I'm setting a pointer so that I can access theard A :
    Code:
    	def setWindowPointer(self,thePointer):
    		global selfwindows
    		selfwindows = thePointer	
    		a.start()
    Then from the thread, I'm trying to use
    Code:
    selfwindows.textEdit.addItem("TEST")
    but this won't work and returns :
    Code:
    QObject::connect: Cannot queue arguments of type 'QModelIndex'
    Is there any other way to update an item? I'm running out of idea.

    Thank you

    ems
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2013
    Posts
    12
    Rep Power
    0
    Hi,

    This might be about 7 years too late, but the problem appears to be that you haven't made a connection. Look up connect in the PyQt4 docs. Also, this guy has the best tutorials I've seen on PyQt!

    https://www.youtube.com/user/Deusdies2

    Good luck!
    Len

IMN logo majestic logo threadwatch logo seochat tools logo