Results 1 to 3 of 3

Thread: how to track mouse button inside treeItemClickAction?

  1. #1
    Join Date
    Oct 2009
    Posts
    105
    Thanked 4 Times in 2 Posts
    Qt products
    Qt/Embedded
    Platforms
    Unix/X11

    Default how to track mouse button inside treeItemClickAction?

    Hi Everybody.
    Need you peoples help to solve a problem.

    My code is like below.

    Qt Code:
    1. connect(ui->treeWidget, SIGNAL(itemClicked(QTreeWidgetItem*, int)),
    2. this, SLOT(treeItemClickAction(QTreeWidgetItem*, int)));
    To copy to clipboard, switch view to plain text mode 

    If i click the mouse in treewidget Item treeItemClickAction(QTreeWidgetItem*, int) is getting called. But i need to call this methode if i click only left mouse button in the treewidget. and if i pressed the right button in a treewidget Item a new action need to be opened. Or inside treeItemClickAction, can I track which mouse button is pressed.?

    Thank u all.

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

    Default Re: how to track mouse button inside treeItemClickAction?

    Signals are a high level mechanism. If you want to go to a lower level, use events. You will be able to detect which button triggered it.
    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
    Oct 2009
    Posts
    105
    Thanked 4 Times in 2 Posts
    Qt products
    Qt/Embedded
    Platforms
    Unix/X11

    Default Re: how to track mouse button inside treeItemClickAction?

    Quote Originally Posted by wysota View Post
    Signals are a high level mechanism. If you want to go to a lower level, use events. You will be able to detect which button triggered it.
    Thank you very much.

Similar Threads

  1. Mouse move inside control/Widget
    By squidge in forum Newbie
    Replies: 0
    Last Post: 27th September 2009, 16:56
  2. combining Alt + Left Mouse Button
    By speedracer in forum Qt Programming
    Replies: 1
    Last Post: 3rd June 2009, 13:29
  3. QSlider and right mouse button
    By Abnormalia in forum Qt Programming
    Replies: 4
    Last Post: 17th March 2009, 12:13
  4. problem about mouse button events
    By vql in forum Qt Programming
    Replies: 1
    Last Post: 29th April 2008, 10:14
  5. Mouse Over event on button
    By vishal.chauhan in forum Qt Programming
    Replies: 9
    Last Post: 10th January 2007, 05: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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.