Results 1 to 2 of 2

Thread: signal From QcheckBox inside QTreeWidget , itemChanged not working!

  1. #1
    Join Date
    Sep 2016
    Posts
    3
    Qt products
    Platforms
    Unix/X11

    Default signal From QcheckBox inside QTreeWidget , itemChanged not working!

    Hi Everyone,

    So I'm a QtreeWidget SubClass and QtreeWidgetItem SubClass , I'm adding 3 items with 3 columns :

    1st: text
    2nd: QComboBox Widget
    3rd: QCheckBox Widget

    I'm adding the the Qwidgets inside the QtreeWidgetItem subclass with self.treeWidget().setItemWidget() , now when I try to use the QtreeWidget.itemChanged it only picks up the changes in the text of the 1st Column is not picking up the signal when the ComboBox changes or when I tick the checkBox.


    I try to do this the self.checkBox.stateChanged.connect(self.emitItemCh anged), which makes the QtreeWidget.itemChanged get the signal from the checkbox and comboBox , but is getting Column 0 ad the column changed always , when it should be Column 1 and Column 2(Combo, CheckBox) .


    What can I do to fix this behaviour , what is happening? , how can I get the itemChanged to get the signal from this Widgets


    thank you very much in Advance

  2. #2
    Join Date
    Sep 2016
    Posts
    3
    Qt products
    Platforms
    Unix/X11

    Default Re: signal From QcheckBox inside QTreeWidget , itemChanged not working!

    So what I ended up doing to make it work was self.checkBox.Statechange.connect(lambda: self.treeWidget().whenItemChange(self,3)) in the QtreeWidgetItem SubClass , whenItemChange(item,Column) is the Fucntion I call with the itemChanges in the QtreeWidget subclass, self.itemChanged.connec(self.whenItemChange). it feels kind of hacky to do this , but does the job, if somebody has a better solution please let me know.

    cheers

Similar Threads

  1. Replies: 1
    Last Post: 26th October 2015, 08:20
  2. Replies: 2
    Last Post: 22nd August 2013, 10:50
  3. QtreeWidgetItem: setFlags emits QTreeWidget::itemChanged
    By trallallero in forum Qt Programming
    Replies: 4
    Last Post: 30th January 2012, 07:58
  4. Replies: 15
    Last Post: 8th April 2010, 07:16
  5. QTreeWidget signal not working
    By Kapil in forum Newbie
    Replies: 6
    Last Post: 28th April 2006, 10:19

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.