2
我試圖使用一個功能,記錄視頻的選定時間,所以我用一個信號來啓動它,但GUI保持阻止,所以我現在試圖使用QtConcurrent::run
做到這一點在分開的線程中。我有記錄,所以我嘗試從同一類這樣叫它類:QtConcurrent ::運行rigre使用
void VideoProcessor::record(int index, int time, int frames, QString path){
QFuture<void> future = QtConcurrent::run(recordAsync,index,time,frames, path);
}
void VideoProcessor::recordAsync(int index, int time, int frames, QString path)
{
recording code ....
}
或從別的地方是這樣的:
void Controller::StartRecording(int index, int time, int frames, QString path)
{
QFuture<void> future = QtConcurrent::run(&this->videoProcessor,record,index,time,frames, path);
this->videoProcessor->record(index,time,frames,path);
}
,但我把它顯示這個錯誤:
error: no matching function for call to 'run(ab::VideoProcessor**, , int&, int&, int&, QString&)' QFuture future = QtConcurrent::run(&this->videoProcessor,record,index,time,frames, path);
而從別的地方如: 'QFuture未來= QtConcurrent ::運行(,視頻處理器,及,視頻處理器::紀錄,指數,時間,框架,路徑);' –
nib
2014-10-21 08:34:19
@aburbanol它解決了問題嗎? – Nejat 2015-04-14 03:23:42
@Nejat我完全可以這樣做。 – aburbanol 2015-09-15 14:18:34