perf: Fix more clazy qstring-allocation warnings and pass parameters by reference (#910)
* Fix some more clazy-qstring-allocation warnings * Fix missing refs on large types in lib_gui * Fix trivially copyable types being passed by ref in lib_gui
This commit is contained in:
@@ -143,7 +143,7 @@ QSize QtGraphNode::size() const
|
||||
return QSize(m_size.x, m_size.y);
|
||||
}
|
||||
|
||||
void QtGraphNode::setSize(const QSize& size)
|
||||
void QtGraphNode::setSize(QSize size)
|
||||
{
|
||||
setSize(Vec2i(size.width(), size.height()));
|
||||
}
|
||||
@@ -607,8 +607,8 @@ void QtGraphNode::setStyle(const GraphViewStyle::NodeStyle& style)
|
||||
m_matchText->setPos(
|
||||
style.iconOffset.x + style.iconSize + style.textOffset.x, style.textOffset.y);
|
||||
|
||||
float charWidth = QFontMetrics(font).width(
|
||||
QStringLiteral("QtGraphNode::QtGraphNode::QtGraphNode")) / 37.0f;
|
||||
float charWidth =
|
||||
QFontMetrics(font).width(QStringLiteral("QtGraphNode::QtGraphNode::QtGraphNode")) / 37.0f;
|
||||
float charHeight = QFontMetrics(font).height();
|
||||
m_matchRect->setRect(
|
||||
style.iconOffset.x + style.iconSize + style.textOffset.x + m_matchPos * charWidth,
|
||||
|
||||
Reference in New Issue
Block a user