Results 1 to 3 of 3

Thread: Count no. of clicks of an icon

  1. #1
    Join Date
    Nov 2013
    Location
    Chandigarh, India
    Posts
    62
    Thanks
    8
    Thanked 11 Times in 7 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Count no. of clicks of an icon

    Is it possible to count the number of clicks of an icon of the toolbar? If yes, can someone help me with some code...

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Count no. of clicks of an icon

    Yes.
    Qt Code:
    1. // private member variable
    2. int m_clickCount;
    3.  
    4. // in constructor
    5. m_clickCount= 0;
    6. connect(actionObject, SIGNAL(triggered(bool)), SLOT(actionTriggered(bool)));
    7.  
    8. // private slot
    9. void actionTriggered(bool checked) {
    10. m_clickCount++;
    11. }
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    Nov 2013
    Location
    Chandigarh, India
    Posts
    62
    Thanks
    8
    Thanked 11 Times in 7 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: Count no. of clicks of an icon

    It worked... Thank You very much....

Similar Threads

  1. QTreeView: a few clicks crash
    By mentalmushroom in forum Qt Programming
    Replies: 10
    Last Post: 28th January 2012, 07:09
  2. Simulate left and right clicks?
    By hakermania in forum Newbie
    Replies: 5
    Last Post: 8th June 2011, 11:44
  3. Replies: 2
    Last Post: 20th December 2010, 17:51
  4. Replies: 3
    Last Post: 12th May 2010, 13:11
  5. Couple of questions: main window icon + toolbar icon
    By bpackard in forum Qt Programming
    Replies: 0
    Last Post: 20th March 2008, 19:03

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.