wysota, it was
{
Q_OBJECT
public:
MyObject(...);
...
QLocalSocket* sock;
};
MyObject::MyObject(...)
{
sock = new QLocalSocket();
}
class MyObject : public QObject
{
Q_OBJECT
public:
MyObject(...);
...
QLocalSocket* sock;
};
MyObject::MyObject(...)
{
sock = new QLocalSocket();
}
To copy to clipboard, switch view to plain text mode
But, after reading your comment I tried it with
sock = new QLocalSocket(this);
and indeed, like you said, sock *did* pick up the thread affinity of the parent. So it looks like the ConnectSignal workaround I came up with earlier wasn't necessary. So, thanks indeed for the insight and better solution. But it's still the case that *unless* you make a class member the child of the class instance, then member thread affinity is not changed when class affinity is, no?
Matt
Bookmarks