QTreeWidget Signal itemDoubleClicked Returns QModelIndex?

  • I have a QTreeWidget with QTreeWidgetItems or in my case CustomTreeItems and when I use the signal itemDoubleClicked instead of returning a QTreeWidgetItem it returns a QModelIndex. Is this normal behavior?


    def on_double_click_tree(self, currItem):
            print("row: ",currItem.row())
            print("data: ",currItem.data())
            print("parent: ",currItem.parent())
    def on_select_tree_item(self, currItem):

    A single click returns a CustomTreeItem (QTreeWidgetItem) which is expected, however a double click returns the QModelIndex which is not expected.


  • Yes, but you can access the Data by using the method data() from the QModelIndex

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.