Commit c5749ec5 authored by Mathieu Westphal's avatar Mathieu Westphal Committed by Kitware Robot
Browse files

Merge topic 'release_backports' into release

4306163c

 ArraySelectionWidget preserve array order
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Acked-by: Timothee Chabat's avatarTimothee Chabat <timothee.chabat@kitware.com>
Merge-request: !5689
parents 4c1a974b 4306163c
Pipeline #280337 failed with stages
in 216 minutes and 4 seconds
<?xml version="1.0" ?>
<pqevents>
<pqevent object="pqClientMainWindow/menubar" command="activate" arguments="menuSources" />
<!-- create a source, disable "DistanceSquared" and "Swirl" arrays -->
<pqevent object="pqClientMainWindow/menubar/menuSources/Alphabetical" command="activate" arguments="FastUniformGrid" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/PropertiesFrame/ProxyPanel/GenerateSwirlVectors/CheckBox" command="set_boolean" arguments="false" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/PropertiesFrame/ProxyPanel/GenerateDistanceSquaredScalars/CheckBox" command="set_boolean" arguments="false" />
<!-- create a PassArray (to have a ArraySelectionWidget) -->
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/Accept" command="activate" arguments="" />
<pqevent object="pqClientMainWindow/menubar" command="activate" arguments="menuFilters" />
<pqevent object="pqClientMainWindow/menubar/menuFilters/Alphabetical" command="activate" arguments="PassArrays" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/Accept" command="activate" arguments="" />
<!-- generate "DistanceSquared" that should be the first -->
<pqevent object="pqClientMainWindow/pipelineBrowserDock/pipelineBrowser" command="mousePress" arguments="1,1,0,0,1,/0:0/0:0" />
<pqevent object="pqClientMainWindow/pipelineBrowserDock/pipelineBrowser" command="mouseRelease" arguments="1,0,0,1,11,/0:0/0:0" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/PropertiesFrame/ProxyPanel/GenerateDistanceSquaredScalars/CheckBox" command="set_boolean" arguments="true" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/Accept" command="activate" arguments="" />
<pqevent object="pqClientMainWindow/pipelineBrowserDock/pipelineBrowser" command="mousePress" arguments="1,1,0,1,1,/0:0/0:0/0:0" />
<pqevent object="pqClientMainWindow/pipelineBrowserDock/pipelineBrowser" command="mouseRelease" arguments="1,0,0,1,1,/0:0/0:0/0:0" />
<pqcheck object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/PropertiesFrame/ProxyPanel/PointDataArrays/ArraySelectionWidget" property="modelItemData" arguments="0.0,DistanceSquared" />
<!-- generate "Swirl" that should be second in the list -->
<pqevent object="pqClientMainWindow/pipelineBrowserDock/pipelineBrowser" command="mousePress" arguments="1,1,0,1,1,/0:0/0:0" />
<pqevent object="pqClientMainWindow/pipelineBrowserDock/pipelineBrowser" command="mouseRelease" arguments="1,0,0,1,1,/0:0/0:0" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/PropertiesFrame/ProxyPanel/GenerateSwirlVectors/CheckBox" command="set_boolean" arguments="true" />
<pqevent object="pqClientMainWindow/propertiesDock/propertiesPanel/Accept" command="activate" arguments="" />
<pqevent object="pqClientMainWindow/pipelineBrowserDock/pipelineBrowser" command="mousePress" arguments="1,1,0,1,1,/0:0/0:0/0:0" />
<pqevent object="pqClientMainWindow/pipelineBrowserDock/pipelineBrowser" command="mouseRelease" arguments="1,0,0,1,1,/0:0/0:0/0:0" />
<pqcheck object="pqClientMainWindow/propertiesDock/propertiesPanel/scrollArea/qt_scrollarea_viewport/scrollAreaWidgetContents/PropertiesFrame/ProxyPanel/PointDataArrays/ArraySelectionWidget" property="modelItemData" arguments="1.0,Swirl" />
</pqevents>
......@@ -614,6 +614,7 @@ SET (TESTS_WITHOUT_BASELINES
AboutDialog.xml
AddFieldArrays.xml
ArrayBoundsScaleDomain.xml
ArraySelectionWidget.xml
CustomOutputFormat.xml
DelimitedTextReader.xml
DynamicFieldDataDomain.xml
......
......@@ -132,40 +132,29 @@ public:
void setStatus(const QString& key, const std::map<QString, bool>& value_map)
{
auto& items_map = this->GroupedItemsMap[key];
// any items not in value_map should be removed.
// We want to keep arrays order from "value_map", not previous order.
// Easiest way is to clear all and recreate rows.
for (auto iter = items_map.begin(); iter != items_map.end();)
{
if (value_map.find(iter->first) == value_map.end())
{
this->removeRow(iter->second);
iter = items_map.erase(iter);
}
else
{
++iter;
}
this->removeRow(iter->second);
iter = items_map.erase(iter);
}
const QVariant pixmap = this->Pixmaps.contains(key) ? QVariant(this->Pixmaps[key]) : QVariant();
for (const auto& pair : value_map)
{
auto iter = items_map.find(pair.first);
if (iter == items_map.end())
{
auto item = new QStandardItem(pair.first);
item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable |
Qt::ItemNeverHasChildren);
item->setData(pixmap, Qt::DecorationRole);
this->appendRow(item);
// add to map.
iter = items_map.insert(std::pair<QString, QStandardItem*>(pair.first, item)).first;
}
assert(iter != items_map.end());
assert(iter->second != nullptr);
auto item = new QStandardItem(pair.first);
item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable |
Qt::ItemNeverHasChildren);
item->setData(pixmap, Qt::DecorationRole);
this->appendRow(item);
// add to map.
auto iter = items_map.insert(std::pair<QString, QStandardItem*>(pair.first, item)).first;
iter->second->setCheckState(pair.second ? Qt::Checked : Qt::Unchecked);
}
// potentially changed, so just indicate that.
this->emitHeaderDataChanged();
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment