src: replaced references to NodeType::Type in GraphViewStyle
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user