src: replaced references to NodeType::Type in GraphViewStyle

This commit is contained in:
mlangkabel
2017-11-23 17:16:59 +01:00
parent 90e17c5868
commit 74dc4bbe5b
12 changed files with 198 additions and 160 deletions
+4 -4
View File
@@ -9,14 +9,14 @@ QtGraphViewStyleImpl::~QtGraphViewStyleImpl()
{
}
float QtGraphViewStyleImpl::getCharWidthForNodeType(NodeType type)
float QtGraphViewStyleImpl::getCharWidth(NodeType::StyleType type)
{
return QFontMetrics(QtGraphNode::getFontForNodeType(type)).width("QtGraphNode::QtGraphNode::QtGraphNode") / 37.0f;
return QFontMetrics(QtGraphNode::getFontForStyleType(type)).width("QtGraphNode::QtGraphNode::QtGraphNode") / 37.0f;
}
float QtGraphViewStyleImpl::getCharHeightForNodeType(NodeType type)
float QtGraphViewStyleImpl::getCharHeight(NodeType::StyleType type)
{
return QFontMetrics(QtGraphNode::getFontForNodeType(type)).height();
return QFontMetrics(QtGraphNode::getFontForStyleType(type)).height();
}
float QtGraphViewStyleImpl::getGraphViewZoomDifferenceForPlatform()
+3 -3
View File
@@ -8,9 +8,9 @@ class QtGraphViewStyleImpl
{
public:
virtual ~QtGraphViewStyleImpl();
virtual float getCharWidthForNodeType(NodeType type);
virtual float getCharHeightForNodeType(NodeType type);
virtual float getGraphViewZoomDifferenceForPlatform();
virtual float getCharWidth(NodeType::StyleType type) override;
virtual float getCharHeight(NodeType::StyleType type) override;
virtual float getGraphViewZoomDifferenceForPlatform() override;
};
#endif // QT_GRAPH_VIEW_STYLE_IMPL_H
@@ -34,10 +34,10 @@ void QtGraphNode::hideNode()
this->hide();
}
QFont QtGraphNode::getFontForNodeType(NodeType type)
QFont QtGraphNode::getFontForStyleType(NodeType::StyleType type)
{
QFont font(GraphViewStyle::getFontNameForDataNode().c_str());
font.setPixelSize(GraphViewStyle::getFontSizeForNodeType(type));
font.setPixelSize(GraphViewStyle::getFontSizeForStyleType(type));
return font;
}
@@ -508,9 +508,9 @@ void QtGraphNode::setStyle(const GraphViewStyle::NodeStyle& style)
m_undefinedRect->show();
}
if (!m_icon && style.iconPath.size())
if (!m_icon && !style.iconPath.empty())
{
QtDeviceScaledPixmap pixmap(QString::fromStdString(style.iconPath));
QtDeviceScaledPixmap pixmap(QString::fromStdString(style.iconPath.str()));
pixmap.scaleToHeight(style.iconSize);
m_icon = new QGraphicsPixmapItem(utility::colorizePixmap(pixmap.pixmap(), style.color.icon.c_str()), this);
@@ -31,7 +31,7 @@ public slots:
void hideNode();
public:
static QFont getFontForNodeType(NodeType type);
static QFont getFontForStyleType(NodeType::StyleType type);
QtGraphNode();
virtual ~QtGraphNode();