mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-03-21 12:39:59 +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:
@@ -21,6 +21,7 @@
|
||||
#include "elementtextitemgroup.h"
|
||||
|
||||
#include <QGraphicsScene>
|
||||
#include <utility>
|
||||
|
||||
|
||||
/************************
|
||||
@@ -70,7 +71,7 @@ void AddElementTextCommand::redo()
|
||||
AddTextsGroupCommand::AddTextsGroupCommand(Element *element, QString groupe_name, QUndoCommand *parent) :
|
||||
QUndoCommand(parent),
|
||||
m_element(element),
|
||||
m_name(groupe_name)
|
||||
m_name(std::move(groupe_name))
|
||||
{
|
||||
setText(QObject::tr("Ajouter un groupe de textes d'élément"));
|
||||
}
|
||||
@@ -81,7 +82,7 @@ AddTextsGroupCommand::AddTextsGroupCommand(Element *element, QString groupe_name
|
||||
* @param dom_element : the first time the group is created, we call the function fromXml of the group, and give @dom_element has argument.
|
||||
* @param parent : parent undo
|
||||
*/
|
||||
AddTextsGroupCommand::AddTextsGroupCommand(Element *element, QDomElement dom_element, QUndoCommand *parent) :
|
||||
AddTextsGroupCommand::AddTextsGroupCommand(Element *element, const QDomElement& dom_element, QUndoCommand *parent) :
|
||||
QUndoCommand(parent),
|
||||
m_element(element),
|
||||
m_dom_element(dom_element)
|
||||
@@ -98,7 +99,7 @@ AddTextsGroupCommand::AddTextsGroupCommand(Element *element, QDomElement dom_ele
|
||||
AddTextsGroupCommand::AddTextsGroupCommand(Element *element, QString groupe_name, QList<DynamicElementTextItem *> texts_list, QUndoCommand *parent) :
|
||||
QUndoCommand(parent),
|
||||
m_element(element),
|
||||
m_name(groupe_name)
|
||||
m_name(std::move(groupe_name))
|
||||
{
|
||||
for(DynamicElementTextItem *deti : texts_list)
|
||||
{
|
||||
@@ -188,7 +189,7 @@ void RemoveTextsGroupCommand::undo()
|
||||
{
|
||||
m_element.data()->addTextGroup(m_group.data());
|
||||
|
||||
for(QPointer<DynamicElementTextItem> p : m_text_list)
|
||||
for(const QPointer<DynamicElementTextItem>& p : m_text_list)
|
||||
if(p)
|
||||
m_element.data()->addTextToGroup(p.data(), m_group.data());
|
||||
}
|
||||
@@ -198,7 +199,7 @@ void RemoveTextsGroupCommand::redo()
|
||||
{
|
||||
if(m_element && m_group)
|
||||
{
|
||||
for(QPointer<DynamicElementTextItem> p : m_text_list)
|
||||
for(const QPointer<DynamicElementTextItem>& p : m_text_list)
|
||||
if(p)
|
||||
m_element.data()->removeTextFromGroup(p.data(), m_group.data());
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ class AddTextsGroupCommand : public QUndoCommand
|
||||
{
|
||||
public:
|
||||
AddTextsGroupCommand(Element *element, QString groupe_name, QUndoCommand *parent = nullptr);
|
||||
AddTextsGroupCommand(Element *element, QDomElement dom_element, QUndoCommand *parent = nullptr);
|
||||
AddTextsGroupCommand(Element *element, const QDomElement& dom_element, QUndoCommand *parent = nullptr);
|
||||
AddTextsGroupCommand(Element *element, QString groupe_name, QList<DynamicElementTextItem *> texts_list, QUndoCommand *parent = nullptr);
|
||||
~AddTextsGroupCommand() override;
|
||||
|
||||
|
||||
@@ -129,7 +129,7 @@ bool LinkElementCommand::isLinkable(Element *element_a, Element *element_b, bool
|
||||
* This method do several check to know if element can be linked or not.
|
||||
* @param element_list
|
||||
*/
|
||||
void LinkElementCommand::setLink(QList<Element *> element_list)
|
||||
void LinkElementCommand::setLink(const QList<Element *>& element_list)
|
||||
{
|
||||
m_linked_after.clear();
|
||||
setUpNewLink(element_list, true);
|
||||
|
||||
@@ -38,7 +38,7 @@ class LinkElementCommand : public QUndoCommand
|
||||
|
||||
static bool isLinkable (Element *element_a, Element *element_b, bool already_linked = false);
|
||||
|
||||
void setLink (QList<Element *> element_list);
|
||||
void setLink (const QList<Element *>& element_list);
|
||||
void setLink (Element *element_);
|
||||
void unlink (QList<Element *> element_list);
|
||||
void unlinkAll ();
|
||||
|
||||
@@ -87,7 +87,7 @@ void RotateSelectionCommand::undo()
|
||||
m_diagram->showMe();
|
||||
QUndoCommand::undo();
|
||||
|
||||
for(QPointer<ConductorTextItem> cti : m_cond_text)
|
||||
for(const QPointer<ConductorTextItem>& cti : m_cond_text)
|
||||
{
|
||||
cti->forceRotateByUser(m_rotate_by_user.value(cti.data()));
|
||||
if(!cti->wasRotateByUser())
|
||||
@@ -103,7 +103,7 @@ void RotateSelectionCommand::redo()
|
||||
m_diagram->showMe();
|
||||
QUndoCommand::redo();
|
||||
|
||||
for(QPointer<ConductorTextItem> cti : m_cond_text)
|
||||
for(const QPointer<ConductorTextItem>& cti : m_cond_text)
|
||||
{
|
||||
m_rotate_by_user.insert(cti, cti->wasRotateByUser());
|
||||
cti->forceRotateByUser(true);
|
||||
|
||||
@@ -138,7 +138,7 @@ void RotateTextsCommand::openDialog()
|
||||
#endif
|
||||
}
|
||||
|
||||
void RotateTextsCommand::setupAnimation(QObject *target, const QByteArray &propertyName, const QVariant start, const QVariant end)
|
||||
void RotateTextsCommand::setupAnimation(QObject *target, const QByteArray &propertyName, const QVariant& start, const QVariant& end)
|
||||
{
|
||||
if(m_anim_group == nullptr)
|
||||
m_anim_group = new QParallelAnimationGroup();
|
||||
|
||||
@@ -40,7 +40,7 @@ class RotateTextsCommand : public QUndoCommand
|
||||
|
||||
private:
|
||||
void openDialog();
|
||||
void setupAnimation(QObject *target, const QByteArray &propertyName, const QVariant start, const QVariant end);
|
||||
void setupAnimation(QObject *target, const QByteArray &propertyName, const QVariant& start, const QVariant& end);
|
||||
|
||||
private:
|
||||
QPointer<Diagram> m_diagram;
|
||||
|
||||
Reference in New Issue
Block a user