Results 1 to 3 of 3

Thread: Handling single click and double click mouse events separately in QTableWidget

  1. #1
    Join Date
    Jul 2012
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Handling single click and double click mouse events separately in QTableWidget

    Hi,

    I have a QTableWidget widget in my application. I need to handle both single-click and double-click mouse events separately for this widget. Currently, I have slots for both the signals but only single-click slot is called even when I double click. How do I handle these two signals separately in my application?

    Thanks,
    Rakesh.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,013 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Handling single click and double click mouse events separately in QTableWidget

    Show us some code, please.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Jul 2012
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Handling single click and double click mouse events separately in QTableWidget

    The following is the code for signal-slot connection:
    connect(ui.tableWidget, SIGNAL(cellClicked(int, int)), this, SLOT(myCellClicked(int, int)));
    connect(ui.tableWidget, SIGNAL(itemDoubleClicked(QTableWidgetItem*)), this, SLOT(tableItemClicked(QTableWidgetItem*)));

Similar Threads

  1. Replies: 7
    Last Post: 26th April 2012, 15:45
  2. Handling mouse click events in QGraphicsItem
    By Luc4 in forum Qt Programming
    Replies: 7
    Last Post: 5th March 2010, 17:12
  3. can not get mouse double click event for QGraphicsItem
    By learning_qt in forum Qt Programming
    Replies: 2
    Last Post: 14th September 2009, 21:36
  4. Replies: 6
    Last Post: 5th June 2009, 10:38
  5. Replies: 2
    Last Post: 12th January 2009, 00:24

Tags for this Thread

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.