Mod doc to set style de same + Fix indentation code

This commit is contained in:
Simon De Backer
2020-07-15 18:17:39 +02:00
committed by Laurent Trinques
parent 251dfdf37a
commit 2cdfce18ec
11 changed files with 252 additions and 245 deletions

View File

@@ -43,11 +43,11 @@ QString itemText(const Conductor *item) {
} }
/** /**
* @brief PasteDiagramCommand::PasteDiagramCommand @brief PasteDiagramCommand::PasteDiagramCommand
* Constructor Constructor
* @param dia : diagram where we must to paste @param dia : diagram where we must to paste
* @param c : content to past @param c : content to past
* @param parent : parent undo command @param parent : parent undo command
*/ */
PasteDiagramCommand::PasteDiagramCommand( Diagram *dia, const DiagramContent &c, QUndoCommand *parent) : PasteDiagramCommand::PasteDiagramCommand( Diagram *dia, const DiagramContent &c, QUndoCommand *parent) :
QUndoCommand(parent), QUndoCommand(parent),
@@ -61,16 +61,16 @@ PasteDiagramCommand::PasteDiagramCommand( Diagram *dia, const DiagramContent &c,
} }
/** /**
* @brief PasteDiagramCommand::~PasteDiagramCommand @brief PasteDiagramCommand::~PasteDiagramCommand
* Destructor Destructor
*/ */
PasteDiagramCommand::~PasteDiagramCommand() { PasteDiagramCommand::~PasteDiagramCommand() {
diagram -> qgiManager().release(content.items(filter)); diagram -> qgiManager().release(content.items(filter));
} }
/** /**
* @brief PasteDiagramCommand::undo @brief PasteDiagramCommand::undo
* Undo this command Undo this command
*/ */
void PasteDiagramCommand::undo() void PasteDiagramCommand::undo()
{ {
@@ -81,8 +81,8 @@ void PasteDiagramCommand::undo()
} }
/** /**
* @brief PasteDiagramCommand::redo @brief PasteDiagramCommand::redo
* Redo this commnand Redo this commnand
*/ */
void PasteDiagramCommand::redo() void PasteDiagramCommand::redo()
{ {
@@ -166,12 +166,12 @@ CutDiagramCommand::~CutDiagramCommand() {
} }
/** /**
* @brief MoveElementsCommand::MoveElementsCommand @brief MoveElementsCommand::MoveElementsCommand
* Constructor Constructor
* @param dia diagram @param dia diagram
* @param diagram_content diagram content (contain all items to be moved) @param diagram_content diagram content (contain all items to be moved)
* @param m movement to applied @param m movement to applied
* @param parent parent undo command @param parent parent undo command
*/ */
MoveElementsCommand::MoveElementsCommand( MoveElementsCommand::MoveElementsCommand(
Diagram *dia, Diagram *dia,
@@ -207,15 +207,15 @@ MoveElementsCommand::MoveElementsCommand(
} }
/** /**
* @brief MoveElementsCommand::~MoveElementsCommand @brief MoveElementsCommand::~MoveElementsCommand
* Destructor Destructor
*/ */
MoveElementsCommand::~MoveElementsCommand() { MoveElementsCommand::~MoveElementsCommand() {
delete m_anim_group; delete m_anim_group;
} }
/** /**
* @brief MoveElementsCommand::undo @brief MoveElementsCommand::undo
*/ */
void MoveElementsCommand::undo() { void MoveElementsCommand::undo() {
diagram -> showMe(); diagram -> showMe();
@@ -225,7 +225,7 @@ void MoveElementsCommand::undo() {
} }
/** /**
* @brief MoveElementsCommand::redo @brief MoveElementsCommand::redo
*/ */
void MoveElementsCommand::redo() { void MoveElementsCommand::redo() {
diagram -> showMe(); diagram -> showMe();
@@ -241,9 +241,9 @@ void MoveElementsCommand::redo() {
} }
/** /**
* @brief MoveElementsCommand::move @brief MoveElementsCommand::move
* Move item and conductor to @actual_movement Move item and conductor to @actual_movement
* @param actual_movement movement to be applied @param actual_movement movement to be applied
*/ */
void MoveElementsCommand::move(const QPointF &actual_movement) void MoveElementsCommand::move(const QPointF &actual_movement)
{ {
@@ -262,6 +262,7 @@ void MoveElementsCommand::move(const QPointF &actual_movement)
setupAnimation(qgi->toGraphicsObject(), "pos", qgi->pos(), qgi->pos() + actual_movement); setupAnimation(qgi->toGraphicsObject(), "pos", qgi->pos(), qgi->pos() + actual_movement);
else if(qgi->type() == QGraphicsItemGroup::Type) //ElementTextItemGroup is a QObject but not a QGraphicsObject else if(qgi->type() == QGraphicsItemGroup::Type) //ElementTextItemGroup is a QObject but not a QGraphicsObject
{ {
//ElementTextItemGroup is a QObject but not a QGraphicsObject
if(ElementTextItemGroup *etig = dynamic_cast<ElementTextItemGroup *>(qgi)) if(ElementTextItemGroup *etig = dynamic_cast<ElementTextItemGroup *>(qgi))
setupAnimation(etig, "pos", etig->pos(), etig->pos() + actual_movement); setupAnimation(etig, "pos", etig->pos(), etig->pos() + actual_movement);
} }
@@ -511,9 +512,9 @@ void ChangeConductorCommand::setConductorTextItemMove(const QPointF &pos_before,
} }
/** /**
* @brief ResetConductorCommand::ResetConductorCommand @brief ResetConductorCommand::ResetConductorCommand
* @param cp @param cp
* @param parent @param parent
*/ */
ResetConductorCommand::ResetConductorCommand( ResetConductorCommand::ResetConductorCommand(
const QHash<Conductor *, ConductorProfilesGroup> &cp, const QHash<Conductor *, ConductorProfilesGroup> &cp,
@@ -532,13 +533,13 @@ ResetConductorCommand::ResetConductorCommand(
} }
/** /**
* @brief ResetConductorCommand::~ResetConductorCommand @brief ResetConductorCommand::~ResetConductorCommand
*/ */
ResetConductorCommand::~ResetConductorCommand() { ResetConductorCommand::~ResetConductorCommand() {
} }
/** /**
* @brief ResetConductorCommand::undo @brief ResetConductorCommand::undo
*/ */
void ResetConductorCommand::undo() { void ResetConductorCommand::undo() {
diagram -> showMe(); diagram -> showMe();
@@ -548,7 +549,7 @@ void ResetConductorCommand::undo() {
} }
/** /**
* @brief ResetConductorCommand::redo @brief ResetConductorCommand::redo
*/ */
void ResetConductorCommand::redo() { void ResetConductorCommand::redo() {
diagram -> showMe(); diagram -> showMe();

View File

@@ -34,9 +34,9 @@ class DiagramImageItem;
class QetGraphicsItem; class QetGraphicsItem;
/** /**
* @brief The AddItemCommand class @brief The AddItemCommand class
* This command add an item in a diagram This command add an item in a diagram
* The item to add is template, but must be QGraphicsItem or derived. The item to add is template, but must be QGraphicsItem or derived.
*/ */
template <typename QGI> template <typename QGI>
class AddItemCommand : public QUndoCommand { class AddItemCommand : public QUndoCommand {

View File

@@ -9,10 +9,12 @@
class QGraphicsObject; class QGraphicsObject;
/*! /**
* \brief The TerminalData class @brief The TerminalData class
* Data of the terminal. Stored in extra class so it can be used by PartTerminal and Terminal without Data of the terminal.
* defining everything again. Stored in extra class so it can be used by PartTerminal
and Terminal without defining everything again.
@note tis class needs to be work on
*/ */
class TerminalData : public PropertiesInterface class TerminalData : public PropertiesInterface
{ {

View File

@@ -185,16 +185,16 @@ Qet::Orientation Terminal::orientation() const {
/** /**
* @brief Terminal::setNumber @brief Terminal::setNumber
* @param number @param number
*/ */
void Terminal::setNumber(QString number) { void Terminal::setNumber(QString number) {
number_terminal_ = std::move(number); number_terminal_ = std::move(number);
} }
/** /**
* @brief Terminal::setName @brief Terminal::setName
* @param name @param name
*/ */
void Terminal::setName(QString name, bool hiddenName) { void Terminal::setName(QString name, bool hiddenName) {
name_terminal_ = std::move(name); name_terminal_ = std::move(name);
@@ -202,10 +202,10 @@ void Terminal::setName(QString name, bool hiddenName) {
} }
/** /**
* @brief Terminal::addConductor @brief Terminal::addConductor
* Add a conductor to this terminal Add a conductor to this terminal
* @param conductor : the conductor to add. @param conductor : the conductor to add.
* @return true if the conductor was successfully added @return true if the conductor was successfully added
*/ */
bool Terminal::addConductor(Conductor *conductor) bool Terminal::addConductor(Conductor *conductor)
{ {
@@ -227,9 +227,9 @@ bool Terminal::addConductor(Conductor *conductor)
} }
/** /**
* @brief Terminal::removeConductor @brief Terminal::removeConductor
* Remove a conductor from this terminal Remove a conductor from this terminal
* @param conductor : conductor to remove @param conductor : conductor to remove
*/ */
void Terminal::removeConductor(Conductor *conductor) void Terminal::removeConductor(Conductor *conductor)
{ {
@@ -346,9 +346,9 @@ void Terminal::paint(QPainter *p, const QStyleOptionGraphicsItem *options, QWidg
} }
/** /**
* @brief Terminal::drawHelpLine @brief Terminal::drawHelpLine
* @param draw : true, display the help line @param draw : true, display the help line
* false, hide it. false, hide it.
*/ */
void Terminal::drawHelpLine(bool draw) void Terminal::drawHelpLine(bool draw)
{ {
@@ -372,10 +372,10 @@ void Terminal::drawHelpLine(bool draw)
} }
/** /**
* @brief Terminal::HelpLine @brief Terminal::HelpLine
* @return a line with coordinate P1 the dock point of conductor @return a line with coordinate P1 the dock point of conductor
* and P2 the border of diagram, according to the orientation of terminal and P2 the border of diagram, according to the orientation of terminal
* The line is in scene coordinate; The line is in scene coordinate;
*/ */
QLineF Terminal::HelpLine() const QLineF Terminal::HelpLine() const
{ {
@@ -425,11 +425,11 @@ QRectF Terminal::boundingRect() const {
} }
/** /**
* @brief Terminal::alignedWithTerminal @brief Terminal::alignedWithTerminal
* If this terminal is aligned with an other terminal If this terminal is aligned with an other terminal
* and is orientation is opposed return the other terminal and is orientation is opposed return the other terminal
* else return nullptr else return nullptr
* @return @return
*/ */
Terminal* Terminal::alignedWithTerminal() const Terminal* Terminal::alignedWithTerminal() const
{ {
@@ -542,7 +542,6 @@ void Terminal::mouseMoveEvent(QGraphicsSceneMouseEvent *e) {
previous_terminal_ -> update(); previous_terminal_ -> update();
} }
Diagram *diag = diagram(); Diagram *diag = diagram();
if (!diag) return; if (!diag) return;
// si la scene est un Diagram, on actualise le poseur de conducteur // si la scene est un Diagram, on actualise le poseur de conducteur
@@ -584,8 +583,8 @@ void Terminal::mouseMoveEvent(QGraphicsSceneMouseEvent *e) {
/** /**
* @brief Terminal::mouseReleaseEvent @brief Terminal::mouseReleaseEvent
* @param e @param e
*/ */
void Terminal::mouseReleaseEvent(QGraphicsSceneMouseEvent *e) void Terminal::mouseReleaseEvent(QGraphicsSceneMouseEvent *e)
{ {
@@ -658,8 +657,8 @@ void Terminal::mouseReleaseEvent(QGraphicsSceneMouseEvent *e)
} }
/** /**
* @brief Terminal::updateConductor @brief Terminal::updateConductor
* Update the path of conductor docked to this terminal Update the path of conductor docked to this terminal
*/ */
void Terminal::updateConductor() { void Terminal::updateConductor() {
foreach (Conductor *conductor, conductors_) foreach (Conductor *conductor, conductors_)
@@ -685,14 +684,14 @@ bool Terminal::isLinkedTo(Terminal *other_terminal) {
} }
/** /**
* @brief Terminal::canBeLinkedTo @brief Terminal::canBeLinkedTo
* Checking if the terminal can be linked to \p other_terminal or not Checking if the terminal can be linked to \p other_terminal or not
* Reasons for not linable: Reasons for not linable:
* - \p other_terminal is this terminal - \p other_terminal is this terminal
* - this terminal is already connected to \p other_terminal - this terminal is already connected to \p other_terminal
* @param other_terminal @param other_terminal
* @return true if this terminal can be linked to @other_terminal, @return true if this terminal can be linked to @other_terminal,
* otherwise false otherwise false
*/ */
bool Terminal::canBeLinkedTo(Terminal *other_terminal) bool Terminal::canBeLinkedTo(Terminal *other_terminal)
{ {
@@ -815,15 +814,15 @@ QUuid Terminal::uuid() const {
} }
/** /**
* @brief Conductor::relatedPotentialTerminal @brief Conductor::relatedPotentialTerminal
* Return terminal at the same potential from the same Return terminal at the same potential from the same
* parent element of @t. parent element of @t.
* For folio report, return the terminal of linked other report. For folio report, return the terminal of linked other report.
* For Terminal element, return the other terminal of terminal element. For Terminal element, return the other terminal of terminal element.
* @param t terminal to start search @param t terminal to start search
* @param all_diagram :if true return all related terminal, @param all_diagram :if true return all related terminal,
* false return only terminal in the same diagram of @t false return only terminal in the same diagram of @t
* @return the list of terminal at the same potential @return the list of terminal at the same potential
*/ */
QList<Terminal *> relatedPotentialTerminal (const Terminal *terminal, const bool all_diagram) QList<Terminal *> relatedPotentialTerminal (const Terminal *terminal, const bool all_diagram)
{ {

View File

@@ -129,9 +129,11 @@ class Terminal : public QGraphicsObject
QPointF dock_elmt_; QPointF dock_elmt_;
/// List of conductors attached to the terminal /// List of conductors attached to the terminal
QList<Conductor *> conductors_; QList<Conductor *> conductors_;
/// Pointer to a rectangle representing the terminal bounding rect; /**
/// used to calculate the bounding rect once only; Pointer to a rectangle representing the terminal bounding rect;
/// used a pointer because boundingRect() is supposed to be const. used to calculate the bounding rect once only;
used a pointer because boundingRect() is supposed to be const.
*/
QRectF *br_{nullptr}; QRectF *br_{nullptr};
/// Last terminal seen through an attached conductor /// Last terminal seen through an attached conductor
Terminal *previous_terminal_; Terminal *previous_terminal_;

View File

@@ -32,8 +32,8 @@ TerminalElement::TerminalElement(const ElementsLocation &location, QGraphicsItem
TerminalElement::~TerminalElement() {} TerminalElement::~TerminalElement() {}
/** /**
* @brief TerminalElement::initLink @brief TerminalElement::initLink
* @param project @param project
*/ */
void TerminalElement::initLink(QETProject *project) { void TerminalElement::initLink(QETProject *project) {
Element::initLink(project); Element::initLink(project);

View File

@@ -28,10 +28,11 @@
#include <QPolygonF> #include <QPolygonF>
/** /**
* @brief ConductorCreator::ConductorCreator @brief ConductorCreator::ConductorCreator
* Create an electrical potential between all terminals of @terminals_list. Create an electrical potential between all terminals of @terminals_list.
* the terminals of the list must be in the same diagram. the terminals of the list must be in the same diagram.
* @param terminals_list @param d Diagram
@param terminals_list QList<Terminal *>
*/ */
ConductorCreator::ConductorCreator(Diagram *d, QList<Terminal *> terminals_list) : ConductorCreator::ConductorCreator(Diagram *d, QList<Terminal *> terminals_list) :
m_terminals_list(terminals_list) m_terminals_list(terminals_list)
@@ -68,10 +69,10 @@ ConductorCreator::ConductorCreator(Diagram *d, QList<Terminal *> terminals_list)
} }
/** /**
* @brief ConductorCreator::create @brief ConductorCreator::create
* Create an electrical potential between the terminals of the diagram d, contained in the polygon Create an electrical potential between the terminals of the diagram d, contained in the polygon
* @param d @param d Diagram
* @param polygon : polygon in diagram coordinate @param polygon : polygon in diagram coordinate
*/ */
void ConductorCreator::create(Diagram *d, const QPolygonF &polygon) void ConductorCreator::create(Diagram *d, const QPolygonF &polygon)
{ {
@@ -92,8 +93,8 @@ void ConductorCreator::create(Diagram *d, const QPolygonF &polygon)
} }
/** /**
* @brief ConductorCreator::propertieToUse @brief ConductorCreator::propertieToUse
* @return the conductor properties to use for the new conductors. @return the conductor properties to use for the new conductors.
*/ */
void ConductorCreator::setUpPropertieToUse() void ConductorCreator::setUpPropertieToUse()
{ {
@@ -130,10 +131,10 @@ void ConductorCreator::setUpPropertieToUse()
} }
/** /**
* @brief ConductorCreator::existingPotential @brief ConductorCreator::existingPotential
* Return the list of existing potential of Return the list of existing potential of
* the terminal list the terminal list
* @return @return c_list QList<Conductor *>
*/ */
QList<Conductor *> ConductorCreator::existingPotential() QList<Conductor *> ConductorCreator::existingPotential()
{ {
@@ -174,8 +175,8 @@ QList<Conductor *> ConductorCreator::existingPotential()
} }
/** /**
* @brief ConductorCreator::hubTerminal @brief ConductorCreator::hubTerminal
* @return @return hub_terminal
*/ */
Terminal *ConductorCreator::hubTerminal() Terminal *ConductorCreator::hubTerminal()
{ {

View File

@@ -19,7 +19,9 @@
#define MACOSXOPENEVENT_H #define MACOSXOPENEVENT_H
#include <QObject> #include <QObject>
/**
@brief The MacOSXOpenEvent class
*/
class MacOSXOpenEvent : public QObject class MacOSXOpenEvent : public QObject
{ {
Q_OBJECT Q_OBJECT

View File

@@ -21,7 +21,7 @@
#include <QMargins> #include <QMargins>
/** /**
* Provide some small utils function Provide some small utils function
*/ */
namespace QETUtils namespace QETUtils
{ {