Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tobias Hunger
qt-creator
Commits
904ee4b5
Commit
904ee4b5
authored
Feb 18, 2010
by
Christiaan Janssen
Browse files
QmlDesigner.Navigator: Root item cannot be hidden
parent
a09b4811
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp
View file @
904ee4b5
...
@@ -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
);
...
...
src/plugins/qmldesigner/components/navigator/navigatortreeview.cpp
View file @
904ee4b5
...
@@ -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
->
itemFrom
Index
(
index
)
->
checkStat
e
()
==
Qt
::
Checked
);
if
(
!
m_TreeModel
->
nodeFor
Index
(
index
)
.
isRootNod
e
()
)
{
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
();
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment