Content Table

Qt 中使用多线程，最简单直观的方法就是继承 QThread，重写 run() 方法，需要使用多线程执行的代码放在 run() 函数中，调用 start() 函数启动线程，线程正在运行时 isRunning() 返回 true，结束运行后发出信号 finished()

## 实现线程

QObject::connect: Cannot queue arguments of type ‘QTextCursor’
(Make sure ‘QTextCursor’ is registered using qRegisterMetaType().)

## 结束线程

void QThread::terminate()

Terminates the execution of the thread. The thread may or may not be terminated immediately, depending on the operating system’s scheduling policies. Use QThread::wait() after terminate(), to be sure.

Warning: This function is dangerous and its use is discouraged. The thread can be terminated at any point in its code path. Threads can be terminated while modifying data. There is no chance for the thread to clean up after itself, unlock any held mutexes, etc. In short, use this function only if absolutely necessary.