Commit a13875da authored by Tim Jenssen's avatar Tim Jenssen Committed by Thomas Hartmann

QmlDesigner: disable validator for source property column

The source column can have contain real code so disable the
validator and trimm the expression because it is compared
with the  already trimmed source in the rewriter.

Change-Id: I0cc684f8446799e3bd4ee77a8a9bb8077164f3b9
Reviewed-by: default avatarThomas Hartmann <Thomas.Hartmann@theqtcompany.com>
parent 1d61239b
......@@ -308,7 +308,7 @@ void BindingModel::updateExpression(int row)
RewriterTransaction transaction =
connectionView()->beginRewriterTransaction(QByteArrayLiteral("BindingModel::updateExpression"));
try {
bindingProperty.setExpression(expression);
bindingProperty.setExpression(expression.trimmed());
transaction.commit(); //committing in the try block
} catch (Exception &e) {
m_exceptionError = e.description();
......
......@@ -71,6 +71,11 @@ void PropertiesComboBox::setText(const QString &text)
setEditText(text);
}
void PropertiesComboBox::disableValidator()
{
setValidator(0);
}
ConnectionComboBox::ConnectionComboBox(QWidget *parent) : PropertiesComboBox(parent)
{
}
......@@ -163,6 +168,7 @@ QWidget *BindingDelegate::createEditor(QWidget *parent, const QStyleOptionViewIt
} break;
case BindingModel::SourcePropertyNameRow: {
bindingComboBox->addItems(model->possibleSourceProperties(bindingProperty));
bindingComboBox->disableValidator();
} break;
default: qWarning() << "BindingDelegate::createEditor column" << index.column();
}
......
......@@ -42,6 +42,7 @@ public:
virtual QString text() const;
void setText(const QString &text);
void disableValidator();
};
class ConnectionComboBox : public PropertiesComboBox
......
Markdown is supported
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