mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 20:50:34 +01:00
correct more indentations / whitespace
This commit is contained in:
@@ -1,19 +1,19 @@
|
||||
/*
|
||||
Copyright 2006-2024 The QElectroTech Team
|
||||
This file is part of QElectroTech.
|
||||
|
||||
QElectroTech is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
QElectroTech is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||
Copyright 2006-2024 The QElectroTech Team
|
||||
This file is part of QElectroTech.
|
||||
|
||||
QElectroTech is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
QElectroTech is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include "addgraphicsobjectcommand.h"
|
||||
#include "../qetgraphicsitem/qetgraphicsitem.h"
|
||||
@@ -30,21 +30,21 @@
|
||||
* @param parent : parent undo command of this class.
|
||||
*/
|
||||
AddGraphicsObjectCommand::AddGraphicsObjectCommand(QGraphicsObject *qgo, Diagram *diagram,
|
||||
const QPointF &pos, QUndoCommand *parent) :
|
||||
QUndoCommand(parent),
|
||||
m_item(qgo),
|
||||
m_diagram(diagram),
|
||||
m_pos(pos)
|
||||
const QPointF &pos, QUndoCommand *parent) :
|
||||
QUndoCommand(parent),
|
||||
m_item(qgo),
|
||||
m_diagram(diagram),
|
||||
m_pos(pos)
|
||||
{
|
||||
setText(QObject::tr("Ajouter ") + itemText());
|
||||
m_diagram->qgiManager().manage(m_item);
|
||||
m_diagram->qgiManager().manage(m_item);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief AddGraphicsObjectCommand::~AddGraphicsObjectCommand
|
||||
*/
|
||||
AddGraphicsObjectCommand::~AddGraphicsObjectCommand() {
|
||||
m_diagram->qgiManager().release(m_item);
|
||||
m_diagram->qgiManager().release(m_item);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -53,12 +53,12 @@ AddGraphicsObjectCommand::~AddGraphicsObjectCommand() {
|
||||
*/
|
||||
void AddGraphicsObjectCommand::undo()
|
||||
{
|
||||
if (m_item)
|
||||
{
|
||||
m_diagram->showMe();
|
||||
m_diagram->removeItem(m_item);
|
||||
}
|
||||
QUndoCommand::undo();
|
||||
if (m_item)
|
||||
{
|
||||
m_diagram->showMe();
|
||||
m_diagram->removeItem(m_item);
|
||||
}
|
||||
QUndoCommand::undo();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -67,13 +67,13 @@ void AddGraphicsObjectCommand::undo()
|
||||
*/
|
||||
void AddGraphicsObjectCommand::redo()
|
||||
{
|
||||
if (m_item)
|
||||
{
|
||||
m_diagram->showMe();
|
||||
m_diagram->addItem(m_item);
|
||||
m_item->setPos(m_pos);
|
||||
}
|
||||
QUndoCommand::redo();
|
||||
if (m_item)
|
||||
{
|
||||
m_diagram->showMe();
|
||||
m_diagram->addItem(m_item);
|
||||
m_item->setPos(m_pos);
|
||||
}
|
||||
QUndoCommand::redo();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -83,12 +83,12 @@ void AddGraphicsObjectCommand::redo()
|
||||
QString AddGraphicsObjectCommand::itemText() const
|
||||
{
|
||||
if (auto qgi = dynamic_cast<QetGraphicsItem *>(m_item.data())) {
|
||||
return qgi->name();
|
||||
return qgi->name();
|
||||
} else if (dynamic_cast<IndependentTextItem *>(m_item.data())) {
|
||||
return QObject::tr("un champ texte");
|
||||
} else if (dynamic_cast<Conductor *>(m_item.data())) {
|
||||
return QObject::tr("un conducteur");
|
||||
} else {
|
||||
return QObject::tr("un element graphique");
|
||||
}
|
||||
return QObject::tr("un conducteur");
|
||||
} else {
|
||||
return QObject::tr("un element graphique");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user