Have a read of "C++ GUI Programming with Qt 3" which can be downloaded from http://www.informit.com/store/produc...sbn=0131240722 in pdf for free. Chaper 17 has a section on multithreading in Qt.
Chris
Have a read of "C++ GUI Programming with Qt 3" which can be downloaded from http://www.informit.com/store/produc...sbn=0131240722 in pdf for free. Chaper 17 has a section on multithreading in Qt.
Chris
Why shouldn't I want signals and slots between thread?
You are talking of Qt 3, aren't you?
My Qt 4.6 docs say that signals and slots between threads work very well.
The QCustomEvent is part of the Qt 3 support library, according to the documentation.
I will give QEvent as base class for my event containing data a try.
But I still believe signals and slots should work.
I was just suggesting using the custom event mechanism because I know for certain it works properly. I've posted messages between threads this way in Qt4 applications.
I don't know whether signalling between threads is valid or otherwise.
Yes you can - http://doc.qt.nokia.com/4.6/threads-...across-threads
Docs say:
Note that connections across threads are queued by default.To use the type T in queued signal and slot connections, qRegisterMetaType<T>() must be called before the first connection is established.
Boron (17th June 2010)
Thanks a lot. numbats' post helped.
Declaring a new metatype right after the class definition in the header file:and aQt Code:
Q_DECLARE_METATYPE(MyTableWidgetRow)To copy to clipboard, switch view to plain text moderight before the first usage in a connection did it.Qt Code:
qRegisterMetaType<MyTableWidgetRow>();To copy to clipboard, switch view to plain text mode
For the future: look in "output" window of your debugger, when you run your application. In your case it had a string:
"use qRegisterMetaType to send "MyTableWidgetRow" in signals/slots"
or something like this
Bookmarks