Results 1 to 4 of 4

Thread: when click the text of QTreeWidgetItem,let it no reaction

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2009
    Location
    Gansu,China
    Posts
    188
    Qt products
    Qt4
    Platforms
    Windows

    Default when click the text of QTreeWidgetItem,let it no reaction

    I create a tree with

    and add signal and slots to it with the following code:

    Qt Code:
    1. connect(tree,SIGNAL(itemPressed(QTreeWidgetItem *, int)), this,SLOT(SlotItemClicked(QTreeWidgetItem *, int)));
    To copy to clipboard, switch view to plain text mode 

    I create a tree item of it with QTreeWidgetItem,and set it checked with setCheckState(0,Qt::Checked);
    When I don't click checkbox of the tree item but the text of it,I find that it still has reaction,that is,the slot SlotItemClicked() still executes,but the check state of the tree item does not change.
    Now I want to it reacts only the checkbox of the tree item is clicked.
    How to do it?
    Last edited by weixj2003ld; 13th March 2012 at 01:37.

Similar Threads

  1. Edit Text of a QPushButton with mouse right click
    By theria05 in forum Qt Programming
    Replies: 6
    Last Post: 8th December 2010, 18:49
  2. QTreeWidgetItem text color
    By Arthur in forum Qt Programming
    Replies: 2
    Last Post: 13th October 2009, 16:59
  3. set color in QTreeWidgetItem text
    By mattia in forum Newbie
    Replies: 2
    Last Post: 7th January 2008, 09:06
  4. formatted text in QTreeWidgetItem
    By swiety in forum Qt Programming
    Replies: 1
    Last Post: 30th October 2007, 16:26
  5. QTreeWidgetItem setting color for the text
    By arjunasd in forum Qt Programming
    Replies: 1
    Last Post: 29th August 2007, 17:22

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.