data: save undefined in database field instead of using different node types

* expand toggle also for undefined classes
* changed direction of some template edges
* save same access component to specialized template functions and classes
This commit is contained in:
Eberhard Graether
2015-10-08 23:12:37 +02:00
parent ebeaff2724
commit c553e29ff8
20 changed files with 249 additions and 301 deletions
+1 -1
View File
@@ -104,7 +104,7 @@ void QtAutocompletionDelegate::paint(QPainter* painter, const QStyleOptionViewIt
QColor color("#FFFFFF");
Node::NodeType nodeType = static_cast<Node::NodeType>(index.sibling(index.row(), index.column() + 3).data().toInt());
if (type.size() && nodeType)
if (type.size())
{
color = QColor(scheme->getNodeTypeColor(nodeType).c_str());
}
@@ -20,7 +20,13 @@ QtGraphNodeData::QtGraphNodeData(const Node* data, bool hasParent, bool childVis
this->setName(data->getName());
}
this->setToolTip(QString::fromStdString(data->getTypeString()));
std::string toolTip = data->getTypeString();
if (!data->isDefined() && !data->isType(Node::NODE_UNDEFINED))
{
toolTip = "undefined " + toolTip;
}
this->setToolTip(QString::fromStdString(toolTip));
}
QtGraphNodeData::~QtGraphNodeData()
@@ -59,7 +65,7 @@ void QtGraphNodeData::moved(const Vec2i& oldPosition)
void QtGraphNodeData::updateStyle()
{
GraphViewStyle::NodeStyle style =
GraphViewStyle::getStyleForNodeType(m_data->getType(), m_isActive, m_isHovering, m_childVisible);
GraphViewStyle::getStyleForNodeType(m_data->getType(), m_data->isDefined(), m_isActive, m_isHovering, m_childVisible);
setStyle(style);
}