PDA

View Full Version : Count no. of clicks of an icon



aaditya190
25th November 2013, 06:33
Is it possible to count the number of clicks of an icon of the toolbar? If yes, can someone help me with some code...

ChrisW67
25th November 2013, 07:06
Yes.


// private member variable
int m_clickCount;

// in constructor
m_clickCount= 0;
connect(actionObject, SIGNAL(triggered(bool)), SLOT(actionTriggered(bool)));

// private slot
void actionTriggered(bool checked) {
m_clickCount++;
}

aaditya190
25th November 2013, 09:12
It worked... Thank You very much....