QmlDesigner: fix crash spaces in properties

Task-number: QTCREATORBUG-16059
Change-Id: Ie6e0fa25675e1f800315de4f22558c83b7d2bba1
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
This commit is contained in:
Tim Jenssen
2016-05-31 10:36:06 +02:00
committed by Thomas Hartmann
parent 40a9463c56
commit 6c110d3120
2 changed files with 2 additions and 0 deletions

View File

@@ -58,6 +58,7 @@ AbstractProperty::AbstractProperty(const PropertyName &propertyName, const Inter
m_view(view) m_view(view)
{ {
Q_ASSERT(!m_model || m_view); Q_ASSERT(!m_model || m_view);
Q_ASSERT_X(!m_propertyName.contains(' '), Q_FUNC_INFO, "a property name can not contain a space");
} }
AbstractProperty::AbstractProperty(const Internal::InternalPropertyPointer &property, Model* model, AbstractView *view) AbstractProperty::AbstractProperty(const Internal::InternalPropertyPointer &property, Model* model, AbstractView *view)

View File

@@ -59,6 +59,7 @@ PropertiesComboBox::PropertiesComboBox(QWidget *parent) : QComboBox(parent)
{ {
static QScopedPointer<QStyle> style(QStyleFactory::create(QLatin1String("windows"))); static QScopedPointer<QStyle> style(QStyleFactory::create(QLatin1String("windows")));
setEditable(true); setEditable(true);
setValidator(new QRegularExpressionValidator(QRegularExpression(QLatin1String("[a-z|A-Z|0-9|._-]*")), this));
if (style) if (style)
setStyle(style.data()); setStyle(style.data());
} }