title: How to properly stop thread in class when the class is exposed to QML
body: <p>I have a class that is exposed to QML:</p>
  
  <p>qmlRegisterType("SerialThread", 1, 0, "SerialThread");</p>
  
  <p>This class inherits QThread and the QThread.start() is called from QML.</p>
  
  <p>When the user closes the application, how do I properly exit the thread before the program terminates?</p>