Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
369b63ec
Commit
369b63ec
authored
Jul 13, 2010
by
Lasse Holmstedt
Committed by
Olivier Goffart
Jul 14, 2010
Browse files
added flags for ignoring context while highlighting
parent
8936292d
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/tools/qml/qmlviewer/qdeclarativedesignview.cpp
View file @
369b63ec
...
...
@@ -274,19 +274,22 @@ void QDeclarativeDesignView::clearHighlight()
m_boundingRectHighlighter
->
clear
();
}
void
QDeclarativeDesignView
::
highlight
(
QGraphicsItem
*
item
)
void
QDeclarativeDesignView
::
highlight
(
QGraphicsItem
*
item
,
ContextFlags
flags
)
{
highlight
(
QList
<
QGraphicsItem
*>
()
<<
item
);
highlight
(
QList
<
QGraphicsItem
*>
()
<<
item
,
flags
);
}
void
QDeclarativeDesignView
::
highlight
(
QList
<
QGraphicsItem
*>
items
)
void
QDeclarativeDesignView
::
highlight
(
QList
<
QGraphicsItem
*>
items
,
ContextFlags
flags
)
{
if
(
items
.
isEmpty
())
return
;
QList
<
QGraphicsObject
*>
objectList
;
foreach
(
QGraphicsItem
*
item
,
items
)
{
QGraphicsItem
*
child
=
m_subcomponentEditorTool
->
firstChildOfContext
(
item
);
QGraphicsItem
*
child
=
item
;
if
(
flags
&
ContextSensitive
)
child
=
m_subcomponentEditorTool
->
firstChildOfContext
(
item
);
if
(
child
)
{
QGraphicsObject
*
childObject
=
child
->
toGraphicsObject
();
if
(
childObject
)
...
...
@@ -457,7 +460,6 @@ QList<QGraphicsItem*> QDeclarativeDesignView::filterForCurrentContext(QList<QGra
itemlist
.
removeAt
(
index
);
}
}
}
return
itemlist
;
...
...
@@ -491,8 +493,7 @@ void QDeclarativeDesignView::onCurrentObjectsChanged(QList<QObject*> objects)
setSelectedItems
(
items
);
clearHighlight
();
if
(
!
items
.
isEmpty
())
highlight
(
items
);
highlight
(
items
,
IgnoreContext
);
}
QToolBar
*
QDeclarativeDesignView
::
toolbar
()
const
...
...
src/tools/qml/qmlviewer/qdeclarativedesignview.h
View file @
369b63ec
...
...
@@ -23,6 +23,10 @@ class QDeclarativeDesignView : public QDeclarativeView
{
Q_OBJECT
public:
enum
ContextFlags
{
IgnoreContext
,
ContextSensitive
};
explicit
QDeclarativeDesignView
(
QWidget
*
parent
=
0
);
~
QDeclarativeDesignView
();
...
...
@@ -36,8 +40,8 @@ public:
Constants
::
ToolFlags
flags
=
Constants
::
NoToolFlags
);
void
clearHighlight
();
void
highlight
(
QList
<
QGraphicsItem
*>
item
);
void
highlight
(
QGraphicsItem
*
item
);
void
highlight
(
QList
<
QGraphicsItem
*>
item
,
ContextFlags
flags
=
ContextSensitive
);
void
highlight
(
QGraphicsItem
*
item
,
ContextFlags
flags
=
ContextSensitive
);
bool
mouseInsideContextItem
()
const
;
bool
isEditorItem
(
QGraphicsItem
*
item
)
const
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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