C ++ / Qt-QThread与QRunnable [英] C++/Qt - QThread vs QRunnable

查看:301
本文介绍了C ++ / Qt-QThread与QRunnable的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

QThreads和QRunnable有什么区别?

What are the differences between QThreads and QRunnable ?

何时应使用QThread和QRunnable?

When should I use QThread and when QRunnable ?

推荐答案

QRunnable 类和 QtConcurrent :: run()函数是非常适合我们想要在一个或多个
辅助线程中执行某些后台处理而无需
QThread提供的全部功能和灵活性的情况。

The QRunnable class and the QtConcurrent::run() function are well suited to situations where we want to perform some background processing in one or more secondary threads without needing the full power and flexibility provided by QThread.

摘自Mark Summerfield的 高级Qt编程:使用C ++和Qt 4创建出色的软件

from "Advanced Qt Programming: Creating Great Software with C++ and Qt 4" by Mark Summerfield

这篇关于C ++ / Qt-QThread与QRunnable的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆