If you use QTreeView, then you can't use QTreeWidget methods.

Use QAbstractITemModel::clicked() signal to get the model index and then ask your model for data for that index.