Skip to content

Commit

Permalink
Gui: [skip-ci] allow user to sort elements in parameter editor by nam…
Browse files Browse the repository at this point in the history
…e/type/value
  • Loading branch information
wwmayer committed Jan 25, 2020
1 parent e434d11 commit f7d0329
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Gui/DlgParameterImp.cpp
Expand Up @@ -76,6 +76,8 @@ DlgParameterImp::DlgParameterImp( QWidget* parent, Qt::WindowFlags fl )
paramValue->setRootIsDecorated(false);
#if QT_VERSION >= 0x050000
paramValue->header()->setSectionResizeMode(0, QHeaderView::Stretch);
paramValue->setSortingEnabled(true);
paramValue->header()->setProperty("showSortIndicator", QVariant(true));
#else
paramValue->header()->setResizeMode(0, QHeaderView::Stretch);
#endif
Expand Down Expand Up @@ -207,6 +209,7 @@ void DlgParameterImp::onGroupSelected( QTreeWidgetItem * item )
{
if ( item && item->type() == QTreeWidgetItem::UserType + 1 )
{
bool sortingEnabled = paramValue->isSortingEnabled();
paramValue->clear();
Base::Reference<ParameterGrp> _hcGrp = static_cast<ParameterGroupItem*>(item)->_hcGrp;
static_cast<ParameterValue*>(paramValue)->setCurrentGroup( _hcGrp );
Expand Down Expand Up @@ -246,6 +249,7 @@ void DlgParameterImp::onGroupSelected( QTreeWidgetItem * item )
{
(void)new ParameterUInt(paramValue,QString::fromUtf8(It6->first.c_str()),It6->second, _hcGrp);
}
paramValue->setSortingEnabled(sortingEnabled);
}
}

Expand Down

0 comments on commit f7d0329

Please sign in to comment.