SUMMARY In QTreeWidget (and perhaps others), the activated signal is usually triggered by a double click, or by pressing enter. Under Plasma KDE, 'clicked' is also used as a trigger. This does not comply with the expected Qt behavior and cause trouble for cross platform applications. STEPS TO REPRODUCE 0. Install PyQt5 1. Run this script in a terminal: https://pastebin.com/raw/jfNiiFj6 2. Left click on the 'example item' tree widget item 3. Note the stdout OBSERVED RESULT (Manjaro-KDE) pressed clicked activated EXPECTED RESULT (non KDE, Openbox) pressed clicked SOFTWARE/OS VERSIONS Linux/KDE Plasma: Manjaro KDE Plasma Version: 5.15.3 KDE Frameworks Version: 5.56.0 Qt Version: 5.12.2 (built against 5.12.1)
>. This does not comply with the expected Qt behavior From the docs void QAbstractItemView::activated(const QModelIndex &index) This signal is emitted when the item specified by index is activated by the user. How to activate items depends on the platform; e.g., by single- or double-clicking the item, or by pressing the Return or Enter key when the item is current.
The problem is that there are already distinct signals for either click, doubleclick, but none for when Return is pressed on the item. Therefore, it is easy to add a connection to either click or doubleclick if needed, but the only way to add a trigger for Return in this case would be with a keyPressEvent, which is quite a big workaround for a problem that affect a single DE. This is why it is important not to attribute to many signal to activated().
The relevant hint is QStyle::SH_ItemView_ActivateItemOnSingleClick Even if we did change our default to suit this one application you're still broken for any other qstyle that sets that hint. This is an application bug, not a DE one. If you think Qt behaviour should be different, please take that up with Qt.