| 702 | } |
| 703 | |
| 704 | Qt::ItemFlags QmitkMultiLabelTreeModel::flags(const QModelIndex &index) const |
| 705 | { |
| 706 | if (!index.isValid()) |
| 707 | return Qt::NoItemFlags; |
| 708 | |
| 709 | if (!index.isValid()) |
| 710 | return Qt::NoItemFlags; |
| 711 | |
| 712 | auto item = static_cast<QmitkMultiLabelSegTreeItem*>(index.internalPointer()); |
| 713 | |
| 714 | if (!item) |
| 715 | return Qt::NoItemFlags; |
| 716 | |
| 717 | if (TableColumns::NAME_COL != index.column()) |
| 718 | { |
| 719 | if (item->HandleAsInstance() && |
| 720 | ((TableColumns::VISIBLE_COL == index.column() && m_AllowVisibilityModification) || |
| 721 | (TableColumns::COLOR_COL == index.column() && m_AllowVisibilityModification) || //m_AllowVisibilityModification controls visibility and color |
| 722 | (TableColumns::LOCKED_COL == index.column() && m_AllowLockModification))) |
| 723 | { |
| 724 | return Qt::ItemIsEnabled | Qt::ItemIsEditable; |
| 725 | } |
| 726 | else |
| 727 | { |
| 728 | return Qt::ItemIsEnabled; |
| 729 | } |
| 730 | } |
| 731 | else //name column |
| 732 | { |
| 733 | if (item->HandleAsInstance()) |
| 734 | { |
| 735 | return Qt::ItemIsEnabled | Qt::ItemIsSelectable; |
| 736 | } |
| 737 | else |
| 738 | { |
| 739 | return Qt::ItemIsEnabled; |
| 740 | } |
| 741 | } |
| 742 | |
| 743 | return Qt::NoItemFlags; |
| 744 | } |
| 745 | |
| 746 | QVariant QmitkMultiLabelTreeModel::headerData(int section, Qt::Orientation orientation, int role) const |
| 747 | { |
no test coverage detected