#include <ModelAPI_Folder.h>
#include <ModelAPI_AttributeReference.h>
+#include <Config_PropManager.h>
+
#include <QBrush>
#include <QMap>
return QBrush(DISABLED_COLOR);
if (!aFlags.testFlag(Qt::ItemIsEditable))
return QBrush(SELECTABLE_COLOR);
- return ACTIVE_COLOR;
+ return activeItemColor();
}
return ModuleBase_ITreeNode::data(theColumn, theRole);
}
+QColor PartSet_TreeNode::activeItemColor() const
+{
+ return ACTIVE_COLOR;
+}
+
//////////////////////////////////////////////////////////////////////////////////
QVariant PartSet_ObjectNode::data(int theColumn, int theRole) const
AttributeDoublePtr aValueAttribute =
aParam->data()->real(ModelAPI_ResultParameter::VALUE());
QString aVal = QString::number(aValueAttribute->value());
- QString aTitle = QString(myObject->data()->name().c_str());
+ QString aTitle = QString::fromStdWString(myObject->data()->name());
return aTitle + " = " + aVal;
}
- return myObject->data()->name().c_str();
+ return QString::fromStdWString(myObject->data()->name());
}
break;
case Qt::DecorationRole:
return PartSet_TreeNode::data(theColumn, theRole);
}
+QColor PartSet_ObjectNode::activeItemColor() const
+{
+ if (myObject.get() && myObject->groupName() == ModelAPI_Feature::group()) {
+ std::vector<int> aColor =
+ Config_PropManager::color("Visualization", "feature_objectbrowser_color");
+ return QColor(aColor[0], aColor[1], aColor[2]);
+ }
+ return PartSet_TreeNode::activeItemColor();
+}
+
+
Qt::ItemFlags PartSet_ObjectNode::flags(int theColumn) const
{
if (myObject->isDisabled()) {
ResultPartPtr aPartRes = getPartResult(myObject);
if (aPartRes.get()) {
if (aPartRes->partDoc().get() == NULL)
- return QString(myObject->data()->name().c_str()) + " (Not loaded)";
+ return QString::fromStdWString(myObject->data()->name()) + " (Not loaded)";
}
- return QString(myObject->data()->name().c_str());
+ return QString::fromStdWString(myObject->data()->name());
}
case Qt::DecorationRole:
return ModuleBase_IconFactory::get()->getIcon(myObject);
return aResult;
}
+QVariant PartSet_ObjectFolderNode::data(int theColumn, int theRole) const
+{
+ if (theRole == Qt::ForegroundRole) {
+ if (!myObject->isDisabled()) {
+ std::vector<int> aColor =
+ Config_PropManager::color("Visualization", "feature_objectbrowser_color");
+ return QColor(aColor[0], aColor[1], aColor[2]);
+ }
+ }
+ return PartSet_ObjectNode::data(theColumn, theRole);
+}
//////////////////////////////////////////////////////////////////////////////////
QVariant PartSet_StepNode::data(int theColumn, int theRole) const