Commit 893020ae authored by Marco Bubke's avatar Marco Bubke
Browse files

QmlDesigner: We should test if untracked items are dirty too



Change-Id: I94db08fff3e7e38a9cc377d06a5aabc6d886b64e
Reviewed-by: default avatarThomas Hartmann <Thomas.Hartmann@digia.com>
parent cec82a13
...@@ -86,6 +86,26 @@ void Qt5InformationNodeInstanceServer::token(const TokenCommand &command) ...@@ -86,6 +86,26 @@ void Qt5InformationNodeInstanceServer::token(const TokenCommand &command)
startRenderTimer(); startRenderTimer();
} }
bool Qt5InformationNodeInstanceServer::isDirtyRecursiveForNonInstanceItems(QQuickItem *item) const
{
static DesignerSupport::DirtyType informationsDirty = DesignerSupport::DirtyType(DesignerSupport::TransformUpdateMask
| DesignerSupport::ContentUpdateMask
| DesignerSupport::Visible
| DesignerSupport::ZValue
| DesignerSupport::OpacityValue);
if (DesignerSupport::isDirty(item, informationsDirty))
return true;
foreach (QQuickItem *childItem, item->childItems()) {
if (!hasInstanceForObject(childItem) && DesignerSupport::isDirty(childItem, informationsDirty))
return true;
}
return false;
}
void Qt5InformationNodeInstanceServer::collectItemChangesAndSendChangeCommands() void Qt5InformationNodeInstanceServer::collectItemChangesAndSendChangeCommands()
{ {
static bool inFunction = false; static bool inFunction = false;
...@@ -103,12 +123,7 @@ void Qt5InformationNodeInstanceServer::collectItemChangesAndSendChangeCommands() ...@@ -103,12 +123,7 @@ void Qt5InformationNodeInstanceServer::collectItemChangesAndSendChangeCommands()
if (item && hasInstanceForObject(item)) { if (item && hasInstanceForObject(item)) {
ServerNodeInstance instance = instanceForObject(item); ServerNodeInstance instance = instanceForObject(item);
DesignerSupport::DirtyType informationsDirty = DesignerSupport::DirtyType(DesignerSupport::TransformUpdateMask if (isDirtyRecursiveForNonInstanceItems(item))
| DesignerSupport::ContentUpdateMask
| DesignerSupport::Visible
| DesignerSupport::ZValue
| DesignerSupport::OpacityValue);
if (DesignerSupport::isDirty(item, informationsDirty))
informationChangedInstanceSet.insert(instance); informationChangedInstanceSet.insert(instance);
......
...@@ -52,7 +52,7 @@ protected: ...@@ -52,7 +52,7 @@ protected:
void collectItemChangesAndSendChangeCommands() Q_DECL_OVERRIDE; void collectItemChangesAndSendChangeCommands() Q_DECL_OVERRIDE;
void sendChildrenChangedCommand(const QList<ServerNodeInstance> childList); void sendChildrenChangedCommand(const QList<ServerNodeInstance> childList);
void sendTokenBack(); void sendTokenBack();
bool isDirtyRecursiveForNonInstanceItems(QQuickItem *item) const;
private: private:
QSet<ServerNodeInstance> m_parentChangedSet; QSet<ServerNodeInstance> m_parentChangedSet;
......
Supports Markdown
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