Merge pull request #306 from Scrumplex/limit-instance-lengths
Limit instance names to 128 chars
This commit is contained in:
parent
8b46658b05
commit
58957122b9
@ -44,7 +44,11 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="2">
|
<item row="0" column="2">
|
||||||
<widget class="QLineEdit" name="instNameTextBox"/>
|
<widget class="QLineEdit" name="instNameTextBox">
|
||||||
|
<property name="maxLength">
|
||||||
|
<number>128</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="1">
|
<item row="0" column="1">
|
||||||
<widget class="QLabel" name="nameLabel">
|
<widget class="QLabel" name="nameLabel">
|
||||||
|
@ -405,6 +405,8 @@ void ListViewDelegate::setModelData(QWidget* editor, QAbstractItemModel* model,
|
|||||||
QString text = realeditor->toPlainText();
|
QString text = realeditor->toPlainText();
|
||||||
text.replace(QChar('\n'), QChar(' '));
|
text.replace(QChar('\n'), QChar(' '));
|
||||||
text = text.trimmed();
|
text = text.trimmed();
|
||||||
|
// Prevent instance names longer than 128 chars
|
||||||
|
text.truncate(128);
|
||||||
if(text.size() != 0)
|
if(text.size() != 0)
|
||||||
{
|
{
|
||||||
model->setData(index, text);
|
model->setData(index, text);
|
||||||
|
Loading…
Reference in New Issue
Block a user