Commit 904ee4b5 authored by Christiaan Janssen's avatar Christiaan Janssen
Browse files

QmlDesigner.Navigator: Root item cannot be hidden

parent a09b4811
...@@ -208,6 +208,9 @@ NavigatorTreeModel::ItemRow NavigatorTreeModel::createItemRow(const ModelNode &n ...@@ -208,6 +208,9 @@ NavigatorTreeModel::ItemRow NavigatorTreeModel::createItemRow(const ModelNode &n
visibilityItem->setCheckable(true); visibilityItem->setCheckable(true);
visibilityItem->setEditable(false); visibilityItem->setEditable(false);
visibilityItem->setData(hash, Qt::UserRole); visibilityItem->setData(hash, Qt::UserRole);
if (node.isRootNode()) {
visibilityItem->setEnabled(false);
}
#ifdef _LOCK_ITEMS_ #ifdef _LOCK_ITEMS_
return ItemRow(idItem, lockItem, visibilityItem); return ItemRow(idItem, lockItem, visibilityItem);
......
...@@ -108,16 +108,18 @@ void IconCheckboxItemDelegate::paint(QPainter *painter, ...@@ -108,16 +108,18 @@ void IconCheckboxItemDelegate::paint(QPainter *painter,
if (option.state & QStyle::State_Selected) if (option.state & QStyle::State_Selected)
drawSelectionBackground(painter, option); drawSelectionBackground(painter, option);
bool isChecked= (m_TreeModel->itemFromIndex(index)->checkState() == Qt::Checked); if (!m_TreeModel->nodeForIndex(index).isRootNode()) {
if (m_TreeModel->isNodeInvisible( index )) bool isChecked= (m_TreeModel->itemFromIndex(index)->checkState() == Qt::Checked);
painter->setOpacity(0.5);
if (isChecked) if (m_TreeModel->isNodeInvisible( index ))
painter->drawPixmap(option.rect.x()+2,option.rect.y()+5,onPix); painter->setOpacity(0.5);
else
painter->drawPixmap(option.rect.x()+2,option.rect.y()+5,offPix);
if (isChecked)
painter->drawPixmap(option.rect.x()+2,option.rect.y()+5,onPix);
else
painter->drawPixmap(option.rect.x()+2,option.rect.y()+5,offPix);
}
painter->restore(); painter->restore();
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment