Skip to content

Commit

Permalink
Don't compare QQmlScriptString before setting it. There seems to be
Browse files Browse the repository at this point in the history
a bug in Qt when getting the scriptString from QML that breaks
comparison.  Setting it does actually work though.  This fixes
issue INdT#22.
  • Loading branch information
kenvandine committed Mar 28, 2014
1 parent 284853a commit 023ba4d
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/scriptbehavior.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,12 @@ QQmlScriptString ScriptBehavior::script() const

void ScriptBehavior::setScript(const QQmlScriptString &script)
{
if (m_script.stringLiteral() != script.stringLiteral()) {
m_script = script;
m_script = script;

if (m_expression)
delete m_expression;
if (m_expression)
delete m_expression;

m_expression = new QQmlExpression(m_script);
m_expression = new QQmlExpression(m_script);

emit scriptChanged();
}
emit scriptChanged();
}

0 comments on commit 023ba4d

Please sign in to comment.