mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-04-15 13:09:58 +02:00
Fix various typos in source documentation and comments (cont.)
Found via `codespell`
This commit is contained in:
committed by
Laurent Trinques
parent
a76e5446aa
commit
1994235bc5
@@ -177,7 +177,7 @@ QVariant ProjectDBModel::data(const QModelIndex &index, int role) const
|
||||
|
||||
/**
|
||||
@brief ProjectDBModel::setQuery
|
||||
Query the internall bd with query.
|
||||
Query the internal bd with query.
|
||||
@param query
|
||||
*/
|
||||
void ProjectDBModel::setQuery(const QString &query)
|
||||
|
||||
@@ -34,7 +34,7 @@ class QETProject;
|
||||
void ProjectDBModel::setQuery(const QString &query).
|
||||
The indentifier method is used by widget editor to retrieve
|
||||
the good widget for edit the query.
|
||||
By defaut identifer return the string 'unknow'.
|
||||
By default identifer returns the string 'unknow'.
|
||||
You should use setIdentfier method to set your custom identifier.
|
||||
At the time this sentence is written, there is two identifier :
|
||||
nomenclature
|
||||
|
||||
@@ -39,7 +39,7 @@ QetGraphicsHeaderItem::QetGraphicsHeaderItem(QGraphicsItem *parent) :
|
||||
@brief QetGraphicsHeaderItem::setModel
|
||||
Set the model presented by this item
|
||||
Since QetGraphicsHeaderItem don't take ownership of model,
|
||||
if item already have a model, it's your responsability to delete it.
|
||||
if item already have a model, it's your responsibility to delete it.
|
||||
@param model
|
||||
*/
|
||||
void QetGraphicsHeaderItem::setModel(QAbstractItemModel *model)
|
||||
|
||||
@@ -32,7 +32,7 @@ class QAbstractItemModel;
|
||||
Margins, to edit the margin between the cell and the text.
|
||||
Text font.
|
||||
Text alignment in the cell
|
||||
These three parameters are not settable directly with the header but trough the model to be displayed by the header.
|
||||
These three parameters are not settable directly with the header but through the model to be displayed by the header.
|
||||
Header search these parameters only in the section 0 for cell of header.
|
||||
By consequence, set data in other section is useless also these parameter can't be set individually for each cell.
|
||||
The margins is stored in the model in index Qt::UserRole+1 and for value a QString. See QETUtils::marginsFromString and QETUtils::marginsToString
|
||||
|
||||
@@ -34,7 +34,7 @@ class QetGraphicsHeaderItem;
|
||||
Margins, to edit the margin between the cell and the text.
|
||||
Text font.
|
||||
Text alignment in the cell
|
||||
These three parameters are not settable directly with the table but trough the model to be displayed by the table.
|
||||
These three parameters are not settable directly with the table but through the model to be displayed by the table.
|
||||
The table search these parameters only in the index(0,0) for all the table.
|
||||
By consequence, set data in other index than 0,0 is useless also these parameter can't be set individually for each cell.
|
||||
The margins is stored in the model in index Qt::UserRole+1 and for value a QString. See QETUtils::marginsFromString and QETUtils::marginsToString
|
||||
|
||||
@@ -92,13 +92,13 @@ Conductor::Conductor(Terminal *p1, Terminal* p2) :
|
||||
setZValue(11);
|
||||
m_previous_z_value = zValue();
|
||||
|
||||
//Add this conductor to the list of conductor of each of the two terminal
|
||||
//Add this conductor to the list of conductors of each of the two terminals
|
||||
bool ajout_p1 = terminal1 -> addConductor(this);
|
||||
bool ajout_p2 = terminal2 -> addConductor(this);
|
||||
//m_valid become false if the conductor can't be added to terminal (conductor already exist)
|
||||
m_valid = (!ajout_p1 || !ajout_p2) ? false : true;
|
||||
|
||||
//Default attribut for paint a conductor
|
||||
//Default attribute to paint a conductor
|
||||
if (!pen_and_brush_initialized)
|
||||
{
|
||||
conductor_pen.setJoinStyle(Qt::MiterJoin);
|
||||
@@ -111,7 +111,7 @@ Conductor::Conductor(Terminal *p1, Terminal* p2) :
|
||||
pen_and_brush_initialized = true;
|
||||
}
|
||||
|
||||
//By default, the 4 profils are nuls -> we must to use priv_calculeConductor
|
||||
//By default, the 4 profiles are nuls -> we must use priv_calculeConductor
|
||||
conductor_profiles.insert(Qt::TopLeftCorner, ConductorProfile());
|
||||
conductor_profiles.insert(Qt::TopRightCorner, ConductorProfile());
|
||||
conductor_profiles.insert(Qt::BottomLeftCorner, ConductorProfile());
|
||||
@@ -135,7 +135,7 @@ Conductor::Conductor(Terminal *p1, Terminal* p2) :
|
||||
|
||||
/**
|
||||
@brief Conductor::~Conductor
|
||||
Destructor. The conductor is removed from is terminal
|
||||
Destructor. The conductor is removed from its terminal
|
||||
*/
|
||||
Conductor::~Conductor()
|
||||
{
|
||||
@@ -847,7 +847,7 @@ void Conductor::handlerMouseReleaseEvent(QetGraphicsHandlerItem *qghi, QGraphics
|
||||
saveProfile();
|
||||
has_to_save_profile = false;
|
||||
}
|
||||
//When handler is released, the conductor can have more segment than befor the handler was moved
|
||||
//When handler is released, the conductor can have more segment than before the handler was moved
|
||||
//then we remove all handles and new ones are added
|
||||
removeHandler();
|
||||
addHandler();
|
||||
@@ -1036,7 +1036,7 @@ QDomElement Conductor::toXml(QDomDocument &dom_document,
|
||||
// Terminal is uniquely identified by the uuid of the terminal and the element
|
||||
if (terminal1->uuid().isNull()) {
|
||||
// legacy method to identify the terminal
|
||||
dom_element.setAttribute("terminal1", table_adr_id.value(terminal1)); // for backward compability
|
||||
dom_element.setAttribute("terminal1", table_adr_id.value(terminal1)); // for backward compatibility
|
||||
} else {
|
||||
dom_element.setAttribute("element1", terminal1->parentElement()->uuid().toString());
|
||||
dom_element.setAttribute("terminal1", terminal1->uuid().toString());
|
||||
@@ -1044,7 +1044,7 @@ QDomElement Conductor::toXml(QDomDocument &dom_document,
|
||||
|
||||
if (terminal2->uuid().isNull()) {
|
||||
// legacy method to identify the terminal
|
||||
dom_element.setAttribute("terminal2", table_adr_id.value(terminal2)); // for backward compability
|
||||
dom_element.setAttribute("terminal2", table_adr_id.value(terminal2)); // for backward compatibility
|
||||
} else {
|
||||
dom_element.setAttribute("element2", terminal2->parentElement()->uuid().toString());
|
||||
dom_element.setAttribute("terminal2", terminal2->uuid().toString());
|
||||
@@ -1242,7 +1242,7 @@ QPointF Conductor::posForText(Qt::Orientations &flag)
|
||||
bool all_segment_is_vertical = true;
|
||||
bool all_segment_is_horizontal = true;
|
||||
|
||||
//Go to first segement
|
||||
//Go to first segment
|
||||
while (!segment->isFirstSegment()) {
|
||||
segment = segment->previousSegment();
|
||||
}
|
||||
@@ -1265,7 +1265,7 @@ QPointF Conductor::posForText(Qt::Orientations &flag)
|
||||
if (segment -> firstPoint().y() != segment -> secondPoint().y())
|
||||
all_segment_is_horizontal = false;
|
||||
|
||||
//We must to compare length segment, but they can be negative
|
||||
//We must compare length segment, but they can be negative
|
||||
//so we multiply by -1 to make it positive.
|
||||
int saved = biggest_segment -> length();
|
||||
if (saved < 0) saved *= -1;
|
||||
@@ -1517,7 +1517,7 @@ QPainterPath Conductor::path() const
|
||||
@brief Conductor::setPropertiesToPotential
|
||||
@param property
|
||||
@param only_text
|
||||
Set propertie to conductor and every conductors in
|
||||
Set property to conductor and every conductors in
|
||||
the same potential of conductor.
|
||||
If only_text is true only formula, text,
|
||||
function and tension/protocol is set
|
||||
@@ -1760,7 +1760,7 @@ void Conductor::setUpConnectionForFormula(QString old_formula, QString new_formu
|
||||
if (diagram())
|
||||
{
|
||||
//Because the variable %F is a reference to another text which can contain variables,
|
||||
//we must to replace %F by the real text, to check if the real text contain the variable %id
|
||||
//we must replace %F by the real text, to check if the real text contains the variable %id
|
||||
if (old_formula.contains("%F"))
|
||||
old_formula.replace("%F", diagram()->border_and_titleblock.folio());
|
||||
|
||||
@@ -2063,8 +2063,8 @@ Conductor * longuestConductorInPotential(Conductor *conductor, bool all_diagram)
|
||||
@brief relatedConductors
|
||||
@param conductor
|
||||
@return return all conductors who share the same terminals
|
||||
of conductor given as parametre,
|
||||
except conductor himself.
|
||||
of conductor given as parameter,
|
||||
except conductor itself.
|
||||
*/
|
||||
QList <Conductor *> relatedConductors(const Conductor *conductor) {
|
||||
QList<Conductor *> other_conductors_list = conductor -> terminal1 -> conductors();
|
||||
|
||||
@@ -188,7 +188,7 @@ class Conductor : public QGraphicsObject
|
||||
ConductorTextItem *m_text_item;
|
||||
/// Segments composing the conductor
|
||||
ConductorSegment *segments;
|
||||
/// Attributs related to mouse interaction
|
||||
/// Attributes related to mouse interaction
|
||||
bool m_moving_segment;
|
||||
int moved_point;
|
||||
qreal m_previous_z_value;
|
||||
|
||||
@@ -165,7 +165,7 @@ QPainterPath CrossRefItem::shape() const{
|
||||
@param add_prefix
|
||||
@return the string corresponding to the position of elmt in the diagram.
|
||||
if add_prefix is true,
|
||||
prefix (for power and delay contact) is added to the poistion text.
|
||||
prefix (for power and delay contact) is added to the position text.
|
||||
*/
|
||||
QString CrossRefItem::elementPositionText(
|
||||
const Element *elmt, const bool &add_prefix) const
|
||||
@@ -190,7 +190,7 @@ QString CrossRefItem::elementPositionText(
|
||||
|
||||
/**
|
||||
@brief CrossRefItem::updateProperties
|
||||
update the curent properties
|
||||
update the current properties
|
||||
*/
|
||||
void CrossRefItem::updateProperties()
|
||||
{
|
||||
@@ -247,7 +247,7 @@ void CrossRefItem::updateLabel()
|
||||
|
||||
/**
|
||||
@brief CrossRefItem::autoPos
|
||||
Calculate and set position automaticaly.
|
||||
Calculate and set position automatically.
|
||||
*/
|
||||
void CrossRefItem::autoPos()
|
||||
{
|
||||
@@ -546,7 +546,7 @@ void CrossRefItem::setUpCrossBoundingRect(QPainter &painter)
|
||||
}
|
||||
//Adjust according to the NC
|
||||
if (nc_bounding.height() > default_bounding.height() - header)
|
||||
default_bounding.setHeight(nc_bounding.height() + header); //adjust the heigth
|
||||
default_bounding.setHeight(nc_bounding.height() + header); //adjust the height
|
||||
if (nc_bounding.width() > default_bounding.width()/2)
|
||||
default_bounding.setWidth(nc_bounding.width()*2);//adjust the width
|
||||
|
||||
@@ -660,7 +660,7 @@ QRectF CrossRefItem::drawContact(QPainter &painter, int flags, Element *elmt)
|
||||
painter.drawLine(0, offset+6, 8, offset+6);
|
||||
painter.drawLine(16, offset+6, 24, offset+6);
|
||||
|
||||
///take exemple of this code for display the terminal text
|
||||
///take example of this code for display the terminal text
|
||||
/*QFont font = QETApp::diagramTextsFont(4);
|
||||
font.setBold(true);
|
||||
painter.setFont(font);
|
||||
@@ -986,11 +986,11 @@ void CrossRefItem::AddExtraInfo(QPainter &painter, const QString& type)
|
||||
|
||||
/**
|
||||
@brief CrossRefItem::NOElements
|
||||
@return The linked elements of m_element wich are open or switch contact.
|
||||
@return The linked elements of m_element which are open or switch contact.
|
||||
If linked element is a power contact,
|
||||
xref propertie is set to don't show power contact
|
||||
and this cross item must be drawed as cross,
|
||||
the element is not append in the list.
|
||||
xref property is set to not show power contact
|
||||
and this cross item must be drawn as a cross,
|
||||
the element is not appended in the list.
|
||||
*/
|
||||
QList<Element *> CrossRefItem::NOElements() const
|
||||
{
|
||||
@@ -998,8 +998,8 @@ QList<Element *> CrossRefItem::NOElements() const
|
||||
|
||||
foreach (Element *elmt, m_element->linkedElements())
|
||||
{
|
||||
//We continue if element is a power contact and xref propertie
|
||||
//is set to don't show power contact
|
||||
//We continue if element is a power contact and xref property
|
||||
//is set to not show power contact
|
||||
if (m_properties.displayHas() == XRefProperties::Cross &&
|
||||
!m_properties.showPowerContact() &&
|
||||
elmt -> kindInformations()["type"].toString() == "power")
|
||||
@@ -1018,12 +1018,12 @@ QList<Element *> CrossRefItem::NOElements() const
|
||||
|
||||
/**
|
||||
@brief CrossRefItem::NCElements
|
||||
@return The linked elements of m_element wich are close
|
||||
@return The linked elements of m_element which are close
|
||||
or switch contact
|
||||
If linked element is a power contact,
|
||||
xref propertie is set to don't show power contact
|
||||
and this cross item must be drawed as cross,
|
||||
the element is not append in the list.
|
||||
xref property is set to not show power contact
|
||||
and this cross item must be drawn as a cross,
|
||||
the element is not appended in the list.
|
||||
*/
|
||||
QList<Element *> CrossRefItem::NCElements() const
|
||||
{
|
||||
@@ -1031,8 +1031,8 @@ QList<Element *> CrossRefItem::NCElements() const
|
||||
|
||||
foreach (Element *elmt, m_element->linkedElements())
|
||||
{
|
||||
//We continue if element is a power contact and xref propertie
|
||||
//is set to don't show power contact
|
||||
//We continue if element is a power contact and xref property
|
||||
//is set to not show power contact
|
||||
if (m_properties.displayHas() == XRefProperties::Cross &&
|
||||
!m_properties.showPowerContact() &&
|
||||
elmt -> kindInformations()["type"].toString() == "power")
|
||||
|
||||
@@ -32,11 +32,11 @@ class ElementTextItemGroup;
|
||||
@brief The CrossRefItem class
|
||||
This clas provide an item, for show the cross reference,
|
||||
like the contacts linked to a coil.
|
||||
The item setpos automaticaly when parent move.
|
||||
The item setpos automatically when parent move.
|
||||
All slave displayed in cross ref will be updated
|
||||
when folio position change in the project.
|
||||
It's the responsability of the master element
|
||||
to informe displayed slave are moved,
|
||||
It's the responsibility of the master element
|
||||
to inform displayed slave are moved,
|
||||
by calling the slot updateLabel
|
||||
By default master element is the parent graphics item of this Xref,
|
||||
but if the Xref must be snap to the label of master,
|
||||
|
||||
@@ -83,7 +83,7 @@ void DiagramImageItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *
|
||||
|
||||
/**
|
||||
@brief DiagramImageItem::editProperty
|
||||
Open the approriate dialog to edit this image
|
||||
Open the appropriate dialog to edit this image
|
||||
*/
|
||||
void DiagramImageItem::editProperty()
|
||||
{
|
||||
@@ -129,9 +129,9 @@ QString DiagramImageItem::name() const
|
||||
|
||||
/**
|
||||
@brief DiagramImageItem::fromXml
|
||||
Load this image fro xml elemebt e
|
||||
Load this image from xml element e
|
||||
@param e
|
||||
@return true if succesfully load.
|
||||
@return true if successfully loaded.
|
||||
*/
|
||||
bool DiagramImageItem::fromXml(const QDomElement &e)
|
||||
{
|
||||
|
||||
@@ -236,11 +236,11 @@ bool DiagramTextItem::isHtml() const
|
||||
|
||||
/**
|
||||
@brief DiagramTextItem::paint
|
||||
Draw this text field. This method draw the text by calling QGraphicsTextItem::paint.
|
||||
If text is hovered, this method draw the bounding rect in grey
|
||||
Draw this text field. This method draws the text by calling QGraphicsTextItem::paint.
|
||||
If text is hovered, this method draws the bounding rect in grey
|
||||
@param painter : painter to use
|
||||
@param option : style option
|
||||
@param widget : widget where must to draw
|
||||
@param widget : widget that is drawn to
|
||||
*/
|
||||
void DiagramTextItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
|
||||
{
|
||||
@@ -413,7 +413,7 @@ void DiagramTextItem::prepareAlignment()
|
||||
|
||||
/**
|
||||
@brief DiagramTextItem::finishAlignment
|
||||
Call this function after changing the bouding rect of this text
|
||||
Call this function after changing the bounding rect of this text
|
||||
to set the position of this text according to the alignment property.
|
||||
*/
|
||||
void DiagramTextItem::finishAlignment()
|
||||
|
||||
@@ -475,9 +475,9 @@ void DynamicElementTextItem::setCompositeText(const QString &text)
|
||||
if (m_parent_element && (m_parent_element.data()->linkType() & Element::AllReport)) //special treatment for report
|
||||
{
|
||||
/*
|
||||
* May be in some case the old and new composite text have both the var %{label},
|
||||
* and so we don't have to remove connection and after set conection,
|
||||
* but for that we must to do several check and because I'm lazy,
|
||||
* May be in some case the old and new composite text both have the var %{label},
|
||||
* and so we don't have to remove connection and after set connection,
|
||||
* but for that we must do several checks and because I'm lazy,
|
||||
* in every case I remove connection and set it after ;)
|
||||
*/
|
||||
if(old_composite_text.contains("%{label}"))
|
||||
@@ -691,7 +691,7 @@ void DynamicElementTextItem::paint(QPainter *painter, const QStyleOptionGraphics
|
||||
|
||||
QVariant DynamicElementTextItem::itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value)
|
||||
{
|
||||
//The first time this text is added to a scene, we make several cheking and connection
|
||||
//The first time this text is added to a scene, we make several checking and connection
|
||||
//according to the link type of the parent element
|
||||
if(change == QGraphicsItem::ItemSceneHasChanged && m_first_scene_change)
|
||||
{
|
||||
@@ -785,7 +785,7 @@ void DynamicElementTextItem::elementInfoChanged()
|
||||
|
||||
if (m_text_from == ElementInfo)
|
||||
{
|
||||
//If the info is the label, then we must to make some connection
|
||||
//If the info is the label, then we must make some connection
|
||||
//if the label is created from a formula
|
||||
if(m_info_name == "label")
|
||||
{
|
||||
@@ -801,7 +801,7 @@ void DynamicElementTextItem::elementInfoChanged()
|
||||
}
|
||||
else if (m_text_from == CompositeText)
|
||||
{
|
||||
//If the composite have the label variable, we must to make some
|
||||
//If the composite have the label variable, we must make some
|
||||
//connection if the label is created from a formula
|
||||
if (m_composite_text.contains("%{label}"))
|
||||
setupFormulaConnection();
|
||||
@@ -911,7 +911,7 @@ void DynamicElementTextItem::setConnectionForReportFormula(const QString &formul
|
||||
Diagram *other_diagram = m_other_report.data()->diagram();
|
||||
|
||||
//Because the variable %F is a reference to another text which can contain variables,
|
||||
//we must to replace %F by the real text, to check if the real text contain the variable %id
|
||||
//we must replace %F by the real text, to check if the real text contains the variable %id
|
||||
if (other_diagram && string.contains("%F"))
|
||||
{
|
||||
m_F_str = other_diagram->border_and_titleblock.folio();
|
||||
@@ -940,7 +940,7 @@ void DynamicElementTextItem::removeConnectionForReportFormula(const QString &for
|
||||
Diagram *other_diagram = m_other_report.data()->diagram();
|
||||
|
||||
//Because the variable %F is a reference to another text which can contain variables,
|
||||
//we must to replace %F by the real text, to check if the real text contain the variable %id
|
||||
//we must replace %F with the real text, to check if the real text contains the variable %id
|
||||
if (other_diagram && string.contains("%F"))
|
||||
{
|
||||
string.replace("%F", m_F_str);
|
||||
|
||||
@@ -78,7 +78,7 @@ class ElementXmlRetroCompatibility
|
||||
@brief Element::Element
|
||||
@param location : location of this element
|
||||
@param parent : parent graphics item
|
||||
@param state : state of the instanciation
|
||||
@param state : state of the instantiation
|
||||
@param link_type
|
||||
*/
|
||||
Element::Element(
|
||||
@@ -238,7 +238,7 @@ void Element::paint(
|
||||
painter->drawPicture(0, 0, m_picture);
|
||||
}
|
||||
|
||||
painter->restore(); //Restor the QPainter after use drawPicture
|
||||
painter->restore(); //Restorr the QPainter after use drawPicture
|
||||
|
||||
//Draw the selection rectangle
|
||||
if ( isSelected() || m_mouse_over ) {
|
||||
@@ -426,7 +426,7 @@ bool Element::buildFromXml(const QDomElement &xml_def_elmt, int *state)
|
||||
return(false);
|
||||
}
|
||||
|
||||
//Check if the curent version can read the xml description
|
||||
//Check if the current version can read the xml description
|
||||
if (xml_def_elmt.hasAttribute(QStringLiteral("version")))
|
||||
{
|
||||
bool conv_ok;
|
||||
@@ -627,7 +627,7 @@ bool Element::parseInput(const QDomElement &dom_element)
|
||||
|
||||
/**
|
||||
@brief Element::parseDynamicText
|
||||
Create the dynamic text field describ in dom_element
|
||||
Create the dynamic text field described in dom_element
|
||||
@param dom_element
|
||||
@return
|
||||
*/
|
||||
@@ -637,7 +637,7 @@ DynamicElementTextItem *Element::parseDynamicText(
|
||||
DynamicElementTextItem *deti = new DynamicElementTextItem(this);
|
||||
//Because the xml description of a .elmt file is the same as how a dynamic text field is save to xml in a .qet file
|
||||
//wa call fromXml, we just change the tagg name (.elmt = dynamic_text, .qet = dynamic_elmt_text)
|
||||
//and the uuid (because the uuid, is the uuid of the descritpion and not the uuid of instantiated dynamic text field)
|
||||
//and the uuid (because the uuid, is the uuid of the description and not the uuid of instantiated dynamic text field)
|
||||
|
||||
QDomElement dom(dom_element.cloneNode(true).toElement());
|
||||
dom.setTagName(DynamicElementTextItem::xmlTagName());
|
||||
@@ -664,7 +664,7 @@ Terminal *Element::parseTerminal(const QDomElement &dom_element)
|
||||
Terminal *new_terminal = new Terminal(data, this);
|
||||
m_terminals << new_terminal;
|
||||
|
||||
//Sort from top to bottom and left to rigth
|
||||
//Sort from top to bottom and left to right
|
||||
std::sort(m_terminals.begin(),
|
||||
m_terminals.end(),
|
||||
[](Terminal *a,
|
||||
@@ -747,7 +747,7 @@ bool Element::fromXml(QDomElement &e,
|
||||
}
|
||||
|
||||
|
||||
//Check that associated id/adress doesn't conflict with table_id_adr
|
||||
//Check that associated id/address doesn't conflict with table_id_adr
|
||||
for(auto found_id : priv_id_adr.keys())
|
||||
{
|
||||
if (table_id_adr.contains(found_id))
|
||||
@@ -758,7 +758,7 @@ bool Element::fromXml(QDomElement &e,
|
||||
}
|
||||
}
|
||||
|
||||
//Copie the association id/adress
|
||||
//Copie the association id/address
|
||||
for(auto found_id : priv_id_adr.keys()) {
|
||||
table_id_adr.insert(found_id,
|
||||
priv_id_adr.value(found_id));
|
||||
@@ -813,7 +813,7 @@ bool Element::fromXml(QDomElement &e,
|
||||
}
|
||||
setRotation(90*read_ori);
|
||||
|
||||
//Befor load the dynamic text field,
|
||||
//Before loading the dynamic text field,
|
||||
//we remove the dynamic text field created from the description of this element, to avoid doublons.
|
||||
for(DynamicElementTextItem *deti : m_dynamic_text_list)
|
||||
delete deti;
|
||||
@@ -869,7 +869,7 @@ bool Element::fromXml(QDomElement &e,
|
||||
}
|
||||
}
|
||||
|
||||
//We must to block the update of the alignment when load the information
|
||||
//We must block the update of the alignment when loading the information
|
||||
//otherwise the pos of the text will not be the same as it was at save time.
|
||||
for(DynamicElementTextItem *deti : m_dynamic_text_list)
|
||||
deti->m_block_alignment = true;
|
||||
@@ -1025,7 +1025,7 @@ QDomElement Element::toXml(
|
||||
for(DynamicElementTextItem *deti : deti_list)
|
||||
group->addToGroup(deti);
|
||||
|
||||
//Restor the alignement
|
||||
//Restorr the alignment
|
||||
group->setAlignment(al);
|
||||
|
||||
//Save the group to xml
|
||||
@@ -1216,7 +1216,7 @@ QList<ElementTextItemGroup *> Element::textGroups() const
|
||||
Add the text text to the group group;
|
||||
If group isn't owned by this element return false.
|
||||
The text must be a text of this element.
|
||||
@return : true if the text was succesfully added to the group.
|
||||
@return : true if the text was successfully added to the group.
|
||||
*/
|
||||
bool Element::addTextToGroup(DynamicElementTextItem *text,
|
||||
ElementTextItemGroup *group)
|
||||
@@ -1239,7 +1239,7 @@ bool Element::addTextToGroup(DynamicElementTextItem *text,
|
||||
@brief Element::removeTextFromGroup
|
||||
Remove the text text from the group group,
|
||||
en reparent text to this element
|
||||
@return true if text was succesfully removed
|
||||
@return true if text was successfully removed
|
||||
*/
|
||||
bool Element::removeTextFromGroup(DynamicElementTextItem *text,
|
||||
ElementTextItemGroup *group)
|
||||
@@ -1568,7 +1568,7 @@ void Element::freezeNewAddedElement()
|
||||
/**
|
||||
@brief Element::actualLabel
|
||||
Always return the current label to be displayed.
|
||||
This function is usefull when label is based on formula, because label can change at any time.
|
||||
This function is useful when label is based on formula, because label can change at any time.
|
||||
@return
|
||||
*/
|
||||
QString Element::actualLabel()
|
||||
|
||||
@@ -79,7 +79,7 @@ class Element : public QetGraphicsItem
|
||||
int type() const override { return Type; }
|
||||
|
||||
signals:
|
||||
void linkedElementChanged(); //This signal is emited when the linked elements with this element change
|
||||
void linkedElementChanged(); //This signal is emitted when the linked elements with this element change
|
||||
void elementInfoChange(
|
||||
DiagramContext old_info,
|
||||
DiagramContext new_info);
|
||||
|
||||
@@ -72,7 +72,7 @@ void ElementTextItemGroup::addToGroup(QGraphicsItem *item)
|
||||
{
|
||||
if(item->type() == DynamicElementTextItem::Type)
|
||||
{
|
||||
//Befor add text to this group we must to set the text at the same rotation of this group
|
||||
//Before adding text to this group we must set the text at the same rotation of this group
|
||||
if((item->rotation() != rotation()) && !m_block_alignment_update)
|
||||
item->setRotation(rotation());
|
||||
|
||||
@@ -111,8 +111,8 @@ void ElementTextItemGroup::addToGroup(QGraphicsItem *item)
|
||||
void ElementTextItemGroup::removeFromGroup(QGraphicsItem *item)
|
||||
{
|
||||
QGraphicsItemGroup::removeFromGroup(item);
|
||||
//the item transformation is not reseted, we must to do it,
|
||||
// because for exemple if the group rotation is 45°
|
||||
//the item transformation is not reset, we must do it ourselves,
|
||||
// because for example if the group rotation is 45°
|
||||
//When item is removed from group,
|
||||
// visually the item is unchanged (so 45°)
|
||||
// but if we call item->rotation() the returned value is 0.
|
||||
@@ -257,7 +257,7 @@ void ElementTextItemGroup::updateAlignment()
|
||||
}
|
||||
}
|
||||
|
||||
//Restor the rotation
|
||||
//Restore the rotation
|
||||
setRotation(rotation_);
|
||||
|
||||
if(m_Xref_item)
|
||||
@@ -309,7 +309,7 @@ void ElementTextItemGroup::setHoldToBottomPage(bool hold)
|
||||
{
|
||||
//We use timer to let the time of the parent element
|
||||
// xref to be updated,
|
||||
// befor update the position of this group
|
||||
// before updating the position of this group
|
||||
//because the position of this group is related
|
||||
// to the size of the parent element Xref
|
||||
m_linked_changed_timer = connect(
|
||||
|
||||
@@ -86,7 +86,7 @@ void MasterElement::unlinkAllElements()
|
||||
|
||||
/**
|
||||
@brief MasterElement::unlinkElement
|
||||
Unlink the given elmt in parametre
|
||||
Unlink the given element in parameter
|
||||
@param elmt element to unlink from this
|
||||
*/
|
||||
void MasterElement::unlinkElement(Element *elmt)
|
||||
@@ -159,7 +159,7 @@ void MasterElement::xrefPropertiesChanged()
|
||||
If Xref item is deleted or already not used (nullptr) return true;
|
||||
Else return false if Xref item is used
|
||||
NOTICE : Xref can display nothing but not be deleted so far.
|
||||
For exemple, if Xref is display has cross, only power contact are linked and
|
||||
For example, if Xref is display has cross, only power contact are linked and
|
||||
option show power contact is disable, the cross isn't draw.
|
||||
@return
|
||||
*/
|
||||
|
||||
@@ -33,7 +33,7 @@ class QetGraphicsItem : public QGraphicsObject
|
||||
QetGraphicsItem(QGraphicsItem *parent = nullptr);
|
||||
~QetGraphicsItem() override = 0;
|
||||
|
||||
//public methode
|
||||
//public method
|
||||
Diagram *diagram () const;
|
||||
virtual void setPos (const QPointF &p);
|
||||
virtual void setPos (qreal x, qreal y);
|
||||
|
||||
@@ -212,7 +212,7 @@ int QetShapeItem::pointsCount() const
|
||||
|
||||
/**
|
||||
@brief QetShapeItem::setNextPoint
|
||||
Add a new point to the curent polygon
|
||||
Add a new point to the current polygon
|
||||
@param P the new point.
|
||||
*/
|
||||
void QetShapeItem::setNextPoint(QPointF P)
|
||||
@@ -994,7 +994,7 @@ void QetShapeItem::editProperty()
|
||||
|
||||
/**
|
||||
@brief QetShapeItem::name
|
||||
@return the name of the curent shape.
|
||||
@return the name of the current shape.
|
||||
*/
|
||||
QString QetShapeItem::name() const
|
||||
{
|
||||
|
||||
@@ -65,13 +65,13 @@ bool centerToBottomDiagram (QGraphicsItem *item_to_center, Element *element_to_f
|
||||
point.setY(border.bottom() - item_to_center -> boundingRect().height() - offset );
|
||||
point.rx() -= (item_to_center -> boundingRect().width()/2);
|
||||
|
||||
//Apply the difference between the pos() of item and his bounding rect
|
||||
//Apply the difference between the pos() of item and its bounding rect
|
||||
QPointF tl = item_to_center->boundingRect().topLeft();
|
||||
point.rx() -= tl.x();
|
||||
point.ry() -= tl.y();
|
||||
|
||||
item_to_center -> setPos(0,0); //Due to a weird behavior or bug, before set the new position and rotation,
|
||||
item_to_center -> setRotation(0); //we must to set the position and rotation at 0.
|
||||
item_to_center -> setPos(0,0); //Due to a weird behavior or bug, before setting the new position and rotation,
|
||||
item_to_center -> setRotation(0); //we must set the position and rotation to 0.
|
||||
|
||||
item_to_center->setPos(item_to_center->mapFromScene(point));
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ void SlaveElement::unlinkAllElements()
|
||||
|
||||
/**
|
||||
@brief SlaveElement::unlinkElement
|
||||
Unlink the given elmt in parametre
|
||||
Unlink the given element in parameter
|
||||
@param elmt
|
||||
*/
|
||||
void SlaveElement::unlinkElement(Element *elmt)
|
||||
|
||||
Reference in New Issue
Block a user