Results 1 to 2 of 2

Thread: QPushButton Double Click?

  1. #1
    Join Date
    Sep 2017
    Posts
    29
    Thanks
    3
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Windows

    Smile QPushButton Double Click?

    I want to be able to double click a QPushbutton instead of a single click.

    What I tried:
    Qt Code:
    1. connect(pb, SIGNAL(doubleClicked()), this, SLOT(comBtnPressed()));
    To copy to clipboard, switch view to plain text mode 

    Error says "QObject::connect: No such signal QPushButton::doubleClicked()"

    I chose QPushButton initially, but for my purpose, you can suggest change to other object if it can make a doubleclick event. Not necessarily be a push button.

    Thank you Masters of Qt and C++.
    I am noob. Are you noob? Lets learn Qt together! https://qtnoobies.blogspot.com/

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QPushButton Double Click?

    Error says "QObject::connect: No such signal QPushButton::doubleClicked()"
    A quick look to the QPushButton docmentation would have told you there is no such signal.

    But you can add a double click handler your self to your derived QPushButton.
    Do you know what deriving a class means? (no sarcasm intended. If you don't know, you probably need to learn some basic C++ as this is outside the scope of this forum).
    If you do know, you can ask specific questions to help you achieve what you want.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

Similar Threads

  1. Replies: 4
    Last Post: 11th January 2014, 03:06
  2. Replies: 2
    Last Post: 16th July 2012, 12:40
  3. Using double click in QPushButton
    By nikbits in forum Newbie
    Replies: 1
    Last Post: 16th September 2011, 11:28
  4. Replies: 6
    Last Post: 5th June 2009, 09:38
  5. Replies: 2
    Last Post: 11th January 2009, 23:24

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.