mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-09-14 20:33:05 +02:00
add documentation
This commit is contained in:
parent
0c381eae28
commit
251dfdf37a
@ -292,6 +292,7 @@ inline void Diagram::setConductor(bool adding) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@brief Diagram::setConductorStart
|
||||||
Set the start point of the conductor setter.
|
Set the start point of the conductor setter.
|
||||||
@param start the point (in scene coordinates) which the newly created
|
@param start the point (in scene coordinates) which the newly created
|
||||||
conductor should start from.
|
conductor should start from.
|
||||||
@ -301,6 +302,7 @@ inline void Diagram::setConductorStart(QPointF start) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@brief Diagram::setConductorStop
|
||||||
Set the end point of the conductor setter.
|
Set the end point of the conductor setter.
|
||||||
@param end the point (in scene coordinates) upon to which the newly created
|
@param end the point (in scene coordinates) upon to which the newly created
|
||||||
conductor should be drawn.
|
conductor should be drawn.
|
||||||
@ -310,6 +312,7 @@ inline void Diagram::setConductorStop(QPointF end) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@brief Diagram::setDisplayGrid
|
||||||
Set whether the diagram grid should be drawn.
|
Set whether the diagram grid should be drawn.
|
||||||
@param dg true to render the grid, false otherwise.
|
@param dg true to render the grid, false otherwise.
|
||||||
*/
|
*/
|
||||||
@ -318,13 +321,15 @@ inline void Diagram::setDisplayGrid(bool dg) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@return true if the grid is drawn, false otherwise.
|
@brief Diagram::displayGrid
|
||||||
|
@return draw_grid_ true if the grid is drawn, false otherwise.
|
||||||
*/
|
*/
|
||||||
inline bool Diagram::displayGrid() {
|
inline bool Diagram::displayGrid() {
|
||||||
return(draw_grid_);
|
return(draw_grid_);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@brief Diagram::setUseBorder
|
||||||
Set whether the diagram border (including rows/colums headers and the title
|
Set whether the diagram border (including rows/colums headers and the title
|
||||||
block) should be rendered along with the diagram. When set to false, the size
|
block) should be rendered along with the diagram. When set to false, the size
|
||||||
of the smallest rectangle containing all items is considered as the diagram
|
of the smallest rectangle containing all items is considered as the diagram
|
||||||
@ -336,14 +341,16 @@ inline void Diagram::setUseBorder(bool ub) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@return true if the border is rendered and take into account, false
|
@brief Diagram::useBorder
|
||||||
otherwise.
|
@return use_border_ true if the border is rendered and take into account,
|
||||||
|
false otherwise.
|
||||||
*/
|
*/
|
||||||
inline bool Diagram::useBorder() {
|
inline bool Diagram::useBorder() {
|
||||||
return(use_border_);
|
return(use_border_);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@brief Diagram::setBorderOptions
|
||||||
Set the rendering options for the diagram border (including rows/colums
|
Set the rendering options for the diagram border (including rows/colums
|
||||||
headers and the title block)
|
headers and the title block)
|
||||||
@param bo Enabled options ORed together
|
@param bo Enabled options ORed together
|
||||||
@ -356,6 +363,7 @@ inline void Diagram::setBorderOptions(Diagram::BorderOptions bo) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@brief Diagram::borderOptions
|
||||||
@return The rendering optios for the diagram border
|
@return The rendering optios for the diagram border
|
||||||
@see setBorderOptions
|
@see setBorderOptions
|
||||||
*/
|
*/
|
||||||
@ -368,22 +376,34 @@ inline Diagram::BorderOptions Diagram::borderOptions() {
|
|||||||
return(options);
|
return(options);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @return the diagram undo stack
|
/**
|
||||||
|
@brief Diagram::undoStack
|
||||||
|
@return the diagram undo stack
|
||||||
|
*/
|
||||||
inline QUndoStack &Diagram::undoStack() {
|
inline QUndoStack &Diagram::undoStack() {
|
||||||
return *(project()->undoStack());
|
return *(project()->undoStack());
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @return the diagram graphics item manager
|
/**
|
||||||
|
@brief Diagram::qgiManager
|
||||||
|
@return the diagram graphics item manager
|
||||||
|
*/
|
||||||
inline QGIManager &Diagram::qgiManager() {
|
inline QGIManager &Diagram::qgiManager() {
|
||||||
return(*qgi_manager_);
|
return(*qgi_manager_);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @return true if terminals are rendered, false otherwise
|
/**
|
||||||
|
@brief Diagram::drawTerminals
|
||||||
|
@return true if terminals are rendered, false otherwise
|
||||||
|
*/
|
||||||
inline bool Diagram::drawTerminals() const {
|
inline bool Diagram::drawTerminals() const {
|
||||||
return(draw_terminals_);
|
return(draw_terminals_);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @return true if conductors colors are rendered, false otherwise.
|
/**
|
||||||
|
@brief Diagram::drawColoredConductors
|
||||||
|
@return true if conductors colors are rendered, false otherwise.
|
||||||
|
*/
|
||||||
inline bool Diagram::drawColoredConductors() const {
|
inline bool Diagram::drawColoredConductors() const {
|
||||||
return(draw_colored_conductors_);
|
return(draw_colored_conductors_);
|
||||||
}
|
}
|
||||||
|
@ -135,6 +135,7 @@ void PasteDiagramCommand::redo()
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@brief CutDiagramCommand::CutDiagramCommand
|
||||||
Constructeur
|
Constructeur
|
||||||
@param dia Schema dont on coupe des elements et conducteurs
|
@param dia Schema dont on coupe des elements et conducteurs
|
||||||
@param content Contenu coupe
|
@param content Contenu coupe
|
||||||
@ -157,7 +158,10 @@ CutDiagramCommand::CutDiagramCommand(
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Destructeur
|
/**
|
||||||
|
@brief CutDiagramCommand::~CutDiagramCommand
|
||||||
|
Destructeur
|
||||||
|
*/
|
||||||
CutDiagramCommand::~CutDiagramCommand() {
|
CutDiagramCommand::~CutDiagramCommand() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -293,11 +297,9 @@ void MoveElementsCommand::setupAnimation(QObject *target, const QByteArray &prop
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@brief MoveConductorsTextsCommand::MoveConductorsTextsCommand
|
||||||
Constructeur
|
Constructeur
|
||||||
@param diagram Schema sur lequel on deplace des champs de texte
|
@param diagram Schema sur lequel on deplace des champs de texte
|
||||||
@param texts Textes deplaces : chaque ConductorTextItem est associe a un
|
|
||||||
couple de position : avant et apres le deplacement
|
|
||||||
@param m translation subie par les elements
|
|
||||||
@param parent QUndoCommand parent
|
@param parent QUndoCommand parent
|
||||||
*/
|
*/
|
||||||
MoveConductorsTextsCommand::MoveConductorsTextsCommand(
|
MoveConductorsTextsCommand::MoveConductorsTextsCommand(
|
||||||
@ -310,11 +312,17 @@ MoveConductorsTextsCommand::MoveConductorsTextsCommand(
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Destructeur
|
/**
|
||||||
|
@brief MoveConductorsTextsCommand::~MoveConductorsTextsCommand
|
||||||
|
Destructeur
|
||||||
|
*/
|
||||||
MoveConductorsTextsCommand::~MoveConductorsTextsCommand() {
|
MoveConductorsTextsCommand::~MoveConductorsTextsCommand() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// annule le deplacement
|
/**
|
||||||
|
@brief MoveConductorsTextsCommand::undo
|
||||||
|
annule le deplacement
|
||||||
|
*/
|
||||||
void MoveConductorsTextsCommand::undo() {
|
void MoveConductorsTextsCommand::undo() {
|
||||||
diagram -> showMe();
|
diagram -> showMe();
|
||||||
foreach(ConductorTextItem *cti, texts_to_move_.keys()) {
|
foreach(ConductorTextItem *cti, texts_to_move_.keys()) {
|
||||||
@ -328,7 +336,10 @@ void MoveConductorsTextsCommand::undo() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// refait le deplacement
|
/**
|
||||||
|
@brief MoveConductorsTextsCommand::redo
|
||||||
|
refait le deplacement
|
||||||
|
*/
|
||||||
void MoveConductorsTextsCommand::redo() {
|
void MoveConductorsTextsCommand::redo() {
|
||||||
diagram -> showMe();
|
diagram -> showMe();
|
||||||
if (first_redo) {
|
if (first_redo) {
|
||||||
@ -344,11 +355,15 @@ void MoveConductorsTextsCommand::redo() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@brief MoveConductorsTextsCommand::addTextMovement
|
||||||
Ajout un mouvement de champ de texte a cet objet
|
Ajout un mouvement de champ de texte a cet objet
|
||||||
@param text_item Champ de texte deplace ; si celui-ci est deja connu de l'objet d'annulation, il sera ignore
|
@param text_item Champ de texte deplace ;
|
||||||
|
si celui-ci est deja connu de l'objet d'annulation,
|
||||||
|
il sera ignore
|
||||||
@param old_pos Position du champ de texte avant le mouvement
|
@param old_pos Position du champ de texte avant le mouvement
|
||||||
@param new_pos Position du champ de texte apres le mouvement
|
@param new_pos Position du champ de texte apres le mouvement
|
||||||
@param alread_moved true si le champ de texte etait deja a une position personnalisee par l'utilisateur, false sinon
|
@param alread_moved true si le champ de texte etait deja a une position
|
||||||
|
personnalisee par l'utilisateur, false sinon
|
||||||
*/
|
*/
|
||||||
void MoveConductorsTextsCommand::addTextMovement(ConductorTextItem *text_item, const QPointF &old_pos, const QPointF &new_pos, bool already_moved) {
|
void MoveConductorsTextsCommand::addTextMovement(ConductorTextItem *text_item, const QPointF &old_pos, const QPointF &new_pos, bool already_moved) {
|
||||||
// si le champ de texte est deja connu de l'objet d'annulation, il sera ignore
|
// si le champ de texte est deja connu de l'objet d'annulation, il sera ignore
|
||||||
@ -362,6 +377,7 @@ void MoveConductorsTextsCommand::addTextMovement(ConductorTextItem *text_item, c
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@brief MoveConductorsTextsCommand::regenerateTextLabel
|
||||||
Genere la description de l'objet d'annulation
|
Genere la description de l'objet d'annulation
|
||||||
*/
|
*/
|
||||||
void MoveConductorsTextsCommand::regenerateTextLabel() {
|
void MoveConductorsTextsCommand::regenerateTextLabel() {
|
||||||
@ -378,6 +394,7 @@ void MoveConductorsTextsCommand::regenerateTextLabel() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@brief ChangeDiagramTextCommand::ChangeDiagramTextCommand
|
||||||
Constructeur
|
Constructeur
|
||||||
@param dti Champ de texte modifie
|
@param dti Champ de texte modifie
|
||||||
@param before texte avant
|
@param before texte avant
|
||||||
@ -399,19 +416,25 @@ ChangeDiagramTextCommand::ChangeDiagramTextCommand(
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/// destructeur
|
/**
|
||||||
|
@brief ChangeDiagramTextCommand::~ChangeDiagramTextCommand
|
||||||
|
destructeur
|
||||||
|
*/
|
||||||
ChangeDiagramTextCommand::~ChangeDiagramTextCommand() {
|
ChangeDiagramTextCommand::~ChangeDiagramTextCommand() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// annule la modification de texte
|
/**
|
||||||
|
@brief ChangeDiagramTextCommand::undo
|
||||||
|
annule la modification de texte
|
||||||
|
*/
|
||||||
void ChangeDiagramTextCommand::undo() {
|
void ChangeDiagramTextCommand::undo() {
|
||||||
diagram -> showMe();
|
diagram -> showMe();
|
||||||
text_item -> setHtml(text_before);
|
text_item -> setHtml(text_before);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief ChangeDiagramTextCommand::redo
|
@brief ChangeDiagramTextCommand::redo
|
||||||
*/
|
*/
|
||||||
void ChangeDiagramTextCommand::redo()
|
void ChangeDiagramTextCommand::redo()
|
||||||
{
|
{
|
||||||
diagram -> showMe();
|
diagram -> showMe();
|
||||||
@ -419,6 +442,7 @@ void ChangeDiagramTextCommand::redo()
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@brief ChangeConductorCommand::ChangeConductorCommand
|
||||||
Constructeur
|
Constructeur
|
||||||
@param c Conducteur modifie
|
@param c Conducteur modifie
|
||||||
@param old_p ancien profil du conducteur
|
@param old_p ancien profil du conducteur
|
||||||
@ -443,18 +467,27 @@ ChangeConductorCommand::ChangeConductorCommand(
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Destructeur
|
/**
|
||||||
|
@brief ChangeConductorCommand::~ChangeConductorCommand
|
||||||
|
Destructeur
|
||||||
|
*/
|
||||||
ChangeConductorCommand::~ChangeConductorCommand() {
|
ChangeConductorCommand::~ChangeConductorCommand() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Annule la modification du conducteur
|
/**
|
||||||
|
@brief ChangeConductorCommand::undo
|
||||||
|
Annule la modification du conducteur
|
||||||
|
*/
|
||||||
void ChangeConductorCommand::undo() {
|
void ChangeConductorCommand::undo() {
|
||||||
diagram -> showMe();
|
diagram -> showMe();
|
||||||
conductor -> setProfile(old_profile, path_type);
|
conductor -> setProfile(old_profile, path_type);
|
||||||
conductor -> textItem() -> setPos(text_pos_before_mov_);
|
conductor -> textItem() -> setPos(text_pos_before_mov_);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Refait la modification du conducteur
|
/**
|
||||||
|
@brief ChangeConductorCommand::redo
|
||||||
|
Refait la modification du conducteur
|
||||||
|
*/
|
||||||
void ChangeConductorCommand::redo() {
|
void ChangeConductorCommand::redo() {
|
||||||
diagram -> showMe();
|
diagram -> showMe();
|
||||||
if (first_redo) {
|
if (first_redo) {
|
||||||
@ -466,6 +499,7 @@ void ChangeConductorCommand::redo() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@brief ChangeConductorCommand::setConductorTextItemMove
|
||||||
Integre dans cet objet d'annulation le repositionnement du champ de texte
|
Integre dans cet objet d'annulation le repositionnement du champ de texte
|
||||||
du conducteur
|
du conducteur
|
||||||
@param pos_before Position du texte avant la modification du conducteur
|
@param pos_before Position du texte avant la modification du conducteur
|
||||||
@ -526,31 +560,46 @@ void ResetConductorCommand::redo() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@brief ChangeBorderCommand::ChangeBorderCommand
|
||||||
Constructeur
|
Constructeur
|
||||||
@param dia Schema modifie
|
@param dia Schema modifie
|
||||||
@param old_bp Anciennes proprietes du cadre du schema
|
@param old_bp Anciennes proprietes du cadre du schema
|
||||||
@param new_bp Nouvelles proprietes du cadre du schema
|
@param new_bp Nouvelles proprietes du cadre du schema
|
||||||
@param parent QUndoCommand parent
|
@param parent QUndoCommand parent
|
||||||
*/
|
*/
|
||||||
ChangeBorderCommand::ChangeBorderCommand(Diagram *dia, const BorderProperties &old_bp, const BorderProperties &new_bp, QUndoCommand *parent) :
|
ChangeBorderCommand::ChangeBorderCommand(Diagram *dia,
|
||||||
QUndoCommand(QObject::tr("modifier les dimensions du folio", "undo caption"), parent),
|
const BorderProperties &old_bp,
|
||||||
|
const BorderProperties &new_bp,
|
||||||
|
QUndoCommand *parent) :
|
||||||
|
QUndoCommand(
|
||||||
|
QObject::tr("modifier les dimensions du folio", "undo caption"),
|
||||||
|
parent),
|
||||||
diagram(dia),
|
diagram(dia),
|
||||||
old_properties(old_bp),
|
old_properties(old_bp),
|
||||||
new_properties(new_bp)
|
new_properties(new_bp)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Destructeur
|
/**
|
||||||
|
@brief ChangeBorderCommand::~ChangeBorderCommand
|
||||||
|
Destructeur
|
||||||
|
*/
|
||||||
ChangeBorderCommand::~ChangeBorderCommand() {
|
ChangeBorderCommand::~ChangeBorderCommand() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Annule les changements apportes au schema
|
/**
|
||||||
|
@brief ChangeBorderCommand::undo
|
||||||
|
Annule les changements apportes au schema
|
||||||
|
*/
|
||||||
void ChangeBorderCommand::undo() {
|
void ChangeBorderCommand::undo() {
|
||||||
diagram -> showMe();
|
diagram -> showMe();
|
||||||
diagram -> border_and_titleblock.importBorder(old_properties);
|
diagram -> border_and_titleblock.importBorder(old_properties);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Refait les changements apportes au schema
|
/**
|
||||||
|
@brief ChangeBorderCommand::redo
|
||||||
|
Refait les changements apportes au schema
|
||||||
|
*/
|
||||||
void ChangeBorderCommand::redo() {
|
void ChangeBorderCommand::redo() {
|
||||||
diagram -> showMe();
|
diagram -> showMe();
|
||||||
diagram -> border_and_titleblock.importBorder(new_properties);
|
diagram -> border_and_titleblock.importBorder(new_properties);
|
||||||
|
@ -82,6 +82,7 @@ QString itemText(const IndependentTextItem *item);
|
|||||||
QString itemText(const Conductor *item);
|
QString itemText(const Conductor *item);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@brief The PasteDiagramCommand class
|
||||||
This command pastes some content onto a particular diagram.
|
This command pastes some content onto a particular diagram.
|
||||||
*/
|
*/
|
||||||
class PasteDiagramCommand : public QUndoCommand {
|
class PasteDiagramCommand : public QUndoCommand {
|
||||||
@ -110,6 +111,7 @@ class PasteDiagramCommand : public QUndoCommand {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@brief The CutDiagramCommand class
|
||||||
This command cuts content from a particular diagram.
|
This command cuts content from a particular diagram.
|
||||||
*/
|
*/
|
||||||
class CutDiagramCommand : public DeleteQGraphicsItemCommand {
|
class CutDiagramCommand : public DeleteQGraphicsItemCommand {
|
||||||
@ -122,6 +124,7 @@ class CutDiagramCommand : public DeleteQGraphicsItemCommand {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@brief The MoveElementsCommand class
|
||||||
This command moves some content on a particular diagram.
|
This command moves some content on a particular diagram.
|
||||||
*/
|
*/
|
||||||
class MoveElementsCommand : public QUndoCommand {
|
class MoveElementsCommand : public QUndoCommand {
|
||||||
@ -156,8 +159,9 @@ class MoveElementsCommand : public QUndoCommand {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
This command moves text items related to conductors on a particular
|
@brief The MoveConductorsTextsCommand class
|
||||||
diagram.
|
This command moves text items related to conductors
|
||||||
|
on a particular diagram.
|
||||||
*/
|
*/
|
||||||
class MoveConductorsTextsCommand : public QUndoCommand {
|
class MoveConductorsTextsCommand : public QUndoCommand {
|
||||||
// constructors, destructor
|
// constructors, destructor
|
||||||
|
@ -92,9 +92,17 @@ void ExportPropertiesWidget::setExportProperties(const ExportProperties &export_
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@brief ExportPropertiesWidget::setPrintingMode
|
||||||
|
Puts the widget in Print or Export mode. Print mode
|
||||||
|
does not display as many options as Export mode.
|
||||||
|
/
|
||||||
Passe le widget en mode Impression ou en mode Export. Le mode Impression
|
Passe le widget en mode Impression ou en mode Export. Le mode Impression
|
||||||
n'affiche pas autant d'options que le mode Export.
|
n'affiche pas autant d'options que le mode Export.
|
||||||
@param mode true pour utiliser le widget en mode impression, false pour
|
@param mode
|
||||||
|
true to use the widget in print mode,
|
||||||
|
false to use it in export mode
|
||||||
|
/
|
||||||
|
true pour utiliser le widget en mode impression, false pour
|
||||||
l'utiliser en mode export
|
l'utiliser en mode export
|
||||||
*/
|
*/
|
||||||
void ExportPropertiesWidget::setPrintingMode(bool mode) {
|
void ExportPropertiesWidget::setPrintingMode(bool mode) {
|
||||||
|
@ -240,6 +240,7 @@ void Terminal::removeConductor(Conductor *conductor)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@brief Terminal::paint
|
||||||
Fonction de dessin des bornes
|
Fonction de dessin des bornes
|
||||||
@param p Le QPainter a utiliser
|
@param p Le QPainter a utiliser
|
||||||
@param options Les options de dessin
|
@param options Les options de dessin
|
||||||
@ -405,6 +406,7 @@ QLineF Terminal::HelpLine() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@brief Terminal::boundingRect
|
||||||
@return Le rectangle (en precision flottante) delimitant la borne et ses alentours.
|
@return Le rectangle (en precision flottante) delimitant la borne et ses alentours.
|
||||||
*/
|
*/
|
||||||
QRectF Terminal::boundingRect() const {
|
QRectF Terminal::boundingRect() const {
|
||||||
@ -485,6 +487,7 @@ Terminal* Terminal::alignedWithTerminal() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@brief Terminal::hoverEnterEvent
|
||||||
Gere l'entree de la souris sur la zone de la Borne.
|
Gere l'entree de la souris sur la zone de la Borne.
|
||||||
*/
|
*/
|
||||||
void Terminal::hoverEnterEvent(QGraphicsSceneHoverEvent *) {
|
void Terminal::hoverEnterEvent(QGraphicsSceneHoverEvent *) {
|
||||||
@ -493,12 +496,14 @@ void Terminal::hoverEnterEvent(QGraphicsSceneHoverEvent *) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@brief Terminal::hoverMoveEvent
|
||||||
Gere les mouvements de la souris sur la zone de la Borne.
|
Gere les mouvements de la souris sur la zone de la Borne.
|
||||||
*/
|
*/
|
||||||
void Terminal::hoverMoveEvent(QGraphicsSceneHoverEvent *) {
|
void Terminal::hoverMoveEvent(QGraphicsSceneHoverEvent *) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@brief Terminal::hoverLeaveEvent
|
||||||
Gere le fait que la souris sorte de la zone de la Borne.
|
Gere le fait que la souris sorte de la zone de la Borne.
|
||||||
*/
|
*/
|
||||||
void Terminal::hoverLeaveEvent(QGraphicsSceneHoverEvent *) {
|
void Terminal::hoverLeaveEvent(QGraphicsSceneHoverEvent *) {
|
||||||
@ -507,6 +512,7 @@ void Terminal::hoverLeaveEvent(QGraphicsSceneHoverEvent *) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@brief Terminal::mousePressEvent
|
||||||
Gere le fait qu'on enfonce un bouton de la souris sur la Borne.
|
Gere le fait qu'on enfonce un bouton de la souris sur la Borne.
|
||||||
@param e L'evenement souris correspondant
|
@param e L'evenement souris correspondant
|
||||||
*/
|
*/
|
||||||
@ -520,6 +526,7 @@ void Terminal::mousePressEvent(QGraphicsSceneMouseEvent *e) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@brief Terminal::mouseMoveEvent
|
||||||
Gere le fait qu'on bouge la souris sur la Borne.
|
Gere le fait qu'on bouge la souris sur la Borne.
|
||||||
@param e L'evenement souris correspondant
|
@param e L'evenement souris correspondant
|
||||||
*/
|
*/
|
||||||
@ -660,6 +667,7 @@ void Terminal::updateConductor() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@brief Terminal::isLinkedTo
|
||||||
@param other_terminal Autre borne
|
@param other_terminal Autre borne
|
||||||
@return true si cette borne est reliee a other_terminal, false sion
|
@return true si cette borne est reliee a other_terminal, false sion
|
||||||
*/
|
*/
|
||||||
@ -695,6 +703,7 @@ bool Terminal::canBeLinkedTo(Terminal *other_terminal)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@brief Terminal::conductors
|
||||||
@return La liste des conducteurs lies a cette borne
|
@return La liste des conducteurs lies a cette borne
|
||||||
*/
|
*/
|
||||||
QList<Conductor *> Terminal::conductors() const {
|
QList<Conductor *> Terminal::conductors() const {
|
||||||
@ -702,6 +711,7 @@ QList<Conductor *> Terminal::conductors() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@brief Terminal::toXml
|
||||||
Methode d'export en XML
|
Methode d'export en XML
|
||||||
@param doc Le Document XML a utiliser pour creer l'element XML
|
@param doc Le Document XML a utiliser pour creer l'element XML
|
||||||
@return un QDomElement representant cette borne
|
@return un QDomElement representant cette borne
|
||||||
@ -718,6 +728,7 @@ QDomElement Terminal::toXml(QDomDocument &doc) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@brief Terminal::valideXml
|
||||||
Permet de savoir si un element XML represente une borne
|
Permet de savoir si un element XML represente une borne
|
||||||
@param terminal Le QDomElement a analyser
|
@param terminal Le QDomElement a analyser
|
||||||
@return true si le QDomElement passe en parametre est une borne, false sinon
|
@return true si le QDomElement passe en parametre est une borne, false sinon
|
||||||
@ -754,9 +765,12 @@ bool Terminal::valideXml(QDomElement &terminal) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Permet de savoir si un element XML represente cette borne. Attention, l'element XML n'est pas verifie
|
@brief Terminal::fromXml
|
||||||
|
Permet de savoir si un element XML represente cette borne. Attention,
|
||||||
|
l'element XML n'est pas verifie
|
||||||
@param terminal Le QDomElement a analyser
|
@param terminal Le QDomElement a analyser
|
||||||
@return true si la borne "se reconnait" (memes coordonnes, meme orientation), false sinon
|
@return true si la borne "se reconnait"
|
||||||
|
(memes coordonnes, meme orientation), false sinon
|
||||||
*/
|
*/
|
||||||
bool Terminal::fromXml(QDomElement &terminal) {
|
bool Terminal::fromXml(QDomElement &terminal) {
|
||||||
number_terminal_ = terminal.attribute("number");
|
number_terminal_ = terminal.attribute("number");
|
||||||
@ -771,21 +785,25 @@ bool Terminal::fromXml(QDomElement &terminal) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@return the position, relative to the scene, of the docking point for
|
@brief Terminal::dockConductor
|
||||||
conductors.
|
@return the position, relative to the scene, of the docking point for
|
||||||
|
conductors.
|
||||||
*/
|
*/
|
||||||
QPointF Terminal::dockConductor() const {
|
QPointF Terminal::dockConductor() const {
|
||||||
return(mapToScene(d->m_pos));
|
return(mapToScene(d->m_pos));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@return le Diagram auquel cette borne appartient, ou 0 si cette borne est independant
|
@brief Terminal::diagram
|
||||||
|
@return le Diagram auquel cette borne appartient,
|
||||||
|
ou 0 si cette borne est independant
|
||||||
*/
|
*/
|
||||||
Diagram *Terminal::diagram() const {
|
Diagram *Terminal::diagram() const {
|
||||||
return(qobject_cast<Diagram *>(scene()));
|
return(qobject_cast<Diagram *>(scene()));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@brief Terminal::parentElement
|
||||||
@return L'element auquel cette borne est rattachee
|
@return L'element auquel cette borne est rattachee
|
||||||
*/
|
*/
|
||||||
Element *Terminal::parentElement() const {
|
Element *Terminal::parentElement() const {
|
||||||
|
@ -26,6 +26,7 @@ class Element;
|
|||||||
class TerminalData;
|
class TerminalData;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@brief The Terminal class
|
||||||
This class represents a terminal of an electrical element, i.e. a possible
|
This class represents a terminal of an electrical element, i.e. a possible
|
||||||
plug point for conductors.
|
plug point for conductors.
|
||||||
This class handles all mouse events for connecting conductors
|
This class handles all mouse events for connecting conductors
|
||||||
@ -51,8 +52,12 @@ class Terminal : public QGraphicsObject
|
|||||||
|
|
||||||
// methods
|
// methods
|
||||||
public:
|
public:
|
||||||
//Enable the use of qgraphicsitem_cast to safely cast a QGraphicsItem into a Terminal
|
/**
|
||||||
//@return the QGraphicsItem type
|
@brief type
|
||||||
|
Enable the use of qgraphicsitem_cast to safely
|
||||||
|
cast a QGraphicsItem into a Terminal
|
||||||
|
@return the QGraphicsItem type
|
||||||
|
*/
|
||||||
int type() const override { return Type; }
|
int type() const override { return Type; }
|
||||||
|
|
||||||
void paint (QPainter *, const QStyleOptionGraphicsItem *, QWidget *) override;
|
void paint (QPainter *, const QStyleOptionGraphicsItem *, QWidget *) override;
|
||||||
@ -146,6 +151,7 @@ class Terminal : public QGraphicsObject
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@brief Terminal::conductorsCount
|
||||||
@return the number of conductors attached to the terminal.
|
@return the number of conductors attached to the terminal.
|
||||||
*/
|
*/
|
||||||
inline int Terminal::conductorsCount() const {
|
inline int Terminal::conductorsCount() const {
|
||||||
@ -153,6 +159,7 @@ inline int Terminal::conductorsCount() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@brief Terminal::number
|
||||||
@return the number of terminal.
|
@return the number of terminal.
|
||||||
*/
|
*/
|
||||||
inline QString Terminal::number() const {
|
inline QString Terminal::number() const {
|
||||||
|
@ -19,10 +19,20 @@
|
|||||||
#include "singleapplication.h"
|
#include "singleapplication.h"
|
||||||
#include <QFileOpenEvent>
|
#include <QFileOpenEvent>
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief MacOSXOpenEvent::MacOSXOpenEvent
|
||||||
|
@param parent
|
||||||
|
*/
|
||||||
MacOSXOpenEvent::MacOSXOpenEvent(QObject *parent) :
|
MacOSXOpenEvent::MacOSXOpenEvent(QObject *parent) :
|
||||||
QObject(parent)
|
QObject(parent)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief MacOSXOpenEvent::eventFilter
|
||||||
|
@param watched
|
||||||
|
@param event
|
||||||
|
@return bool
|
||||||
|
*/
|
||||||
bool MacOSXOpenEvent::eventFilter(QObject *watched, QEvent *event)
|
bool MacOSXOpenEvent::eventFilter(QObject *watched, QEvent *event)
|
||||||
{
|
{
|
||||||
if (event->type() == QEvent::FileOpen)
|
if (event->type() == QEvent::FileOpen)
|
||||||
|
@ -19,6 +19,11 @@
|
|||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief QETUtils::marginsToString
|
||||||
|
@param margins
|
||||||
|
@return QString str "left;top;right;bottom"
|
||||||
|
*/
|
||||||
QString QETUtils::marginsToString(const QMargins &margins)
|
QString QETUtils::marginsToString(const QMargins &margins)
|
||||||
{
|
{
|
||||||
QString str;
|
QString str;
|
||||||
@ -33,6 +38,11 @@ QString QETUtils::marginsToString(const QMargins &margins)
|
|||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief QETUtils::marginsFromString
|
||||||
|
@param string
|
||||||
|
@return QMargins margins
|
||||||
|
*/
|
||||||
QMargins QETUtils::marginsFromString(const QString &string)
|
QMargins QETUtils::marginsFromString(const QString &string)
|
||||||
{
|
{
|
||||||
QMargins margins;
|
QMargins margins;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user