Q:

How to limit visit times to a method in Qt?

There is a signal--sendMessage(), it will trigger a function--handleMessage(), if I got the signal too many times in a shot time, there will be some issues, so I want to set handleMessage() only can be run one time every 500 ms.
Can some friends kindly tell me how to achieve it?

A:

The way I would do this was to make a member variable bool mMessageSendPending;
Next I would make a member variable QTimer mTimer;
In constructor, I would set up timer like this:
// Run lambda function on timer timeout
connect(&mTimer, &QTimer::timeout, [=](){
    // This code will be run by timer
    if(mMessageSendPending){
        // This will never happen more frequent than 500ms
        handleMessage();
        // Reset to be ready for next send
        mMessageSendPending=false;
    }
});

// Start timer with interval of 500 ms
mTimer.start(500);

// Run lambda function on sendMessage received
connect(&mySender, &MySenderClass::sendMessage, [=](){
    // Mark that we want to handle message.
    // This may happen more frequent than once every 500ms
    mMessageSendPending=true;
});

EDIT: As @Trevir pointed out, this is not safe across thread boundaries. To make it safe, it is suggested to wrap all access to mMessageSendPending in a QMutexLocker with matching QMutex, or alternatively wrap  QAtomicInteger to create an "atomic boolean".

