[Qt-interest] multiple QThread simultaneously

NARCISO, Rui RUI.NARCISO at airbus.com
Tue Apr 28 15:40:13 CEST 2009



:p I know you can't _guess_ what's wrong ... before posting any code I wanted to make sure that it was possible "in theory" !!

Here's the code:

class DamasToTecplotThread(QThread):
    def __init__(self, dirList = [] ,rnaFile="", parent=None):
        QThread.__init__(self, parent)
        self.parent = parent
        self.dirList = dirList
        self.rnaFile = rnaFile
        
    def run(self):

        for dir, item in self.dirList:
            os.chdir(os.path.dirname(os.path.abspath(dir)))
            sys.argv = [sys.argv[0]] + ["-dir", dir, "-rna", self.rnaFile]
            damas2tecplot.run()
            self.emit(SIGNAL('tecplotConversionLaunched'), "Tecplot Conversion", \
                      os.path.join(os.path.dirname(os.path.abspath(dir)), 'POST_ALL',os.path.basename(os.path.abspath(dir))),  "", item, 10)

which is called like this:
                newThread = DamasToTecplotThread(dir, rnaFile, self)
                self.connect(newThread, SIGNAL('tecplotConversionLaunched'), self.addPostToCalculation, Qt.QueuedConnection)
                newThread.start()

and the error I get is:
Traceback (most recent call last):
  File "/home/cfdqdv2/to96665/TOOLS/EGADYT/integration/Version_1.0.5/CampaignManager/LibThread.py", line 96, in run
    self.emit(SIGNAL('tecplotConversionLaunched'), "Tecplot Conversion", \
TypeError: 'NoneType' object is not callable

any ideas ?


-----Message d'origine-----
De : qt-interest-bounces at trolltech.com
[mailto:qt-interest-bounces at trolltech.com]De la part de R. Reucher
Envoyé : mardi 28 avril 2009 15:34
À : qt-interest at trolltech.com
Objet : Re: [Qt-interest] multiple QThread simultaneously


On Tue April 28 2009 15:07:21 NARCISO, Rui wrote:
> Why is this happening ? Can I not have serveral instances of the same
> thread running at the same time ?
Yes, that should be possible, but if you want anyone to analyze "what's wrong" 
you should post a small working peace of your code at least, and the text of 
the error you get... if you think it's the signal you emit in the thread, try 
not to emit it and see if that really changes anything.

Remeber, we can't simply _guess_ what may be wrong without knowing your 
code :).
-- 
René Reucher
rene.reucher at batcom-it.net
http://www.batcom-it.net/

ARIES (Mar 21 - Apr 19)
	You are the pioneer type and hold most people in contempt.  You
	are quick tempered, impatient, and scornful of advice.  You are
	not very nice.

_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest

This mail has originated outside your organization, either from an external partner or the Global Internet.
Keep this in mind if you answer this message.



The information in this e-mail is confidential. The contents may not be disclosed or used by anyone other then the addressee. Access to this e-mail by anyone else is unauthorised.
If you are not the intended recipient, please notify Airbus immediately and delete this e-mail.
Airbus cannot accept any responsibility for the accuracy or completeness of this e-mail as it has been sent over public networks. If you have any concerns over the content of this message or its Accuracy or Integrity, please contact Airbus immediately.
All outgoing e-mails from Airbus are checked using regularly updated virus scanning software but you should take whatever measures you deem to be appropriate to ensure that this message and any attachments are virus free.





More information about the Qt-interest-old mailing list