mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-03-03 04:00:00 +01:00
Apply clang-tidy's performance-unnecessary-value-param, performance-for-
range-copy git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@5448 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -41,7 +41,7 @@ class ConductorXmlRetroCompatibility
|
||||
{
|
||||
friend class Conductor;
|
||||
|
||||
static void loadSequential(const QDomElement &dom_element, QString seq, QStringList* list)
|
||||
static void loadSequential(const QDomElement &dom_element, const QString& seq, QStringList* list)
|
||||
{
|
||||
int i = 0;
|
||||
while (!dom_element.attribute(seq + QString::number(i+1)).isEmpty())
|
||||
@@ -939,7 +939,7 @@ QList<QPointF> Conductor::segmentsToPoints() const {
|
||||
Regenere les segments de ce conducteur a partir de la liste de points passee en parametre
|
||||
@param points_list Liste de points a utiliser pour generer les segments
|
||||
*/
|
||||
void Conductor::pointsToSegments(QList<QPointF> points_list) {
|
||||
void Conductor::pointsToSegments(const QList<QPointF>& points_list) {
|
||||
// supprime les segments actuels
|
||||
deleteSegments();
|
||||
|
||||
@@ -1667,7 +1667,7 @@ void Conductor::editProperty() {
|
||||
ConductorPropertiesDialog::PropertiesDialog(this, diagramEditor());
|
||||
}
|
||||
|
||||
void Conductor::setSequenceNum(autonum::sequentialNumbers sn)
|
||||
void Conductor::setSequenceNum(const autonum::sequentialNumbers& sn)
|
||||
{
|
||||
m_autoNum_seq = sn;
|
||||
refreshText();
|
||||
|
||||
@@ -121,7 +121,7 @@ class Conductor : public QGraphicsObject
|
||||
|
||||
autonum::sequentialNumbers sequenceNum () const {return m_autoNum_seq;}
|
||||
autonum::sequentialNumbers& rSequenceNum() {return m_autoNum_seq;}
|
||||
void setSequenceNum(autonum::sequentialNumbers sn);
|
||||
void setSequenceNum(const autonum::sequentialNumbers& sn);
|
||||
|
||||
private:
|
||||
void setUpConnectionForFormula(QString old_formula, QString new_formula);
|
||||
@@ -194,7 +194,7 @@ class Conductor : public QGraphicsObject
|
||||
QList<QPointF> segmentsToPoints() const;
|
||||
QList<ConductorBend> bends() const;
|
||||
QList<QPointF> junctions() const;
|
||||
void pointsToSegments(QList<QPointF>);
|
||||
void pointsToSegments(const QList<QPointF>&);
|
||||
Qt::Corner currentPathType() const;
|
||||
void deleteSegments();
|
||||
static int getCoeff(const qreal &, const qreal &);
|
||||
|
||||
@@ -96,7 +96,7 @@ void CrossRefItem::init()
|
||||
*/
|
||||
void CrossRefItem::setUpConnection()
|
||||
{
|
||||
for(QMetaObject::Connection c : m_update_connection)
|
||||
for(const QMetaObject::Connection& c : m_update_connection)
|
||||
disconnect(c);
|
||||
|
||||
m_update_connection.clear();
|
||||
@@ -369,7 +369,7 @@ void CrossRefItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
|
||||
|
||||
void CrossRefItem::linkedChanged()
|
||||
{
|
||||
for(QMetaObject::Connection c : m_slave_connection)
|
||||
for(const QMetaObject::Connection& c : m_slave_connection)
|
||||
disconnect(c);
|
||||
|
||||
m_slave_connection.clear();
|
||||
@@ -781,7 +781,7 @@ void CrossRefItem::fillCrossRef(QPainter &painter)
|
||||
* @param painter painter to use for draw the text
|
||||
* @param type type of Info do be draw e.g. comment, location.
|
||||
*/
|
||||
void CrossRefItem::AddExtraInfo(QPainter &painter, QString type)
|
||||
void CrossRefItem::AddExtraInfo(QPainter &painter, const QString& type)
|
||||
{
|
||||
QString text = autonum::AssignVariables::formulaToLabel(m_element -> elementInformations()[type].toString(), m_element->rSequenceStruct(), m_element->diagram(), m_element);
|
||||
bool must_show = m_element -> elementInformations().keyMustShow(type);
|
||||
|
||||
@@ -91,7 +91,7 @@ class CrossRefItem : public QGraphicsObject
|
||||
void drawAsContacts (QPainter &painter);
|
||||
QRectF drawContact (QPainter &painter, int flags, Element *elmt);
|
||||
void fillCrossRef (QPainter &painter);
|
||||
void AddExtraInfo (QPainter &painter, QString);
|
||||
void AddExtraInfo (QPainter &painter, const QString&);
|
||||
QList<Element *> NOElements() const;
|
||||
QList<Element *> NCElements() const;
|
||||
|
||||
|
||||
@@ -163,7 +163,7 @@ int DiagramTextItem::fontSize() const
|
||||
return font().pointSize();
|
||||
}
|
||||
|
||||
void DiagramTextItem::setColor(QColor color)
|
||||
void DiagramTextItem::setColor(const QColor& color)
|
||||
{
|
||||
setDefaultTextColor(color);
|
||||
emit colorChanged(color);
|
||||
|
||||
@@ -68,7 +68,7 @@ class DiagramTextItem : public QGraphicsTextItem
|
||||
void setFontSize(int s);
|
||||
int fontSize()const;
|
||||
|
||||
void setColor(QColor color);
|
||||
void setColor(const QColor& color);
|
||||
QColor color() const;
|
||||
|
||||
void setNoEditable(bool e = true) {m_no_editable = e;}
|
||||
|
||||
@@ -969,7 +969,7 @@ void DynamicElementTextItem::setupFormulaConnection()
|
||||
|
||||
void DynamicElementTextItem::clearFormulaConnection()
|
||||
{
|
||||
for (QMetaObject::Connection con : m_formula_connection)
|
||||
for (const QMetaObject::Connection& con : m_formula_connection)
|
||||
disconnect(con);
|
||||
m_formula_connection.clear();
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include "conductor.h"
|
||||
#include "diagramcommands.h"
|
||||
#include <QtDebug>
|
||||
#include <utility>
|
||||
#include "elementprovider.h"
|
||||
#include "diagramposition.h"
|
||||
#include "terminal.h"
|
||||
@@ -35,7 +36,7 @@ class ElementXmlRetroCompatibility
|
||||
{
|
||||
friend class Element;
|
||||
|
||||
static void loadSequential(const QDomElement &dom_element, QString seq, QStringList* list)
|
||||
static void loadSequential(const QDomElement &dom_element, const QString& seq, QStringList* list)
|
||||
{
|
||||
int i = 0;
|
||||
while (!dom_element.attribute(seq + QString::number(i+1)).isEmpty())
|
||||
@@ -451,7 +452,7 @@ bool Element::fromXml(QDomElement &e, QHash<int, Terminal *> &table_id_adr, bool
|
||||
//************************//
|
||||
//***Dynamic texts item***//
|
||||
//************************//
|
||||
for (QDomElement qde : QET::findInDomElement(e, "dynamic_texts", DynamicElementTextItem::xmlTaggName()))
|
||||
for (const QDomElement& qde : QET::findInDomElement(e, "dynamic_texts", DynamicElementTextItem::xmlTaggName()))
|
||||
{
|
||||
DynamicElementTextItem *deti = new DynamicElementTextItem(this);
|
||||
addDynamicTextItem(deti);
|
||||
@@ -471,7 +472,7 @@ bool Element::fromXml(QDomElement &e, QHash<int, Terminal *> &table_id_adr, bool
|
||||
|
||||
for (DynamicElementTextItem *deti : conv_deti_list)
|
||||
{
|
||||
for(QDomElement dom_input : dom_inputs)
|
||||
for(const QDomElement& dom_input : dom_inputs)
|
||||
{
|
||||
//we use the same method used in ElementTextItem::fromXml to compar and know if the input dom element is for one of the text stored.
|
||||
//The comparaison is made from the text position : if the position of the text is the same as the position stored in 'input' dom element
|
||||
@@ -1235,7 +1236,7 @@ QString Element::getPrefix() const{
|
||||
* set Element Prefix
|
||||
*/
|
||||
void Element::setPrefix(QString prefix) {
|
||||
m_prefix = prefix;
|
||||
m_prefix = std::move(prefix);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
|
||||
#include <QPainter>
|
||||
#include <QGraphicsSceneMouseEvent>
|
||||
#include <utility>
|
||||
|
||||
bool sorting(QGraphicsItem *qgia, QGraphicsItem *qgib)
|
||||
{
|
||||
@@ -253,7 +254,7 @@ void ElementTextItemGroup::setVerticalAdjustment(int v)
|
||||
*/
|
||||
void ElementTextItemGroup::setName(QString name)
|
||||
{
|
||||
m_name = name;
|
||||
m_name = std::move(name);
|
||||
emit nameChanged(m_name);
|
||||
}
|
||||
|
||||
@@ -412,7 +413,7 @@ void ElementTextItemGroup::fromXml(QDomElement &dom_element)
|
||||
if(parentElement())
|
||||
{
|
||||
m_block_alignment_update = true;
|
||||
for(QDomElement text : QET::findInDomElement(dom_element, "texts", "text"))
|
||||
for(const QDomElement& text : QET::findInDomElement(dom_element, "texts", "text"))
|
||||
{
|
||||
DynamicElementTextItem *deti = nullptr;
|
||||
QUuid uuid(text.attribute("uuid"));
|
||||
|
||||
@@ -880,7 +880,7 @@ bool QetShapeItem::fromXml(const QDomElement &e)
|
||||
}
|
||||
}
|
||||
else {
|
||||
for(QDomElement de : QET::findInDomElement(e, "points", "point")) {
|
||||
for(const QDomElement& de : QET::findInDomElement(e, "points", "point")) {
|
||||
m_polygon << QPointF(de.attribute("x", nullptr).toDouble(), de.attribute("y", nullptr).toDouble());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include "conductor.h"
|
||||
#include "dynamicelementtextitem.h"
|
||||
|
||||
ReportElement::ReportElement(const ElementsLocation &location, QString link_type,QGraphicsItem *qgi, int *state) :
|
||||
ReportElement::ReportElement(const ElementsLocation &location, const QString& link_type,QGraphicsItem *qgi, int *state) :
|
||||
CustomElement(location, qgi, state)
|
||||
{
|
||||
link_type == "next_report"? m_link_type=NextReport : m_link_type=PreviousReport;
|
||||
|
||||
@@ -30,7 +30,7 @@ class ReportElement : public CustomElement
|
||||
Q_OBJECT
|
||||
|
||||
public :
|
||||
explicit ReportElement(const ElementsLocation &,QString link_type, QGraphicsItem * = nullptr, int * = nullptr);
|
||||
explicit ReportElement(const ElementsLocation &,const QString& link_type, QGraphicsItem * = nullptr, int * = nullptr);
|
||||
~ReportElement() override;
|
||||
void linkToElement(Element *) override;
|
||||
void unlinkAllElements() override;
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include "terminal.h"
|
||||
|
||||
#include <utility>
|
||||
#include "diagram.h"
|
||||
#include "qetgraphicsitem/element.h"
|
||||
#include "qetgraphicsitem/conductor.h"
|
||||
@@ -55,9 +57,9 @@ void Terminal::init(QPointF pf, Qet::Orientation o, QString number, QString name
|
||||
default : dock_elmt_ += QPointF(0, -Terminal::terminalSize);
|
||||
}
|
||||
// Number of terminal
|
||||
number_terminal_ = number;
|
||||
number_terminal_ = std::move(number);
|
||||
// Name of terminal
|
||||
name_terminal_ = name;
|
||||
name_terminal_ = std::move(name);
|
||||
name_terminal_hidden = hiddenName;
|
||||
// par defaut : pas de conducteur
|
||||
|
||||
@@ -127,7 +129,7 @@ Terminal::Terminal(QPointF pf, Qet::Orientation o, QString num, QString name, bo
|
||||
parent_element_ (e),
|
||||
hovered_color_ (Terminal::neutralColor)
|
||||
{
|
||||
init(pf, o, num, name, hiddenName);
|
||||
init(pf, o, std::move(num), std::move(name), hiddenName);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -168,7 +170,7 @@ Qet::Orientation Terminal::orientation() const {
|
||||
* @param number
|
||||
*/
|
||||
void Terminal::setNumber(QString number) {
|
||||
number_terminal_ = number;
|
||||
number_terminal_ = std::move(number);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -176,7 +178,7 @@ void Terminal::setNumber(QString number) {
|
||||
* @param name
|
||||
*/
|
||||
void Terminal::setName(QString name, bool hiddenName) {
|
||||
name_terminal_ = name;
|
||||
name_terminal_ = std::move(name);
|
||||
name_terminal_hidden = hiddenName;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user