| Summary: | Clicked signal wrongly used as a trigger for activated signal (QTreeWidget, PyQt5) | ||
|---|---|---|---|
| Product: | [Plasma] plasma-integration | Reporter: | william.belr |
| Component: | general | Assignee: | Plasma Bugs List <plasma-bugs-null> |
| Status: | CLOSED NOT A BUG | ||
| Severity: | normal | CC: | kde, plasma-bugs-null |
| Priority: | NOR | ||
| Version First Reported In: | 5.15.3 | ||
| Target Milestone: | --- | ||
| Platform: | Other | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
william.belr
2019-04-10 05:16:42 UTC
>. 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. |