Re: [Interest] Using QWebSocketServer in a thread other than the GUI thread?

2015-05-27 Thread Thiago Macieira
On Wednesday 27 May 2015 17:34:11 Rainer Wiesenfarth wrote: > The QWebSocketServer does not have a parent. The problem does not occur > with this class itself, but with QNativeSocketEngine, which seems to > exist somewhere in the depth of Qt. > > The QNativeSocketEngine was created by Qt interna

Re: [Interest] Using QWebSocketServer in a thread other than the GUI thread?

2015-05-27 Thread Tony Rietwyk
Rainer wrote: > I would like to add a QWebSocketServer to an existing application. I would > like to have all its operation handled by a thread different from the GUI > thread to get communication separated from the GUI part. If you create the QWebSocketServer in the thread's run override, does

Re: [Interest] Using QWebSocketServer in a thread other than the GUI thread?

2015-05-27 Thread Thiago Macieira
On Wednesday 27 May 2015 10:53:06 Jérôme Godbout wrote: > removing parent is essential http://doc.qt.io/qt-5/qobject.html#moveToThread > "The object cannot be moved if it has a parent." > The children will follow to the new thread. > > For the reparenting, maybe you can shed some light on it. From

Re: [Interest] Using QWebSocketServer in a thread other than the GUI thread?

2015-05-27 Thread Rainer Wiesenfarth
Am 27.05.2015 um 15:49 schrieb Jérôme Godbout: Before making the moveToThread(), remove the parent of the object, ->setParent(nullptr); Once moved, you can reparent with object into that Thread. The QWebSocketServer does not have a parent. The problem does not occur with this class itself, but

Re: [Interest] Using QWebSocketServer in a thread other than the GUI thread?

2015-05-27 Thread Jérôme Godbout
removing parent is essential http://doc.qt.io/qt-5/qobject.html#moveToThread "The object cannot be moved if it has a parent." The children will follow to the new thread. For the reparenting, maybe you can shed some light on it. From what I understand, moveToThread, make that thread responsible to

Re: [Interest] Using QWebSocketServer in a thread other than the GUI thread?

2015-05-27 Thread Thiago Macieira
On Wednesday 27 May 2015 09:49:06 Jérôme Godbout wrote: > Before making the moveToThread(), remove the parent of the object, > ->setParent(nullptr); > Once moved, you can reparent with object into that Thread. No, you cannot. The parent must be another object that lives in the current thread. --

Re: [Interest] Using QWebSocketServer in a thread other than the GUI thread?

2015-05-27 Thread Jérôme Godbout
Before making the moveToThread(), remove the parent of the object, ->setParent(nullptr); Once moved, you can reparent with object into that Thread. Note, if using QItem there's also the QQmlEngine that own the item that is tie to a thread. On Wed, May 27, 2015 at 3:43 AM, Rainer Wiesenfarth < rai

Re: [Interest] Using QWebSocketServer in a thread other than the GUI thread?

2015-05-27 Thread Rainer Wiesenfarth
Am 27.05.2015 um 11:48 schrieb Elvis Stansvik: 2015-05-27 Rainer Wiesenfarth: > Question: Is it possible to use QWebSocketServer in a thread other > than the GUI thread? How? I think the real question is why you would want to do that. [...] In my special case: to create a communication service

Re: [Interest] Using QWebSocketServer in a thread other than the GUI thread?

2015-05-27 Thread Elvis Stansvik
2015-05-27 9:43 GMT+02:00 Rainer Wiesenfarth : > (Qt 5.3.2 Windows msvc-2010 64bit) > > I would like to add a QWebSocketServer to an existing application. I would > like to have all its operation handled by a thread different from the GUI > thread to get communication separated from the GUI part.

[Interest] Using QWebSocketServer in a thread other than the GUI thread?

2015-05-27 Thread Rainer Wiesenfarth
(Qt 5.3.2 Windows msvc-2010 64bit) I would like to add a QWebSocketServer to an existing application. I would like to have all its operation handled by a thread different from the GUI thread to get communication separated from the GUI part. However, when I use moveToThread with the QWebServer