Skip to content

Commit

Permalink
+ limit display role of property list items to 10 elements
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed Dec 13, 2015
1 parent e305f07 commit 33c9c02
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Gui/propertyeditor/PropertyItem.cpp
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 33c9c02

Please sign in to comment.