mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 12:40:35 +01:00
Wrap code for better readability
This commit is contained in:
@@ -516,7 +516,8 @@ void Diagram::keyReleaseEvent(QKeyEvent *e)
|
||||
@brief Diagram::uuid
|
||||
@return the uuid of this diagram
|
||||
*/
|
||||
QUuid Diagram::uuid() {
|
||||
QUuid Diagram::uuid()
|
||||
{
|
||||
return m_uuid;
|
||||
}
|
||||
|
||||
@@ -561,7 +562,8 @@ void Diagram::clearEventInterface()
|
||||
@brief Diagram::conductorsAutonumName
|
||||
@return the name of autonum to use.
|
||||
*/
|
||||
QString Diagram::conductorsAutonumName() const {
|
||||
QString Diagram::conductorsAutonumName() const
|
||||
{
|
||||
return m_conductors_autonum_name;
|
||||
}
|
||||
|
||||
@@ -648,7 +650,8 @@ bool Diagram::toPaintDevice(QPaintDevice &pix,
|
||||
\~ @return The size of the image generated by toImage()
|
||||
\~French La taille de l'image generee par toImage()
|
||||
*/
|
||||
QSize Diagram::imageSize() const {
|
||||
QSize Diagram::imageSize() const
|
||||
{
|
||||
// determine la zone source = contenu du schema + marges
|
||||
qreal image_width, image_height;
|
||||
if (!use_border_) {
|
||||
@@ -677,7 +680,8 @@ QSize Diagram::imageSize() const {
|
||||
\~French true si le schema est considere comme vide, false sinon.
|
||||
Un schema vide ne contient ni element, ni conducteur, ni champ de texte
|
||||
*/
|
||||
bool Diagram::isEmpty() const {
|
||||
bool Diagram::isEmpty() const
|
||||
{
|
||||
return(!items().count());
|
||||
}
|
||||
|
||||
@@ -687,7 +691,8 @@ bool Diagram::isEmpty() const {
|
||||
each potential are in the QList
|
||||
and each conductors of one potential are in the QSet
|
||||
*/
|
||||
QList < QSet <Conductor *> > Diagram::potentials() {
|
||||
QList < QSet <Conductor *> > Diagram::potentials()
|
||||
{
|
||||
QList < QSet <Conductor *> > potential_List;
|
||||
if (content().conductors().size() == 0)
|
||||
return (potential_List); //return an empty potential
|
||||
@@ -1673,7 +1678,8 @@ void Diagram::setTitleBlockTemplate(const QString &template_name)
|
||||
Select all schema objects
|
||||
\~French Selectionne tous les objets du schema
|
||||
*/
|
||||
void Diagram::selectAll() {
|
||||
void Diagram::selectAll()
|
||||
{
|
||||
if (items().isEmpty()) return;
|
||||
|
||||
blockSignals(true);
|
||||
@@ -1687,7 +1693,8 @@ void Diagram::selectAll() {
|
||||
Deselects all selected objects
|
||||
\~French Deslectionne tous les objets selectionnes
|
||||
*/
|
||||
void Diagram::deselectAll() {
|
||||
void Diagram::deselectAll()
|
||||
{
|
||||
if (items().isEmpty()) return;
|
||||
|
||||
clearSelection();
|
||||
@@ -1698,7 +1705,8 @@ void Diagram::deselectAll() {
|
||||
Reverses the selection state of all schema objects
|
||||
Inverse l'etat de selection de tous les objets du schema
|
||||
*/
|
||||
void Diagram::invertSelection() {
|
||||
void Diagram::invertSelection()
|
||||
{
|
||||
if (items().isEmpty()) return;
|
||||
|
||||
blockSignals(true);
|
||||
@@ -1854,7 +1862,8 @@ void Diagram::changeZValue(QET::DepthOption option)
|
||||
This class loads all folio sequential variables related
|
||||
to the current autonum
|
||||
*/
|
||||
void Diagram::loadElmtFolioSeq() {
|
||||
void Diagram::loadElmtFolioSeq()
|
||||
{
|
||||
QString title = project()->elementCurrentAutoNum();
|
||||
NumerotationContext nc = project()->elementAutoNum(title);
|
||||
|
||||
@@ -1939,7 +1948,8 @@ void Diagram::loadElmtFolioSeq() {
|
||||
This class loads all conductor folio sequential variables related
|
||||
to the current autonum
|
||||
*/
|
||||
void Diagram::loadCndFolioSeq() {
|
||||
void Diagram::loadCndFolioSeq()
|
||||
{
|
||||
//Conductor
|
||||
QString title = project()->conductorCurrentAutoNum();
|
||||
NumerotationContext nc = project()->conductorAutoNum(title);
|
||||
@@ -2020,7 +2030,8 @@ void Diagram::loadCndFolioSeq() {
|
||||
@return title of the titleblock
|
||||
\~Frenchle titre du cartouche
|
||||
*/
|
||||
QString Diagram::title() const {
|
||||
QString Diagram::title() const
|
||||
{
|
||||
return(border_and_titleblock.title());
|
||||
}
|
||||
|
||||
@@ -2028,7 +2039,8 @@ QString Diagram::title() const {
|
||||
@brief Diagram::elements
|
||||
@return the list containing all elements
|
||||
*/
|
||||
QList <Element *> Diagram::elements() const {
|
||||
QList <Element *> Diagram::elements() const
|
||||
{
|
||||
QList<Element *> element_list;
|
||||
foreach (QGraphicsItem *qgi, items()) {
|
||||
if (Element *elmt = qgraphicsitem_cast<Element *>(qgi))
|
||||
@@ -2041,7 +2053,8 @@ QList <Element *> Diagram::elements() const {
|
||||
@brief Diagram::conductors
|
||||
@return the list containing all conductors
|
||||
*/
|
||||
QList <Conductor *> Diagram::conductors() const {
|
||||
QList <Conductor *> Diagram::conductors() const
|
||||
{
|
||||
QList<Conductor *> cnd_list;
|
||||
foreach (QGraphicsItem *qgi, items()) {
|
||||
if (Conductor *cnd = qgraphicsitem_cast<Conductor *>(qgi))
|
||||
@@ -2054,7 +2067,8 @@ QList <Conductor *> Diagram::conductors() const {
|
||||
@brief Diagram::elementsMover
|
||||
@return
|
||||
*/
|
||||
ElementsMover &Diagram::elementsMover() {
|
||||
ElementsMover &Diagram::elementsMover()
|
||||
{
|
||||
return m_elements_mover;
|
||||
}
|
||||
|
||||
@@ -2062,7 +2076,8 @@ ElementsMover &Diagram::elementsMover() {
|
||||
@brief Diagram::elementTextsMover
|
||||
@return
|
||||
*/
|
||||
ElementTextsMover &Diagram::elementTextsMover() {
|
||||
ElementTextsMover &Diagram::elementTextsMover()
|
||||
{
|
||||
return m_element_texts_mover;
|
||||
}
|
||||
|
||||
@@ -2111,7 +2126,8 @@ void Diagram::freezeElements(bool freeze) {
|
||||
@brief Diagram::unfreezeElements
|
||||
Unfreeze every existent element label.
|
||||
*/
|
||||
void Diagram::unfreezeElements() {
|
||||
void Diagram::unfreezeElements()
|
||||
{
|
||||
foreach (Element *elmt, elements()) {
|
||||
elmt->freezeLabel(false);
|
||||
}
|
||||
@@ -2129,7 +2145,8 @@ void Diagram::setFreezeNewElements(bool b) {
|
||||
@brief Diagram::freezeNewElements
|
||||
@return current freeze new element status .
|
||||
*/
|
||||
bool Diagram::freezeNewElements() {
|
||||
bool Diagram::freezeNewElements()
|
||||
{
|
||||
return m_freeze_new_elements;
|
||||
}
|
||||
|
||||
@@ -2155,7 +2172,8 @@ void Diagram::setFreezeNewConductors(bool b) {
|
||||
@brief Diagram::freezeNewConductors
|
||||
@return current freeze new conductor status .
|
||||
*/
|
||||
bool Diagram::freezeNewConductors() {
|
||||
bool Diagram::freezeNewConductors()
|
||||
{
|
||||
return m_freeze_new_conductors_;
|
||||
}
|
||||
|
||||
@@ -2294,7 +2312,8 @@ void Diagram::setDrawColoredConductors(bool dcc) {
|
||||
@return the list of conductors selected on the diagram
|
||||
\~French la liste des conducteurs selectionnes sur le schema
|
||||
*/
|
||||
QSet<Conductor *> Diagram::selectedConductors() const {
|
||||
QSet<Conductor *> Diagram::selectedConductors() const
|
||||
{
|
||||
QSet<Conductor *> conductors_set;
|
||||
foreach(QGraphicsItem *qgi, selectedItems()) {
|
||||
if (Conductor *c = qgraphicsitem_cast<Conductor *>(qgi)) {
|
||||
@@ -2309,7 +2328,8 @@ QSet<Conductor *> Diagram::selectedConductors() const {
|
||||
@return true if the clipboard appears to contain a schema
|
||||
\~French true si le presse-papier semble contenir un schema
|
||||
*/
|
||||
bool Diagram::clipboardMayContainDiagram() {
|
||||
bool Diagram::clipboardMayContainDiagram()
|
||||
{
|
||||
QString clipboard_text = QApplication::clipboard() -> text().trimmed();
|
||||
bool may_be_diagram = clipboard_text.startsWith("<diagram")
|
||||
&& clipboard_text.endsWith("</diagram>");
|
||||
@@ -2323,7 +2343,8 @@ bool Diagram::clipboardMayContainDiagram() {
|
||||
\~French le projet auquel ce schema appartient
|
||||
ou 0 s'il s'agit d'un schema independant.
|
||||
*/
|
||||
QETProject *Diagram::project() const {
|
||||
QETProject *Diagram::project() const
|
||||
{
|
||||
return(m_project);
|
||||
}
|
||||
|
||||
@@ -2332,7 +2353,8 @@ QETProject *Diagram::project() const {
|
||||
@return the folio number of this diagram within its parent project,
|
||||
or -1 if it is has no parent project
|
||||
*/
|
||||
int Diagram::folioIndex() const {
|
||||
int Diagram::folioIndex() const
|
||||
{
|
||||
if (!m_project) return(-1);
|
||||
return(m_project -> folioIndex(this));
|
||||
}
|
||||
@@ -2345,7 +2367,8 @@ int Diagram::folioIndex() const {
|
||||
fallback_to_project is true.
|
||||
@return the declared QElectroTech version of this diagram
|
||||
*/
|
||||
qreal Diagram::declaredQElectroTechVersion(bool fallback_to_project) const {
|
||||
qreal Diagram::declaredQElectroTechVersion(bool fallback_to_project) const
|
||||
{
|
||||
if (diagram_qet_version_ != -1) {
|
||||
return diagram_qet_version_;
|
||||
}
|
||||
@@ -2372,7 +2395,8 @@ bool Diagram::isReadOnly() const
|
||||
\~French Le contenu du schema. Les conducteurs sont tous places dans
|
||||
conductorsToMove.
|
||||
*/
|
||||
DiagramContent Diagram::content() const {
|
||||
DiagramContent Diagram::content() const
|
||||
{
|
||||
DiagramContent dc;
|
||||
foreach(QGraphicsItem *qgi, items()) {
|
||||
if (Element *e = qgraphicsitem_cast<Element *>(qgi)) {
|
||||
|
||||
Reference in New Issue
Block a user