Can a class inherited from Qthread behave as a normal class?
Can a class inherited from QThread and having run method can have other methods and can it be used like another normal ( not inherited from Q开发者_Go百科Thread) class?
Yes, a class that inherits from QThread is still a normal class. However, care must be taken to synchronize calls to member functions that occur in a different thread context (i.e. calls from outside of the run method) as necessary. Read about Thread Support in Qt for more details. Herb Sutter has a nice collection of articles discussing different aspects of concurrency as well.
精彩评论