Qt-----[QTextCursor需要注意的問題]

報錯信息爲:

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

原因:多線程情況下連接的信號槽沒有指定方式。

解決方法:指定Qt::QueuedConnection方式

QObject::connect(progress,SIGNAL(processFinished(int)),this,SLOT(ProcessFinished(int)),Qt::QueuedConnection);//Qt::QueuedConnection是隊列模式。

 

改了以後重新編譯一下。

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章