Flags for a curve leaf. A draggable leaf is a normal drag source; a value-only leaf (string field) stays selectable/highlightable but is never dragged and is tagged so the selection collectors leave it out of the drag payload.
| 166 | // leaf (string field) stays selectable/highlightable but is never dragged and is |
| 167 | // tagged so the selection collectors leave it out of the drag payload. |
| 168 | void applyLeafSelectability(QTreeWidgetItem* item, bool draggable) { |
| 169 | if (draggable) { |
| 170 | item->setFlags(item->flags() | Qt::ItemIsDragEnabled | Qt::ItemIsSelectable); |
| 171 | return; |
| 172 | } |
| 173 | item->setData(kNameColumn, kValueOnlyRole, true); |
| 174 | item->setFlags((item->flags() | Qt::ItemIsSelectable) & ~Qt::ItemIsDragEnabled); |
| 175 | } |
| 176 | |
| 177 | QString catalogKeyForItem(const QTreeWidgetItem* item) { |
| 178 | if (item == nullptr) { |
no test coverage detected