Results 1 to 4 of 4

Thread: double clicked on an item QTreeWidget

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    Apr 2010
    Location
    Sudan
    Posts
    46
    Thanks
    7
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: double clicked on an item QTreeWidget

    How can i find which item is clicked ??
    you can do this by checking the text of the item clicked :

    Qt Code:
    1. void MainWindow::treeViewClicked(QModelIndex index)
    2. {
    3. if(index.data().toString()=="TableRecipts")
    4. createTableReciptsModel();
    5. }
    To copy to clipboard, switch view to plain text mode 

    or, if you have more than row with the same text , you can check both the text and the index :

    Qt Code:
    1. else if(customersTreeValue=="totalBounty"&&index.row()==0)
    2. {
    3. totalBountyClicked();
    4. }
    To copy to clipboard, switch view to plain text mode 

    i hope i was helpful .

  2. The following user says thank you to tinysoft for this useful post:

    milli (7th May 2011)

Similar Threads

  1. Getting the Id of a double clicked item
    By thefatladysingsopera in forum Qt Programming
    Replies: 1
    Last Post: 30th April 2011, 14:18
  2. Replies: 1
    Last Post: 16th December 2009, 02:48
  3. Replies: 12
    Last Post: 24th July 2009, 10:38
  4. Replies: 1
    Last Post: 17th July 2008, 14:42
  5. QTableWidget::item to Double?
    By Afflicted.d2 in forum Qt Programming
    Replies: 2
    Last Post: 30th October 2006, 06:23

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.