From 33c9c02aeb702be2ac40d4086b23390ba311bb42 Mon Sep 17 00:00:00 2001 From: wmayer Date: Sun, 13 Dec 2015 12:01:16 +0100 Subject: [PATCH] + limit display role of property list items to 10 elements --- src/Gui/propertyeditor/PropertyItem.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Gui/propertyeditor/PropertyItem.cpp b/src/Gui/propertyeditor/PropertyItem.cpp index 5e9590fb6..5ed167461 100644 --- a/src/Gui/propertyeditor/PropertyItem.cpp +++ b/src/Gui/propertyeditor/PropertyItem.cpp @@ -2003,6 +2003,10 @@ QVariant PropertyStringListItem::editorData(QWidget *editor) const QVariant PropertyStringListItem::toString(const QVariant& prop) const { QStringList list = prop.toStringList(); + if (list.size() > 10) { + list = list.mid(0, 10); + list.append(QLatin1String("...")); + } QString text = QString::fromUtf8("[%1]").arg(list.join(QLatin1String(","))); return QVariant(text); @@ -2072,6 +2076,10 @@ QVariant PropertyFloatListItem::editorData(QWidget *editor) const QVariant PropertyFloatListItem::toString(const QVariant& prop) const { QStringList list = prop.toStringList(); + if (list.size() > 10) { + list = list.mid(0, 10); + list.append(QLatin1String("...")); + } QString text = QString::fromUtf8("[%1]").arg(list.join(QLatin1String(","))); return QVariant(text); @@ -2141,6 +2149,10 @@ QVariant PropertyIntegerListItem::editorData(QWidget *editor) const QVariant PropertyIntegerListItem::toString(const QVariant& prop) const { QStringList list = prop.toStringList(); + if (list.size() > 10) { + list = list.mid(0, 10); + list.append(QLatin1String("...")); + } QString text = QString::fromUtf8("[%1]").arg(list.join(QLatin1String(","))); return QVariant(text);