0
A
回答
4
你不一定繼承的QThread - 看到這裏討論http://labs.qt.nokia.com/2010/06/17/youre-doing-it-wrong/
1
或者,如果你有很多簡單的任務,並希望有他們在螺紋方式處理。 QRunnable
和QThreadPool
提供了一個快速而簡單的方法,而無需處理線程本身。
0
如果你只是想運行在另一個線程的功能,你應該檢查QT Concurrent Namespace.
下面的例子將運行在單獨的線程函數「機能缺失()」,並在那裏調用函數就行不會阻止。當然,有些機制可以理解函數何時結束,以獲得結果,並等待它。
void aFunction(int arg1, double arg2, const QString &string);
int integer = ...;
double floatingPoint = ...;
QString string = ...;
QtConcurrent::run(aFunction, integer, floatingPoint, string);
相關問題
- 1. c中的win32線程
- 2. GTK +的Win32線程
- 3. Win32線程
- 4. 在Win32中創建線程
- 5. 在Win32中的多線程編程
- 6. Perl win32 :: GUI線程
- 7. 等待的Win32線程
- 8. Qt 4.3中的線程池
- 9. qt中的線程同步
- 10. Qt中的線程ID
- 11. QT中的線程問題
- 12. 在Qt中鏈接win32 dll
- 13. Python:多線程中的CherryPy和Win32 API?
- 14. 在win32中執行線程的步驟
- 15. C++線程的Qt
- 16. Qt多線程
- 17. Symbian qt線程
- 18. Win32線程意外退出
- 19. mingw-w64線程:posix vs win32
- 20. 在Qt中收集線程
- 21. 等同於Qt中的Win32'SetProp'?
- 22. 在QT使用Win32 API中的Windows
- 23. Qt:重啓線程
- 24. Qt Jambi和線程
- 25. Qt內部線程
- 26. qt線程選項
- 27. Qt中的線程之間的通信
- 28. Qt - 緩慢的GUI - 線程
- 29. 多線程數據的Qt
- 30. Perl的Qt 3.1和線程