Monday, 15 June 2015

qt - QTcpServer - how to multi-thread - example is bad -


I am trying to create a separate thread for each connection, QTcpServer is trying to create an example code which is such that Does:

This code works by sub-closing QT-threads. If I make my code on the basis of that example, then I can not quickly create "QObject:" for children in an original thread. Warning.

There is a document from QT which advises against sub-closing Qtith because it is "doing this wrong":

So, my question is, if the QT example example code Provides QT in violation of the recommended practice, is it the right way to do it? Any examples I have found so far subclasses QThread Qt is a developing product and, I suppose, subclassing Quetad still considered as legal practice. It is just an old technique, so it is used in old examples.

Instead of QThread subclassing your problem, QObject (s) seems to be misused in different threads. Try to find the first code that raises the issue of warning.


No comments:

Post a Comment