I have defined a strongly typed enum like this:
enum class RequestType{
type1, type2, type3
};
Also I have a function defined as below:
sendRequest(RequestType request_type){
// actions here
}
I'd like to call the sendRequest
function every 10 seconds so in a simple case I would use something like this:
QTimer * timer = new QTimer(this);
connect(timer, SIGNAL(timeout()), this, SLOT(sendRequest()));
timer->start(10000);
Since I need to pass some arguments to sendRequest
function I guess I have to use QSignalMapper
but as QSignalMapper::setMapping
can be used straightforwardly only for int
and QString
, I cannot figure out how to implement this. Is there any relatively simple way for it?