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


i'm trying make qtcpserver start separate thread each connection. there's example code available that: http://doc.qt.io/qt-5/qtnetwork-threadedfortuneserver-example.html

this code works subclassing qthread. if build code based on example, i'm pretty running "qobject: cannot create children parent in different thread." warnings.

there documentation qt advises against subclassing qthread, because "doing wrong": http://blog.qt.io/blog/2010/06/17/youre-doing-it-wrong/

so, question is, if qt provided example code directly in violation of qt recommended practice, there example of correct way it? example i've found far subclasses qthread.

qt developing product. and, seem, subclassing qthread still considered legal practice. older technique, old examples use it.

your problem seems wrong usage of qobject(s) across different threads, rather qthread subclassing. first try find code issues warnings.


Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

gradle error "Cannot convert the provided notation to a File or URI" -

python - NameError: name 'subprocess' is not defined -