0

How to remove warnings such as following warnings from the console:

 QObject::startTimer: QTimer can only be used with threads started with QThread
 QObject::startTimer: QTimer can only be used with threads started with QThread
 QObject::startTimer: QTimer can only be used with threads started with QThread

Update: It is just a guess that it raises because I am using ElementTree to parse an XML document into an element tree:

    def parse(source, parser=None):
   tree = ElementTree()
   tree.parse(source, parser)
   return tree

I would appreciate if you guide me which other parser other than ElementTree i can use..

Orcl User
  • 293
  • 1
  • 5
  • 20

1 Answers1

2

It's not a warning, it's an error, and you should not "remove it", you should fix it. It happens because you use QObjects from threads that were not started from a QThread. Probably you're using native python threads. Use QThread instead, and you'll be fine. The XML stuff is a red herring, it seems irrelevant.

Kuba hasn't forgotten Monica
  • 95,931
  • 16
  • 151
  • 313