mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-20 08:10:52 +01:00
Try Clazy fix-its
clazy is a compiler plugin which allows clang to understand Qt semantics. You get more than 50 Qt related compiler warnings, ranging from unneeded memory allocations to misusage of API, including fix-its for automatic refactoring. https://invent.kde.org/sdk/clazy
This commit is contained in:
@@ -98,7 +98,7 @@ void CrossRefItem::init()
|
||||
*/
|
||||
void CrossRefItem::setUpConnection()
|
||||
{
|
||||
for(const QMetaObject::Connection& c : m_update_connection)
|
||||
for (const QMetaObject::Connection& c : std::as_const(m_update_connection))
|
||||
disconnect(c);
|
||||
|
||||
m_update_connection.clear();
|
||||
@@ -424,7 +424,7 @@ void CrossRefItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
|
||||
*/
|
||||
void CrossRefItem::linkedChanged()
|
||||
{
|
||||
for(const QMetaObject::Connection& c : m_slave_connection)
|
||||
for (const QMetaObject::Connection& c : std::as_const(m_slave_connection))
|
||||
disconnect(c);
|
||||
|
||||
m_slave_connection.clear();
|
||||
@@ -524,7 +524,7 @@ void CrossRefItem::setUpCrossBoundingRect(QPainter &painter)
|
||||
|
||||
//Bounding rect of the NO text
|
||||
QRectF no_bounding;
|
||||
for (auto str : no_str)
|
||||
for (const auto& str : no_str)
|
||||
{
|
||||
QRectF bounding = painter.boundingRect(QRectF (), Qt::AlignCenter, str);
|
||||
no_bounding = no_bounding.united(bounding);
|
||||
@@ -538,7 +538,7 @@ void CrossRefItem::setUpCrossBoundingRect(QPainter &painter)
|
||||
|
||||
//Bounding rect of the NC text
|
||||
QRectF nc_bounding;
|
||||
for (auto str : nc_str)
|
||||
for (const auto& str : nc_str)
|
||||
{
|
||||
QRectF bounding = painter.boundingRect(QRectF (), Qt::AlignCenter, str);
|
||||
nc_bounding = nc_bounding.united(bounding);
|
||||
|
||||
Reference in New Issue
Block a user