开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜