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
3a0d71ce
Commit
3a0d71ce
authored
Mar 23, 2010
by
Marco Bubke
Committed by
Kai Koehne
Mar 30, 2010
Browse files
Fix opacity bug in the formeditor
Task-Id: BAUHAUS-427
parent
5f268d95
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/plugins/qmldesigner/components/formeditor/formeditoritem.cpp
View file @
3a0d71ce
...
...
@@ -61,7 +61,6 @@ FormEditorItem::FormEditorItem(const QmlItemNode &qmlItemNode, FormEditorScene*
m_snappingLineCreator
(
this
),
m_qmlItemNode
(
qmlItemNode
),
m_borderWidth
(
1.0
),
m_opacity
(
0.6
),
m_highlightBoundingRect
(
false
)
{
setCacheMode
(
QGraphicsItem
::
DeviceCoordinateCache
);
...
...
@@ -70,8 +69,10 @@ FormEditorItem::FormEditorItem(const QmlItemNode &qmlItemNode, FormEditorScene*
void
FormEditorItem
::
setup
()
{
if
(
qmlItemNode
().
hasInstanceParent
())
if
(
qmlItemNode
().
hasInstanceParent
())
{
setParentItem
(
scene
()
->
itemForQmlItemNode
(
qmlItemNode
().
instanceParent
().
toQmlItemNode
()));
setOpacity
(
qmlItemNode
().
instanceValue
(
"opacity"
).
toDouble
());
}
if
(
QGraphicsItem
::
parentItem
()
==
scene
()
->
formLayerItem
())
m_borderWidth
=
0.0
;
...
...
@@ -152,7 +153,6 @@ void FormEditorItem::setAttentionScale(double sinusScale)
void
FormEditorItem
::
setAttentionHighlight
(
double
value
)
{
m_opacity
=
0.6
+
value
;
if
(
QGraphicsItem
::
parentItem
()
==
scene
()
->
formLayerItem
())
m_borderWidth
=
value
*
4
;
else
...
...
@@ -245,14 +245,6 @@ void FormEditorItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *,
painter
->
save
();
painter
->
setRenderHint
(
QPainter
::
Antialiasing
,
true
);
switch
(
scene
()
->
paintMode
())
{
case
FormEditorScene
::
AnchorMode
:
painter
->
setOpacity
(
m_opacity
);
break
;
case
FormEditorScene
::
NormalMode
:
painter
->
setOpacity
(
qmlItemNode
().
instanceValue
(
"opacity"
).
toDouble
());
break
;
}
qmlItemNode
().
paintInstance
(
painter
);
...
...
src/plugins/qmldesigner/components/formeditor/formeditoritem.h
View file @
3a0d71ce
...
...
@@ -121,7 +121,6 @@ private: // variables
QTransform
m_inverseAttentionTransform
;
QRectF
m_boundingRect
;
double
m_borderWidth
;
double
m_opacity
;
bool
m_highlightBoundingRect
;
};
...
...
src/plugins/qmldesigner/components/formeditor/formeditorscene.cpp
View file @
3a0d71ce
...
...
@@ -158,10 +158,14 @@ void FormEditorScene::synchronizeParent(const QmlItemNode &qmlItemNode)
reparentItem
(
qmlItemNode
,
parentNode
);
}
void
FormEditorScene
::
synchronizeOtherProperty
(
const
QmlItemNode
&
qmlItemNode
)
void
FormEditorScene
::
synchronizeOtherProperty
(
const
QmlItemNode
&
qmlItemNode
,
const
QString
&
propertyName
)
{
if
(
hasItemForQmlItemNode
(
qmlItemNode
))
{
FormEditorItem
*
item
=
itemForQmlItemNode
(
qmlItemNode
);
if
(
propertyName
==
"opacity"
)
item
->
setOpacity
(
qmlItemNode
.
instanceValue
(
"opacity"
).
toDouble
());
if
(
item
)
item
->
update
();
}
...
...
src/plugins/qmldesigner/components/formeditor/formeditorscene.h
View file @
3a0d71ce
...
...
@@ -76,7 +76,7 @@ public:
void
synchronizeTransformation
(
const
QmlItemNode
&
qmlItemNode
);
void
synchronizeParent
(
const
QmlItemNode
&
qmlItemNode
);
void
synchronizeOtherProperty
(
const
QmlItemNode
&
qmlItemNode
);
void
synchronizeOtherProperty
(
const
QmlItemNode
&
qmlItemNode
,
const
QString
&
propertyName
);
void
synchronizeState
(
const
QmlItemNode
&
qmlItemNode
);
FormEditorItem
*
calulateNewParent
(
FormEditorItem
*
widget
);
...
...
src/plugins/qmldesigner/components/formeditor/formeditorview.cpp
View file @
3a0d71ce
...
...
@@ -523,14 +523,14 @@ void FormEditorView::parentChanged(const QmlObjectNode &qmlObjectNode)
}
}
void
FormEditorView
::
otherPropertyChanged
(
const
QmlObjectNode
&
qmlObjectNode
,
const
QString
&
/*
propertyName
*/
)
void
FormEditorView
::
otherPropertyChanged
(
const
QmlObjectNode
&
qmlObjectNode
,
const
QString
&
propertyName
)
{
Q_ASSERT
(
qmlObjectNode
.
isValid
());
QmlItemNode
itemNode
=
findRecursiveQmlItemNode
(
qmlObjectNode
);
if
(
itemNode
.
isValid
()
&&
scene
()
->
hasItemForQmlItemNode
(
itemNode
))
{
m_scene
->
synchronizeOtherProperty
(
itemNode
);
m_scene
->
synchronizeOtherProperty
(
itemNode
,
propertyName
);
m_currentTool
->
formEditorItemsChanged
(
QList
<
FormEditorItem
*>
()
<<
m_scene
->
itemForQmlItemNode
(
itemNode
));
}
}
...
...
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