{
std::string anAttrID = theFilterID + kFilterSeparator + kReverseAttrID;
std::shared_ptr<ModelAPI_AttributeBoolean> aBool = boolean(anAttrID);
- return aBool->value();
+ if (aBool.get())
+ return aBool->value();
+ return false;
}
std::list<AttributePtr> FiltersPlugin_Selection::filterArgs(const std::string theFilterID) const
// Reverse filter button
myRevBtn = new QToolButton(theParent);
myRevBtn->setCheckable(true);
- myRevBtn->setChecked(false);
+ bool isReversed = mySelection->isReversed(myFilterID);
+ myRevBtn->setChecked(isReversed);
myRevBtn->setAutoRaise(true);
- myRevBtn->setIcon(QIcon(":pictures/add.png"));
+ if (isReversed)
+ myRevBtn->setIcon(QIcon(":pictures/reverce.png"));
+ else
+ myRevBtn->setIcon(QIcon(":pictures/add.png"));
myRevBtn->setToolTip(tr("Reverse the filter"));
connect(myRevBtn, SIGNAL(toggled(bool)), SLOT(onReverse(bool)));
aLayout->addWidget(myRevBtn);