Allow configuring if tree widget items are selectable or not

This commit is contained in:
baldurk
2026-05-07 10:55:47 +01:00
parent 97cda2a241
commit c9b9ee51e6
2 changed files with 8 additions and 0 deletions
@@ -162,6 +162,11 @@ public:
if(item->editable(index.column()))
ret |= Qt::ItemIsEditable;
if(item->selectable())
ret |= Qt::ItemIsSelectable;
else
ret &= ~Qt::ItemIsSelectable;
return ret;
}
@@ -134,6 +134,8 @@ public:
else
m_editable &= ~mask;
}
inline bool selectable() const { return m_selectable; }
inline void setSelectable(bool sel) { m_selectable = sel; }
inline Qt::CheckState checkState(int column) const
{
@@ -180,6 +182,7 @@ private:
uint32_t m_editable = 0;
// per-item properties
bool m_selectable = true;
QString m_tooltip;
bool m_bold = false;
bool m_italic = false;