My problem is: I have a class that inherits from QObject and a function object for use within the function mapped to run qtconcurrent but is not emitted any signal the threads while it's running. Sorry for my English.
Printable View
My problem is: I have a class that inherits from QObject and a function object for use within the function mapped to run qtconcurrent but is not emitted any signal the threads while it's running. Sorry for my English.
Please post some code.
This is the function that use mapped
This is the function objectCode:
Video* Convertir::convertir(Video *v){ if (!v->getError()) { connect(proceso,SIGNAL(readyReadStandardError()),SLOT(procesarSalida()),Qt::DirectConnection); connect(this,SIGNAL(valorTotal(int)),v->getProgreso(),SLOT(setMaximum(int)),Qt::DirectConnection); connect(this,SIGNAL(valorProgreso(int)),v->getProgreso(),SLOT(setValue(int)),Qt::DirectConnection); QStringList parametros; if(formato == "avi" && calidad == "Alta"){ parametros << "-i"<< nombre_fichero << "-sameq" << "-vcodec" << "mpeg2video" << "-y" << salida+f_conv; }else if(formato == "mpg" && calidad == "Alta"){ parametros << "-i"<< nombre_fichero << "-sameq" << "-y" << salida+f_conv; }else if(formato == "avi" && calidad == "Baja"){ parametros << "-i"<< nombre_fichero << "-vcodec" << "mpeg2video"<< "-y" << salida+f_conv; }else parametros << "-i"<< nombre_fichero << "-y" << salida+f_conv; proceso->start("ffmpeg",parametros); } return v; }
Code:
class Convierte{ public: typedef Video* result_type; Video* operator()(Video *v){ Convertir *conv = new Convertir(); conv->convertir(v); return v; } };
The first function belongs to the class Convertir and object function is in the Main Window.
Thanks in advance
And what signals are not emitted? How do you know they are not emitted?
It does not emit any signals. I tried to use qDebug () to print any message to signal QProcess issued readyReadStandardError, also I emitted any signal in the slot and print any message and nothing. I have no idea. I can not inherit from QObject in the function object because it says that the Q_OBJECT macro is private and can not be copied or something please help me with this. Thank you for your interest.
"It" meaning what?
Are you expecting anything on stderr?Quote:
I tried to use qDebug () to print any message to signal QProcess issued readyReadStandardError
I don't see your code emitting any signals.Quote:
also I emitted any signal in the slot
Can't help you without seeing the code. I can just assume you were trying to copy a QObject based object.Quote:
I can not inherit from QObject in the function object because it says that the Q_OBJECT macro is private and can not be copied or something please help me with this.
that's a pretty obvious memory leak you have in covierte operator()...