From fa68d545d06cc589da608ca0508a8d7642d0a9f9 Mon Sep 17 00:00:00 2001 From: plc-user <74435298+plc-user@users.noreply.github.com> Date: Wed, 24 Apr 2024 14:14:40 +0200 Subject: [PATCH] correct more indentations / whitespace --- .../elementscollectionmodel.cpp | 78 +++--- .../elementscollectionmodel.h | 8 +- .../elementscollectionwidget.cpp | 60 ++--- .../ElementsCollection/elementslocation.cpp | 90 +++---- sources/ElementsCollection/elementslocation.h | 6 +- .../fileelementcollectionitem.cpp | 36 +-- .../fileelementcollectionitem.h | 6 +- .../qetgraphicshandlerutility.cpp | 8 +- .../GraphicsItem/demoterminalstrip.cpp | 242 +++++++++--------- .../GraphicsItem/demoterminalstrip.h | 62 ++--- .../terminalstriplayoutshandler.cpp | 36 +-- .../properties/terminalstriplayoutshandler.h | 42 +-- .../GraphicsItem/terminalstripdrawer.cpp | 30 +-- .../GraphicsItem/terminalstripdrawer.h | 134 +++++----- .../GraphicsItem/terminalstripitem.cpp | 6 +- .../GraphicsItem/trueterminalstrip.cpp | 30 +-- .../GraphicsItem/trueterminalstrip.h | 102 ++++---- sources/autoNum/assignvariables.h | 2 +- .../diagramevent/diagrameventinterface.cpp | 4 +- sources/diagramevent/diagrameventinterface.h | 6 +- sources/editor/arceditor.cpp | 10 +- sources/editor/editorcommands.h | 14 +- sources/editor/elementscene.cpp | 2 +- sources/editor/graphicspart/partline.h | 2 +- sources/editor/graphicspart/partpolygon.h | 2 +- sources/editor/graphicspart/partrectangle.cpp | 4 +- sources/editor/graphicspart/partrectangle.h | 6 +- sources/editor/graphicspart/partterminal.h | 2 +- sources/editor/styleeditor.cpp | 2 +- sources/factory/elementpicturefactory.cpp | 22 +- sources/print/projectprintwindow.cpp | 14 +- sources/print/projectprintwindow.h | 2 +- sources/project/projectpropertieshandler.cpp | 28 +- sources/project/projectpropertieshandler.h | 36 +-- sources/properties/elementdata.cpp | 2 +- sources/qetgraphicsitem/conductor.cpp | 18 +- sources/qetgraphicsitem/conductor.h | 4 +- sources/qetgraphicsitem/element.cpp | 22 +- .../undocommand/addgraphicsobjectcommand.cpp | 80 +++--- .../undocommand/addgraphicsobjectcommand.h | 54 ++-- .../undocommand/changeelementdatacommand.cpp | 46 ++-- .../undocommand/changeelementdatacommand.h | 42 +-- sources/undocommand/itemmodelcommand.h | 6 +- .../undocommand/movegraphicsitemcommand.cpp | 222 ++++++++-------- sources/xml/terminalstripitemxml.cpp | 136 +++++----- sources/xml/terminalstripitemxml.h | 40 +-- 46 files changed, 903 insertions(+), 903 deletions(-) diff --git a/sources/ElementsCollection/elementscollectionmodel.cpp b/sources/ElementsCollection/elementscollectionmodel.cpp index 6c67ebd0c..679b5232a 100644 --- a/sources/ElementsCollection/elementscollectionmodel.cpp +++ b/sources/ElementsCollection/elementscollectionmodel.cpp @@ -111,10 +111,10 @@ QStringList ElementsCollectionModel::mimeTypes() const @return */ bool ElementsCollectionModel::canDropMimeData(const QMimeData *data, - Qt::DropAction action, - int row, - int column, - const QModelIndex &parent) const + Qt::DropAction action, + int row, + int column, + const QModelIndex &parent) const { if (!(QStandardItemModel::canDropMimeData(data, action, @@ -258,9 +258,9 @@ bool ElementsCollectionModel::dropMimeData(const QMimeData *data, @param projects : list of projects to load */ void ElementsCollectionModel::loadCollections(bool common_collection, - bool company_collection, - bool custom_collection, - QList projects) + bool company_collection, + bool custom_collection, + QList projects) { m_items_list_to_setUp.clear(); @@ -313,8 +313,8 @@ void ElementsCollectionModel::addCommonCollection(bool set_data) { FileElementCollectionItem *feci = new FileElementCollectionItem(); if (feci->setRootPath(QETApp::commonElementsDirN(), - set_data, - m_hide_element)) { + set_data, + m_hide_element)) { invisibleRootItem()->appendRow(feci); if (set_data) feci->setUpData(); @@ -324,41 +324,41 @@ void ElementsCollectionModel::addCommonCollection(bool set_data) } /** - @brief ElementsCollectionModel::addCompanyCollection - Add the company elements collection to this model - @param set_data + @brief ElementsCollectionModel::addCompanyCollection + Add the company elements collection to this model + @param set_data */ void ElementsCollectionModel::addCompanyCollection(bool set_data) { - FileElementCollectionItem *feci = new FileElementCollectionItem(); - if (feci->setRootPath(QETApp::companyElementsDirN(), - set_data, - m_hide_element)) { - invisibleRootItem()->appendRow(feci); - if (set_data) - feci->setUpData(); - } - else - delete feci; + FileElementCollectionItem *feci = new FileElementCollectionItem(); + if (feci->setRootPath(QETApp::companyElementsDirN(), + set_data, + m_hide_element)) { + invisibleRootItem()->appendRow(feci); + if (set_data) + feci->setUpData(); + } + else + delete feci; } /** - @brief ElementsCollectionModel::addCustomCollection - Add the custom elements collection to this model - @param set_data + @brief ElementsCollectionModel::addCustomCollection + Add the custom elements collection to this model + @param set_data */ void ElementsCollectionModel::addCustomCollection(bool set_data) { - FileElementCollectionItem *feci = new FileElementCollectionItem(); - if (feci->setRootPath(QETApp::customElementsDirN(), - set_data, - m_hide_element)) { - invisibleRootItem()->appendRow(feci); - if (set_data) - feci->setUpData(); - } - else - delete feci; + FileElementCollectionItem *feci = new FileElementCollectionItem(); + if (feci->setRootPath(QETApp::customElementsDirN(), + set_data, + m_hide_element)) { + invisibleRootItem()->appendRow(feci); + if (set_data) + feci->setUpData(); + } + else + delete feci; } /** @@ -579,9 +579,9 @@ QModelIndex ElementsCollectionModel::indexFromLocation( { QList child_list; - for (int i=0 ; i(item(i))); - } + } foreach(ElementCollectionItem *eci, child_list) { @@ -590,8 +590,8 @@ QModelIndex ElementsCollectionModel::indexFromLocation( if (eci->type() == FileElementCollectionItem::Type) { if (FileElementCollectionItem *feci = static_cast(eci)) { if ( (location.isCommonCollection() && feci->isCommonCollection()) || - (location.isCompanyCollection() && feci->isCompanyCollection()) || - (location.isCustomCollection() && !feci->isCommonCollection()) ) { + (location.isCompanyCollection() && feci->isCompanyCollection()) || + (location.isCustomCollection() && !feci->isCommonCollection()) ) { match_eci = feci->itemAtPath(location.collectionPath(false)); } } diff --git a/sources/ElementsCollection/elementscollectionmodel.h b/sources/ElementsCollection/elementscollectionmodel.h index 254a4cc5e..3acd998f3 100644 --- a/sources/ElementsCollection/elementscollectionmodel.h +++ b/sources/ElementsCollection/elementscollectionmodel.h @@ -42,11 +42,11 @@ class ElementsCollectionModel : public QStandardItemModel bool canDropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) const override; bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override; - void loadCollections(bool common_collection, bool company_collection, bool custom_collection, QList projects); + void loadCollections(bool common_collection, bool company_collection, bool custom_collection, QList projects); - void addCommonCollection(bool set_data = true); - void addCompanyCollection(bool set_data = true); - void addCustomCollection(bool set_data = true); + void addCommonCollection(bool set_data = true); + void addCompanyCollection(bool set_data = true); + void addCustomCollection(bool set_data = true); void addLocation(const ElementsLocation& location); void addProject(QETProject *project, bool set_data = true); diff --git a/sources/ElementsCollection/elementscollectionwidget.cpp b/sources/ElementsCollection/elementscollectionwidget.cpp index 011805010..da7d4df70 100644 --- a/sources/ElementsCollection/elementscollectionwidget.cpp +++ b/sources/ElementsCollection/elementscollectionwidget.cpp @@ -96,7 +96,7 @@ void ElementsCollectionWidget::addProject(QETProject *project) m_progress_bar->show(); m_tree_view->setDisabled(true); QList prj; prj.append(project); - m_model->loadCollections(false, false, false, prj); + m_model->loadCollections(false, false, false, prj); } else { m_waiting_project.append(project); @@ -148,26 +148,26 @@ void ElementsCollectionWidget::setUpAction() m_open_dir = new QAction(QET::Icons::FolderOpen, tr("Ouvrir le dossier correspondant"), this); m_edit_element = new QAction(QET::Icons::ElementEdit, - tr("Éditer l'élément"), this); + tr("Éditer l'élément"), this); m_delete_element = new QAction(QET::Icons::ElementDelete, - tr("Supprimer l'élément"), this); + tr("Supprimer l'élément"), this); m_delete_dir = new QAction(QET::Icons::FolderDelete, tr("Supprimer le dossier"), this); m_reload = new QAction(QET::Icons::ViewRefresh, - tr("Recharger les collections"), this); + tr("Recharger les collections"), this); m_edit_dir = new QAction(QET::Icons::FolderEdit, tr("Éditer le dossier"), this); m_new_directory = new QAction(QET::Icons::FolderNew, - tr("Nouveau dossier"), this); + tr("Nouveau dossier"), this); m_new_element = new QAction(QET::Icons::ElementNew, - tr("Nouvel élément"), this); + tr("Nouvel élément"), this); m_show_this_dir = new QAction(QET::Icons::FolderOnlyThis, - tr("Afficher uniquement ce dossier"), - this); + tr("Afficher uniquement ce dossier"), + this); m_show_all_dir = new QAction(QET::Icons::FolderShowAll, - tr("Afficher tous les dossiers"), this); + tr("Afficher tous les dossiers"), this); m_dir_propertie = new QAction(QET::Icons::FolderProperties, - tr("Propriété du dossier"), this); + tr("Propriété du dossier"), this); } /** @@ -385,10 +385,10 @@ void ElementsCollectionWidget::deleteElement() ElementsLocation loc(eci->collectionPath()); if (! (loc.isElement() - && loc.exist() - && loc.isFileSystem() - && (loc.collectionPath().startsWith("company://") - || loc.collectionPath().startsWith("custom://"))) ) return; + && loc.exist() + && loc.isFileSystem() + && (loc.collectionPath().startsWith("company://") + || loc.collectionPath().startsWith("custom://"))) ) return; if (QET::QetMessageBox::question( this, @@ -401,8 +401,8 @@ void ElementsCollectionWidget::deleteElement() if (file.remove()) { m_model->removeRows(m_index_at_context_menu.row(), - 1, - m_index_at_context_menu.parent()); + 1, + m_index_at_context_menu.parent()); } else { @@ -429,10 +429,10 @@ void ElementsCollectionWidget::deleteDirectory() ElementsLocation loc (eci->collectionPath()); if (! (loc.isDirectory() - && loc.exist() - && loc.isFileSystem() - && (loc.collectionPath().startsWith("company://") - || loc.collectionPath().startsWith("custom://"))) ) return; + && loc.exist() + && loc.isFileSystem() + && (loc.collectionPath().startsWith("company://") + || loc.collectionPath().startsWith("custom://"))) ) return; if (QET::QetMessageBox::question( this, @@ -446,8 +446,8 @@ void ElementsCollectionWidget::deleteDirectory() if (dir.removeRecursively()) { m_model->removeRows(m_index_at_context_menu.row(), - 1, - m_index_at_context_menu.parent()); + 1, + m_index_at_context_menu.parent()); } else { @@ -666,7 +666,7 @@ void ElementsCollectionWidget::reload() this, &ElementsCollectionWidget::loadingFinished); - m_new_model->loadCollections(true, true, true, project_list); + m_new_model->loadCollections(true, true, true, project_list); } /** @@ -781,13 +781,13 @@ void ElementsCollectionWidget::search() QModelIndexList match_index; for (QString txt : text_list) { match_index << m_model->match(m_showed_index.isValid() - ? m_model->index(0,0,m_showed_index) - : m_model->index(0,0), - Qt::UserRole+1, - QVariant(txt), - -1, - Qt::MatchContains - | Qt::MatchRecursive); + ? m_model->index(0,0,m_showed_index) + : m_model->index(0,0), + Qt::UserRole+1, + QVariant(txt), + -1, + Qt::MatchContains + | Qt::MatchRecursive); } for(QModelIndex index : match_index) diff --git a/sources/ElementsCollection/elementslocation.cpp b/sources/ElementsCollection/elementslocation.cpp index f5d02464e..f0cbc9dff 100644 --- a/sources/ElementsCollection/elementslocation.cpp +++ b/sources/ElementsCollection/elementslocation.cpp @@ -293,17 +293,17 @@ void ElementsLocation::setPath(const QString &path) else if (path.startsWith("common://") || path.startsWith("company://") || path.startsWith("custom://")) { QString p; - if (path.startsWith("common://")) - { - tmp_path.remove("common://"); - p = QETApp::commonElementsDirN() + "/" + tmp_path; - } - else if (path.startsWith("company://")) - { - tmp_path.remove("company://"); - p = QETApp::companyElementsDirN() + "/" + tmp_path; - } - else + if (path.startsWith("common://")) + { + tmp_path.remove("common://"); + p = QETApp::commonElementsDirN() + "/" + tmp_path; + } + else if (path.startsWith("company://")) + { + tmp_path.remove("company://"); + p = QETApp::companyElementsDirN() + "/" + tmp_path; + } + else { tmp_path.remove("custom://"); p = QETApp::customElementsDirN() + "/" + tmp_path; @@ -319,19 +319,19 @@ void ElementsLocation::setPath(const QString &path) if(path_.endsWith(".elmt")) { m_file_system_path = path_; - if (path_.startsWith(QETApp::commonElementsDirN())) - { - path_.remove(QETApp::commonElementsDirN()+="/"); - path_.prepend("common://"); - m_collection_path = path_; - } - else if (path_.startsWith(QETApp::companyElementsDirN())) - { - path_.remove(QETApp::companyElementsDirN()+="/"); - path_.prepend("company://"); - m_collection_path = path_; - } - else if (path_.startsWith(QETApp::customElementsDirN())) + if (path_.startsWith(QETApp::commonElementsDirN())) + { + path_.remove(QETApp::commonElementsDirN()+="/"); + path_.prepend("common://"); + m_collection_path = path_; + } + else if (path_.startsWith(QETApp::companyElementsDirN())) + { + path_.remove(QETApp::companyElementsDirN()+="/"); + path_.prepend("company://"); + m_collection_path = path_; + } + else if (path_.startsWith(QETApp::customElementsDirN())) { path_.remove(QETApp::customElementsDirN()+="/"); path_.prepend("custom://"); @@ -341,19 +341,19 @@ void ElementsLocation::setPath(const QString &path) else { m_file_system_path = path_; - if (path_.startsWith(QETApp::commonElementsDirN())) - { - path_.remove(QETApp::commonElementsDirN()+="/"); - path_.prepend("common://"); - m_collection_path = path_; - } - else if (path_.startsWith(QETApp::companyElementsDirN())) - { - path_.remove(QETApp::companyElementsDirN()+="/"); - path_.prepend("company://"); - m_collection_path = path_; - } - else if (path_.startsWith(QETApp::customElementsDirN())) + if (path_.startsWith(QETApp::commonElementsDirN())) + { + path_.remove(QETApp::commonElementsDirN()+="/"); + path_.prepend("common://"); + m_collection_path = path_; + } + else if (path_.startsWith(QETApp::companyElementsDirN())) + { + path_.remove(QETApp::companyElementsDirN()+="/"); + path_.prepend("company://"); + m_collection_path = path_; + } + else if (path_.startsWith(QETApp::customElementsDirN())) { path_.remove(QETApp::customElementsDirN()+="/"); path_.prepend("custom://"); @@ -501,23 +501,23 @@ bool ElementsLocation::isFileSystem() const } /** - @brief ElementsLocation::isCommonCollection - @return - True if this location represent an item from the common collection + @brief ElementsLocation::isCommonCollection + @return + True if this location represent an item from the common collection */ bool ElementsLocation::isCommonCollection() const { - return fileSystemPath().startsWith(QETApp::commonElementsDirN()); + return fileSystemPath().startsWith(QETApp::commonElementsDirN()); } /** - @brief ElementsLocation::isCompanyCollection - @return - True if this location represent an item from the company collection + @brief ElementsLocation::isCompanyCollection + @return + True if this location represent an item from the company collection */ bool ElementsLocation::isCompanyCollection() const { - return fileSystemPath().startsWith(QETApp::companyElementsDirN()); + return fileSystemPath().startsWith(QETApp::companyElementsDirN()); } /** diff --git a/sources/ElementsCollection/elementslocation.h b/sources/ElementsCollection/elementslocation.h index 80e2b00a8..6238dc2e5 100644 --- a/sources/ElementsCollection/elementslocation.h +++ b/sources/ElementsCollection/elementslocation.h @@ -75,9 +75,9 @@ class ElementsLocation bool isElement() const; bool isDirectory() const; bool isFileSystem() const; - bool isCommonCollection() const; - bool isCompanyCollection() const; - bool isCustomCollection() const; + bool isCommonCollection() const; + bool isCompanyCollection() const; + bool isCustomCollection() const; bool isProject() const; bool exist() const; bool isWritable() const; diff --git a/sources/ElementsCollection/fileelementcollectionitem.cpp b/sources/ElementsCollection/fileelementcollectionitem.cpp index 45e720eec..9c84999fa 100644 --- a/sources/ElementsCollection/fileelementcollectionitem.cpp +++ b/sources/ElementsCollection/fileelementcollectionitem.cpp @@ -41,8 +41,8 @@ FileElementCollectionItem::FileElementCollectionItem() @return true if path exist. */ bool FileElementCollectionItem::setRootPath(const QString& path, - bool set_data, - bool hide_element) + bool set_data, + bool hide_element) { QDir dir(path); if (dir.exists()) @@ -120,11 +120,11 @@ QString FileElementCollectionItem::localName() else if (isDir()) { if (isCollectionRoot()) { - if (m_path == QETApp::commonElementsDirN()) - setText(QObject::tr("Collection QET")); - else if (m_path == QETApp::companyElementsDirN()) - setText(QObject::tr("Collection Company")); - else if (m_path == QETApp::customElementsDirN()) + if (m_path == QETApp::commonElementsDirN()) + setText(QObject::tr("Collection QET")); + else if (m_path == QETApp::companyElementsDirN()) + setText(QObject::tr("Collection Company")); + else if (m_path == QETApp::customElementsDirN()) setText(QObject::tr("Collection utilisateur")); else setText(QObject::tr("Collection inconnue")); @@ -221,29 +221,29 @@ QString FileElementCollectionItem::collectionPath() const bool FileElementCollectionItem::isCollectionRoot() const { if (m_path == QETApp::commonElementsDirN() - || m_path == QETApp::companyElementsDirN() - || m_path == QETApp::customElementsDirN()) - return true; + || m_path == QETApp::companyElementsDirN() + || m_path == QETApp::customElementsDirN()) + return true; else return false; } /** - @brief FileElementCollectionItem::isCommonCollection - @return True if this item represent the common collection + @brief FileElementCollectionItem::isCommonCollection + @return True if this item represent the common collection */ bool FileElementCollectionItem::isCommonCollection() const { - return fileSystemPath().startsWith(QETApp::commonElementsDirN()); + return fileSystemPath().startsWith(QETApp::commonElementsDirN()); } /** - @brief FileElementCollectionItem::isCompanyCollection - @return True if this item represent the company collection + @brief FileElementCollectionItem::isCompanyCollection + @return True if this item represent the company collection */ bool FileElementCollectionItem::isCompanyCollection() const { - return fileSystemPath().startsWith(QETApp::companyElementsDirN()); + return fileSystemPath().startsWith(QETApp::companyElementsDirN()); } /** @@ -347,8 +347,8 @@ void FileElementCollectionItem::setUpIcon() @param hide_element */ void FileElementCollectionItem::setPathName(const QString& path_name, - bool set_data, - bool hide_element) + bool set_data, + bool hide_element) { m_path = path_name; diff --git a/sources/ElementsCollection/fileelementcollectionitem.h b/sources/ElementsCollection/fileelementcollectionitem.h index acc142593..c70b1e58d 100644 --- a/sources/ElementsCollection/fileelementcollectionitem.h +++ b/sources/ElementsCollection/fileelementcollectionitem.h @@ -47,9 +47,9 @@ class FileElementCollectionItem : public ElementCollectionItem QString name() const override; QString collectionPath() const override; bool isCollectionRoot() const override; - bool isCommonCollection() const; - bool isCompanyCollection() const; - bool isCustomCollection() const; + bool isCommonCollection() const; + bool isCompanyCollection() const; + bool isCustomCollection() const; void addChildAtPath(const QString &collection_name) override; void setUpData() override; diff --git a/sources/QetGraphicsItemModeler/qetgraphicshandlerutility.cpp b/sources/QetGraphicsItemModeler/qetgraphicshandlerutility.cpp index 33da3debe..621b9e8a4 100644 --- a/sources/QetGraphicsItemModeler/qetgraphicshandlerutility.cpp +++ b/sources/QetGraphicsItemModeler/qetgraphicshandlerutility.cpp @@ -195,10 +195,10 @@ QRectF QetGraphicsHandlerUtility::mirrorRectForPosAtIndex( */ QRectF QetGraphicsHandlerUtility::rectForArc(const QRectF &rect, qreal start_angle, qreal span_angle) { - QPainterPath path; - path.arcMoveTo(rect, start_angle); - path.arcTo(rect, start_angle, span_angle); - return path.boundingRect(); + QPainterPath path; + path.arcMoveTo(rect, start_angle); + path.arcTo(rect, start_angle, span_angle); + return path.boundingRect(); } /** diff --git a/sources/TerminalStrip/GraphicsItem/demoterminalstrip.cpp b/sources/TerminalStrip/GraphicsItem/demoterminalstrip.cpp index 34a1c699c..bc407c94a 100644 --- a/sources/TerminalStrip/GraphicsItem/demoterminalstrip.cpp +++ b/sources/TerminalStrip/GraphicsItem/demoterminalstrip.cpp @@ -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 . + 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 . */ #include "demoterminalstrip.h" @@ -21,132 +21,132 @@ namespace TerminalStripDrawer { /*========= DemoBridge =========*/ - class DemoBridge : public AbstractBridgeInterface - { - public: - DemoBridge(const QUuid &uuid) : - m_uuid { uuid } {} + class DemoBridge : public AbstractBridgeInterface + { + public: + DemoBridge(const QUuid &uuid) : + m_uuid { uuid } {} - QUuid uuid() const override { - return m_uuid; - } + QUuid uuid() const override { + return m_uuid; + } - private: - const QUuid m_uuid; - }; + private: + const QUuid m_uuid; + }; - class DemoRealTerminal : public AbstractRealTerminalInterface - { - public: - DemoRealTerminal(const QString &label, const QUuid &bridge) : - m_label { label }, - m_bridge { bridge } - {} + class DemoRealTerminal : public AbstractRealTerminalInterface + { + public: + DemoRealTerminal(const QString &label, const QUuid &bridge) : + m_label { label }, + m_bridge { bridge } + {} - QString label() const override { - return m_label; - } + QString label() const override { + return m_label; + } - bool isBridged() const override { - return true; - } + bool isBridged() const override { + return true; + } - DemoBridge *bridge() const override { - return new DemoBridge { m_bridge }; - } + DemoBridge *bridge() const override { + return new DemoBridge { m_bridge }; + } - private: - QString m_label; - QUuid m_bridge; - }; + private: + QString m_label; + QUuid m_bridge; + }; - class DemoPhysicalTerminal : public AbstractPhysicalTerminalInterface - { - public: - DemoPhysicalTerminal(QVector> real_terminals) : - m_real_terminals { real_terminals} - {} + class DemoPhysicalTerminal : public AbstractPhysicalTerminalInterface + { + public: + DemoPhysicalTerminal(QVector> real_terminals) : + m_real_terminals { real_terminals} + {} - QVector> realTerminals() const override { - return m_real_terminals; - } + QVector> realTerminals() const override { + return m_real_terminals; + } - private: - QVector> m_real_terminals; - }; + private: + QVector> m_real_terminals; + }; /*========= DemoTerminalStrip =========*/ - /** - * @brief DemoTerminalStrip::DemoTerminalStrip - */ - DemoTerminalStrip::DemoTerminalStrip() - { - build(); - } + /** + * @brief DemoTerminalStrip::DemoTerminalStrip + */ + DemoTerminalStrip::DemoTerminalStrip() + { + build(); + } - QVector > DemoTerminalStrip::physicalTerminal() const - { - return m_physical_terminal; - } + QVector > DemoTerminalStrip::physicalTerminal() const + { + return m_physical_terminal; + } - void DemoTerminalStrip::build() - { - QUuid lvl_1 = QUuid::createUuid(); - QUuid lvl_2 = QUuid::createUuid(); - QUuid lvl_3 = QUuid::createUuid(); - QUuid lvl_4 = QUuid::createUuid(); + void DemoTerminalStrip::build() + { + QUuid lvl_1 = QUuid::createUuid(); + QUuid lvl_2 = QUuid::createUuid(); + QUuid lvl_3 = QUuid::createUuid(); + QUuid lvl_4 = QUuid::createUuid(); - QVector > real_terminals_vector; + QVector > real_terminals_vector; - real_terminals_vector << QSharedPointer { - new DemoRealTerminal( QStringLiteral("24vdc"), - lvl_1)}; - real_terminals_vector << QSharedPointer { - new DemoRealTerminal( QStringLiteral("0vdc"), - lvl_2)}; - real_terminals_vector << QSharedPointer { - new DemoRealTerminal( QStringLiteral("signal"), - lvl_3)}; - real_terminals_vector << QSharedPointer { - new DemoRealTerminal( QStringLiteral("teach"), - lvl_4)}; - m_physical_terminal << QSharedPointer { - new DemoPhysicalTerminal {real_terminals_vector}}; + real_terminals_vector << QSharedPointer { + new DemoRealTerminal( QStringLiteral("24vdc"), + lvl_1)}; + real_terminals_vector << QSharedPointer { + new DemoRealTerminal( QStringLiteral("0vdc"), + lvl_2)}; + real_terminals_vector << QSharedPointer { + new DemoRealTerminal( QStringLiteral("signal"), + lvl_3)}; + real_terminals_vector << QSharedPointer { + new DemoRealTerminal( QStringLiteral("teach"), + lvl_4)}; + m_physical_terminal << QSharedPointer { + new DemoPhysicalTerminal {real_terminals_vector}}; - real_terminals_vector.clear(); - real_terminals_vector << QSharedPointer { - new DemoRealTerminal( QStringLiteral("24vdc"), - lvl_1)}; - real_terminals_vector << QSharedPointer { - new DemoRealTerminal( QStringLiteral("0vdc"), - lvl_2)}; - real_terminals_vector << QSharedPointer { - new DemoRealTerminal( QStringLiteral("signal"), - lvl_3)}; - real_terminals_vector << QSharedPointer { - new DemoRealTerminal( QStringLiteral("teach"), - lvl_4)}; - m_physical_terminal << QSharedPointer { - new DemoPhysicalTerminal {real_terminals_vector}}; + real_terminals_vector.clear(); + real_terminals_vector << QSharedPointer { + new DemoRealTerminal( QStringLiteral("24vdc"), + lvl_1)}; + real_terminals_vector << QSharedPointer { + new DemoRealTerminal( QStringLiteral("0vdc"), + lvl_2)}; + real_terminals_vector << QSharedPointer { + new DemoRealTerminal( QStringLiteral("signal"), + lvl_3)}; + real_terminals_vector << QSharedPointer { + new DemoRealTerminal( QStringLiteral("teach"), + lvl_4)}; + m_physical_terminal << QSharedPointer { + new DemoPhysicalTerminal {real_terminals_vector}}; - real_terminals_vector.clear(); - real_terminals_vector << QSharedPointer { - new DemoRealTerminal( QStringLiteral("24vdc"), - lvl_1)}; - real_terminals_vector << QSharedPointer { - new DemoRealTerminal( QStringLiteral("0vdc"), - lvl_2)}; - real_terminals_vector << QSharedPointer { - new DemoRealTerminal( QStringLiteral("signal"), - lvl_3)}; - real_terminals_vector << QSharedPointer { - new DemoRealTerminal( QStringLiteral("teach"), - lvl_4)}; - m_physical_terminal << QSharedPointer { - new DemoPhysicalTerminal {real_terminals_vector}}; - } + real_terminals_vector.clear(); + real_terminals_vector << QSharedPointer { + new DemoRealTerminal( QStringLiteral("24vdc"), + lvl_1)}; + real_terminals_vector << QSharedPointer { + new DemoRealTerminal( QStringLiteral("0vdc"), + lvl_2)}; + real_terminals_vector << QSharedPointer { + new DemoRealTerminal( QStringLiteral("signal"), + lvl_3)}; + real_terminals_vector << QSharedPointer { + new DemoRealTerminal( QStringLiteral("teach"), + lvl_4)}; + m_physical_terminal << QSharedPointer { + new DemoPhysicalTerminal {real_terminals_vector}}; + } } diff --git a/sources/TerminalStrip/GraphicsItem/demoterminalstrip.h b/sources/TerminalStrip/GraphicsItem/demoterminalstrip.h index eb148f248..dd28d96c8 100644 --- a/sources/TerminalStrip/GraphicsItem/demoterminalstrip.h +++ b/sources/TerminalStrip/GraphicsItem/demoterminalstrip.h @@ -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 . + 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 . */ #ifndef DEMOTERMINALSTRIP_H #define DEMOTERMINALSTRIP_H @@ -24,25 +24,25 @@ namespace TerminalStripDrawer { class DemoTerminalStrip : public AbstractTerminalStripInterface { - public: - DemoTerminalStrip(); + public: + DemoTerminalStrip(); - QString installation() const override { - return QStringLiteral("=INST"); - } - QString location() const override { - return QStringLiteral("+LOC" ); - } - QString name() const override { - return QStringLiteral("X1"); - } - QVector> physicalTerminal() const override; + QString installation() const override { + return QStringLiteral("=INST"); + } + QString location() const override { + return QStringLiteral("+LOC" ); + } + QString name() const override { + return QStringLiteral("X1"); + } + QVector> physicalTerminal() const override; - private: - void build(); + private: + void build(); - private: - QVector> m_physical_terminal; + private: + QVector> m_physical_terminal; }; } //End namespace TerminalStripDrawer diff --git a/sources/TerminalStrip/GraphicsItem/properties/terminalstriplayoutshandler.cpp b/sources/TerminalStrip/GraphicsItem/properties/terminalstriplayoutshandler.cpp index 0823702b0..f405c1033 100644 --- a/sources/TerminalStrip/GraphicsItem/properties/terminalstriplayoutshandler.cpp +++ b/sources/TerminalStrip/GraphicsItem/properties/terminalstriplayoutshandler.cpp @@ -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 . + 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 . */ #include "terminalstriplayoutshandler.h" @@ -22,11 +22,11 @@ TerminalStripLayoutsHandler::TerminalStripLayoutsHandler() { - m_default_layout = QSharedPointer::create(); - m_default_layout->m_name = QObject::tr("Disposition par défaut"); + m_default_layout = QSharedPointer::create(); + m_default_layout->m_name = QObject::tr("Disposition par défaut"); } QSharedPointer TerminalStripLayoutsHandler::defaultLayout() { - return m_default_layout; + return m_default_layout; } diff --git a/sources/TerminalStrip/GraphicsItem/properties/terminalstriplayoutshandler.h b/sources/TerminalStrip/GraphicsItem/properties/terminalstriplayoutshandler.h index e20ae6066..e81b20f77 100644 --- a/sources/TerminalStrip/GraphicsItem/properties/terminalstriplayoutshandler.h +++ b/sources/TerminalStrip/GraphicsItem/properties/terminalstriplayoutshandler.h @@ -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 . + 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 . */ #ifndef TERMINALSTRIPLAYOUTSHANDLER_H #define TERMINALSTRIPLAYOUTSHANDLER_H @@ -29,13 +29,13 @@ */ class TerminalStripLayoutsHandler { - public: - TerminalStripLayoutsHandler(); - QSharedPointer defaultLayout(); + public: + TerminalStripLayoutsHandler(); + QSharedPointer defaultLayout(); - private: - QSet> m_layout_set; - QSharedPointer m_default_layout; + private: + QSet> m_layout_set; + QSharedPointer m_default_layout; }; #endif // TERMINALSTRIPLAYOUTSHANDLER_H diff --git a/sources/TerminalStrip/GraphicsItem/terminalstripdrawer.cpp b/sources/TerminalStrip/GraphicsItem/terminalstripdrawer.cpp index 1b293dee6..dd9483432 100644 --- a/sources/TerminalStrip/GraphicsItem/terminalstripdrawer.cpp +++ b/sources/TerminalStrip/GraphicsItem/terminalstripdrawer.cpp @@ -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 . + 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 . */ #include "terminalstripdrawer.h" #include diff --git a/sources/TerminalStrip/GraphicsItem/terminalstripdrawer.h b/sources/TerminalStrip/GraphicsItem/terminalstripdrawer.h index 8b46ef2d6..0aa9e4858 100644 --- a/sources/TerminalStrip/GraphicsItem/terminalstripdrawer.h +++ b/sources/TerminalStrip/GraphicsItem/terminalstripdrawer.h @@ -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 . + 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 . */ #ifndef TERMINALSTRIPDRAWER_H #define TERMINALSTRIPDRAWER_H @@ -27,67 +27,67 @@ class TerminalStrip; namespace TerminalStripDrawer { - class AbstractBridgeInterface - { - public: - AbstractBridgeInterface() {} - virtual ~AbstractBridgeInterface() {} - virtual QUuid uuid() const = 0; - }; + class AbstractBridgeInterface + { + public: + AbstractBridgeInterface() {} + virtual ~AbstractBridgeInterface() {} + virtual QUuid uuid() const = 0; + }; - class AbstractRealTerminalInterface - { - public: - AbstractRealTerminalInterface() {} - virtual ~AbstractRealTerminalInterface() {} - virtual QString label() const = 0; - virtual bool isBridged() const = 0; - virtual AbstractBridgeInterface* bridge() const = 0; - }; + class AbstractRealTerminalInterface + { + public: + AbstractRealTerminalInterface() {} + virtual ~AbstractRealTerminalInterface() {} + virtual QString label() const = 0; + virtual bool isBridged() const = 0; + virtual AbstractBridgeInterface* bridge() const = 0; + }; - class AbstractPhysicalTerminalInterface - { - public: - AbstractPhysicalTerminalInterface() {} - virtual ~AbstractPhysicalTerminalInterface() {} - virtual QVector> realTerminals() const = 0; - }; + class AbstractPhysicalTerminalInterface + { + public: + AbstractPhysicalTerminalInterface() {} + virtual ~AbstractPhysicalTerminalInterface() {} + virtual QVector> realTerminals() const = 0; + }; - class AbstractTerminalStripInterface - { - public: - AbstractTerminalStripInterface() {} - virtual ~AbstractTerminalStripInterface() {} - virtual QString installation() const = 0; - virtual QString location() const = 0; - virtual QString name() const = 0; - virtual QVector> physicalTerminal() const = 0; - }; + class AbstractTerminalStripInterface + { + public: + AbstractTerminalStripInterface() {} + virtual ~AbstractTerminalStripInterface() {} + virtual QString installation() const = 0; + virtual QString location() const = 0; + virtual QString name() const = 0; + virtual QVector> physicalTerminal() const = 0; + }; - class TerminalStripDrawer - { - public: - TerminalStripDrawer(QSharedPointer strip = QSharedPointer { nullptr }, - QSharedPointer layout = QSharedPointer()); + class TerminalStripDrawer + { + public: + TerminalStripDrawer(QSharedPointer strip = QSharedPointer { nullptr }, + QSharedPointer layout = QSharedPointer()); - void setStrip(QSharedPointer strip); - void paint(QPainter *painter); - QRectF boundingRect() const; + void setStrip(QSharedPointer strip); + void paint(QPainter *painter); + QRectF boundingRect() const; - void setLayout(QSharedPointer layout); - bool haveLayout() const; + void setLayout(QSharedPointer layout); + bool haveLayout() const; - void setPreviewDraw(bool draw = true); + void setPreviewDraw(bool draw = true); - private: - int height() const; - int width() const; + private: + int height() const; + int width() const; - private: - QSharedPointer m_strip; - QSharedPointer m_pattern; - bool m_preview_draw { false }; - }; + private: + QSharedPointer m_strip; + QSharedPointer m_pattern; + bool m_preview_draw { false }; + }; } #endif // TERMINALSTRIPDRAWER_H diff --git a/sources/TerminalStrip/GraphicsItem/terminalstripitem.cpp b/sources/TerminalStrip/GraphicsItem/terminalstripitem.cpp index 77f28adee..9811cd2f2 100644 --- a/sources/TerminalStrip/GraphicsItem/terminalstripitem.cpp +++ b/sources/TerminalStrip/GraphicsItem/terminalstripitem.cpp @@ -1,17 +1,17 @@ /* Copyright 2006-2022 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 . */ diff --git a/sources/TerminalStrip/GraphicsItem/trueterminalstrip.cpp b/sources/TerminalStrip/GraphicsItem/trueterminalstrip.cpp index bfbf98bfb..be243a2af 100644 --- a/sources/TerminalStrip/GraphicsItem/trueterminalstrip.cpp +++ b/sources/TerminalStrip/GraphicsItem/trueterminalstrip.cpp @@ -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 . + 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 . */ #include "trueterminalstrip.h" #include "../physicalterminal.h" diff --git a/sources/TerminalStrip/GraphicsItem/trueterminalstrip.h b/sources/TerminalStrip/GraphicsItem/trueterminalstrip.h index 9b413ba59..034e75da2 100644 --- a/sources/TerminalStrip/GraphicsItem/trueterminalstrip.h +++ b/sources/TerminalStrip/GraphicsItem/trueterminalstrip.h @@ -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 . + 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 . */ #ifndef TRUETERMINALSTRIP_H #define TRUETERMINALSTRIP_H @@ -27,51 +27,51 @@ class TerminalStripBridge; namespace TerminalStripDrawer { - class TrueTerminalStrip : public AbstractTerminalStripInterface - { - public: - TrueTerminalStrip(TerminalStrip *strip); + class TrueTerminalStrip : public AbstractTerminalStripInterface + { + public: + TrueTerminalStrip(TerminalStrip *strip); - QString installation() const override; - QString location() const override; - QString name() const override; + QString installation() const override; + QString location() const override; + QString name() const override; QVector> physicalTerminal() const override; - private: - QPointer m_strip; - }; + private: + QPointer m_strip; + }; - class TruePhysicalTerminal : public AbstractPhysicalTerminalInterface - { - public: - TruePhysicalTerminal(QSharedPointer physical); - QVector> realTerminals() const override; + class TruePhysicalTerminal : public AbstractPhysicalTerminalInterface + { + public: + TruePhysicalTerminal(QSharedPointer physical); + QVector> realTerminals() const override; - private: - QSharedPointer m_physical; - }; + private: + QSharedPointer m_physical; + }; - class TrueRealTerminal : public AbstractRealTerminalInterface - { - public: - TrueRealTerminal(QSharedPointer real); - QString label() const override; - bool isBridged() const override; - AbstractBridgeInterface* bridge() const override; + class TrueRealTerminal : public AbstractRealTerminalInterface + { + public: + TrueRealTerminal(QSharedPointer real); + QString label() const override; + bool isBridged() const override; + AbstractBridgeInterface* bridge() const override; - private: - QSharedPointer m_real; - }; + private: + QSharedPointer m_real; + }; - class TrueBridge : public AbstractBridgeInterface - { - public: - TrueBridge(QSharedPointer bridge); - QUuid uuid() const override; + class TrueBridge : public AbstractBridgeInterface + { + public: + TrueBridge(QSharedPointer bridge); + QUuid uuid() const override; - private: - QSharedPointer m_bridge; - }; + private: + QSharedPointer m_bridge; + }; } #endif // TRUETERMINALSTRIP_H diff --git a/sources/autoNum/assignvariables.h b/sources/autoNum/assignvariables.h index c0e4dfc62..ee77d581a 100644 --- a/sources/autoNum/assignvariables.h +++ b/sources/autoNum/assignvariables.h @@ -63,7 +63,7 @@ namespace autonum public: static QString formulaToLabel (QString formula, sequentialNumbers &seqStruct, Diagram *diagram, const Element *elmt = nullptr); static QString replaceVariable (const QString &formula, const DiagramContext &dc); - static QString genericXref (const Element *element); + static QString genericXref (const Element *element); private: AssignVariables(const QString& formula, const sequentialNumbers& seqStruct , Diagram *diagram, const Element *elmt = nullptr); diff --git a/sources/diagramevent/diagrameventinterface.cpp b/sources/diagramevent/diagrameventinterface.cpp index 959b5e27f..eb4329914 100644 --- a/sources/diagramevent/diagrameventinterface.cpp +++ b/sources/diagramevent/diagrameventinterface.cpp @@ -23,8 +23,8 @@ #include DiagramEventInterface::DiagramEventInterface(Diagram *diagram) : - QObject{diagram}, - m_diagram{diagram} + QObject{diagram}, + m_diagram{diagram} { m_diagram -> clearSelection(); } diff --git a/sources/diagramevent/diagrameventinterface.h b/sources/diagramevent/diagrameventinterface.h index f5a578259..41930a36c 100644 --- a/sources/diagramevent/diagrameventinterface.h +++ b/sources/diagramevent/diagrameventinterface.h @@ -64,9 +64,9 @@ class DiagramEventInterface : public QObject void finish(); //Emitted when the interface finishes its job. protected: - QPointer m_diagram; - bool m_running{false}; - bool m_abort{false}; + QPointer m_diagram; + bool m_running{false}; + bool m_abort{false}; }; #endif // DIAGRAMEVENTINTERFACE_H diff --git a/sources/editor/arceditor.cpp b/sources/editor/arceditor.cpp index 7dea37f7e..5d42a4914 100644 --- a/sources/editor/arceditor.cpp +++ b/sources/editor/arceditor.cpp @@ -87,16 +87,16 @@ void ArcEditor::setUpChangeConnections() #if TODO_LIST #pragma message("@TODO implement position changes!") #endif - // TODO: implement position changes! - //m_change_connections << connect(part, &PartArc::) + // TODO: implement position changes! + //m_change_connections << connect(part, &PartArc::) } void ArcEditor::disconnectChangeConnections() { - for (QMetaObject::Connection c : m_change_connections) { + for (QMetaObject::Connection c : m_change_connections) { disconnect(c); - } - m_change_connections.clear(); + } + m_change_connections.clear(); } /** diff --git a/sources/editor/editorcommands.h b/sources/editor/editorcommands.h index 024626b59..49d375287 100644 --- a/sources/editor/editorcommands.h +++ b/sources/editor/editorcommands.h @@ -247,21 +247,21 @@ class changeElementDataCommand : public ElementEditionCommand }; /** - @brief The RotateSelectionInESCommand class - Rotate the selected items in the element editor + @brief The RotateSelectionInESCommand class + Rotate the selected items in the element editor */ class RotateElementsCommand : public ElementEditionCommand { public: - RotateElementsCommand(ElementScene *scene, QUndoCommand *parent=nullptr); - void undo() override; - void redo() override; + RotateElementsCommand(ElementScene *scene, QUndoCommand *parent=nullptr); + void undo() override; + void redo() override; private: - ElementScene *m_scene =nullptr; - QList m_items; + ElementScene *m_scene =nullptr; + QList m_items; }; diff --git a/sources/editor/elementscene.cpp b/sources/editor/elementscene.cpp index ec963e0a8..a3a9c2e1b 100644 --- a/sources/editor/elementscene.cpp +++ b/sources/editor/elementscene.cpp @@ -449,7 +449,7 @@ const QDomDocument ElementScene::toXml(bool all_parts) root.setAttribute("hotspot_y", QString("%1").arg( -(qRound(size.y() - (ymargin/2))))); - QetVersion::toXmlAttribute(root); + QetVersion::toXmlAttribute(root); root.setAttribute("link_type", m_element_data.typeToString(m_element_data.m_type)); //Uuid used to compare two elements diff --git a/sources/editor/graphicspart/partline.h b/sources/editor/graphicspart/partline.h index 6df63bb5c..a4ae21326 100644 --- a/sources/editor/graphicspart/partline.h +++ b/sources/editor/graphicspart/partline.h @@ -125,6 +125,6 @@ class PartLine : public CustomElementGraphicPart int m_vector_index = -1; QPropertyUndoCommand *m_undo_command; QVector m_handler_vector; - qreal m_rot; + qreal m_rot; }; #endif diff --git a/sources/editor/graphicspart/partpolygon.h b/sources/editor/graphicspart/partpolygon.h index d8b7c6110..227105215 100644 --- a/sources/editor/graphicspart/partpolygon.h +++ b/sources/editor/graphicspart/partpolygon.h @@ -117,6 +117,6 @@ class PartPolygon : public CustomElementGraphicPart QAction *m_insert_point, *m_remove_point; QPointF m_context_menu_pos; - qreal m_rot; + qreal m_rot; }; #endif diff --git a/sources/editor/graphicspart/partrectangle.cpp b/sources/editor/graphicspart/partrectangle.cpp index 35be1de09..2927bcd3d 100644 --- a/sources/editor/graphicspart/partrectangle.cpp +++ b/sources/editor/graphicspart/partrectangle.cpp @@ -31,7 +31,7 @@ PartRectangle::PartRectangle(QETElementEditor *editor, QGraphicsItem *parent) : CustomElementGraphicPart(editor, parent) { - m_rot=0; + m_rot=0; } /** @@ -201,7 +201,7 @@ QRectF PartRectangle::sceneGeometricRect() const */ QPointF PartRectangle::sceneTopLeft() const { - return(mapToScene(rect().topLeft())); + return(mapToScene(rect().topLeft())); } /** diff --git a/sources/editor/graphicspart/partrectangle.h b/sources/editor/graphicspart/partrectangle.h index 28017927a..9d9f23b2a 100644 --- a/sources/editor/graphicspart/partrectangle.h +++ b/sources/editor/graphicspart/partrectangle.h @@ -34,7 +34,7 @@ class PartRectangle : public CustomElementGraphicPart Q_PROPERTY(QRectF rect READ rect WRITE setRect) Q_PROPERTY(qreal xRadius READ XRadius WRITE setXRadius NOTIFY XRadiusChanged) Q_PROPERTY(qreal yRadius READ YRadius WRITE setYRadius NOTIFY YRadiusChanged) - Q_PROPERTY(qreal rotation READ rotation WRITE setRotation NOTIFY rotationChanged) + Q_PROPERTY(qreal rotation READ rotation WRITE setRotation NOTIFY rotationChanged) // constructors, destructor public: @@ -48,7 +48,7 @@ class PartRectangle : public CustomElementGraphicPart void rectChanged(); void XRadiusChanged(); void YRadiusChanged(); - void rotationChanged(); + void rotationChanged(); // methods public: @@ -112,6 +112,6 @@ class PartRectangle : public CustomElementGraphicPart m_old_xRadius, m_old_yRadius; bool m_modifie_radius_equaly = false; - qreal m_rot; + qreal m_rot; }; #endif diff --git a/sources/editor/graphicspart/partterminal.h b/sources/editor/graphicspart/partterminal.h index 570e34d08..0dc531f6c 100644 --- a/sources/editor/graphicspart/partterminal.h +++ b/sources/editor/graphicspart/partterminal.h @@ -72,7 +72,7 @@ class PartTerminal : public CustomElementGraphicPart void handleUserTransformation(const QRectF &, const QRectF &) override; Qet::Orientation orientation() const {return d -> m_orientation;} - void setOrientation(Qet::Orientation ori); + void setOrientation(Qet::Orientation ori); qreal rotation() const; void setRotation(qreal angle); diff --git a/sources/editor/styleeditor.cpp b/sources/editor/styleeditor.cpp index 370f66c90..992a9569f 100644 --- a/sources/editor/styleeditor.cpp +++ b/sources/editor/styleeditor.cpp @@ -569,7 +569,7 @@ bool StyleEditor::isStyleEditable(QList cep_list) QStringList str; str << "arc" << "ellipse" << "line" << "polygon" << "rect"; - for (CustomElementPart *cep: cep_list) + for (CustomElementPart *cep: cep_list) if (!str.contains(cep -> xmlName())) return false; diff --git a/sources/factory/elementpicturefactory.cpp b/sources/factory/elementpicturefactory.cpp index b928ef65c..1d042d194 100644 --- a/sources/factory/elementpicturefactory.cpp +++ b/sources/factory/elementpicturefactory.cpp @@ -154,16 +154,16 @@ bool ElementPictureFactory::build(const ElementsLocation &location, QDomElement dom = location.xml(); //Check if the current version can read the xml description - const auto elmt_version = QetVersion::fromXmlAttribute(dom); - if (!elmt_version.isNull() - && QetVersion::currentVersion() < elmt_version) - { - std::cerr << qPrintable( - QObject::tr("Avertissement : l'élément " - " a été enregistré avec une version" - " ultérieure de QElectroTech.") - ) << std::endl; - } + const auto elmt_version = QetVersion::fromXmlAttribute(dom); + if (!elmt_version.isNull() + && QetVersion::currentVersion() < elmt_version) + { + std::cerr << qPrintable( + QObject::tr("Avertissement : l'élément " + " a été enregistré avec une version" + " ultérieure de QElectroTech.") + ) << std::endl; + } //This attributes must be present and valid int w, h, hot_x, hot_y; @@ -249,7 +249,7 @@ bool ElementPictureFactory::build(const ElementsLocation &location, void ElementPictureFactory::parseElement(const QDomElement &dom, QPainter &painter, primitives &prim) const { - if (dom.tagName() == "line") (parseLine (dom, painter, prim)); + if (dom.tagName() == "line") (parseLine (dom, painter, prim)); else if (dom.tagName() == "rect") (parseRect (dom, painter, prim)); else if (dom.tagName() == "ellipse") (parseEllipse(dom, painter, prim)); else if (dom.tagName() == "circle") (parseCircle (dom, painter, prim)); diff --git a/sources/print/projectprintwindow.cpp b/sources/print/projectprintwindow.cpp index c1622a7a2..326c10e0b 100644 --- a/sources/print/projectprintwindow.cpp +++ b/sources/print/projectprintwindow.cpp @@ -86,7 +86,7 @@ void ProjectPrintWindow::launchDialog(QETProject *project, QPrinter::OutputForma if (!file_name.endsWith(".pdf")) { file_name.append(".pdf"); } - printer_->setCreator(QString("QElectroTech %1").arg(QetVersion::displayedVersion())); + printer_->setCreator(QString("QElectroTech %1").arg(QetVersion::displayedVersion())); printer_->setOutputFileName(file_name); printer_->setOutputFormat(QPrinter::PdfFormat); } @@ -98,11 +98,11 @@ void ProjectPrintWindow::launchDialog(QETProject *project, QPrinter::OutputForma QString ProjectPrintWindow::docName(QETProject *project) { QString doc_name; - if (!project->filePath().isEmpty()) { - doc_name = QFileInfo(project->filePath()).baseName(); - } else if (!project->title().isEmpty()) { - doc_name = project->title(); - doc_name = QET::stringToFileName(doc_name); + if (!project->filePath().isEmpty()) { + doc_name = QFileInfo(project->filePath()).baseName(); + } else if (!project->title().isEmpty()) { + doc_name = project->title(); + doc_name = QET::stringToFileName(doc_name); } if (doc_name.isEmpty()) { @@ -669,7 +669,7 @@ QList ProjectPrintWindow::selectedDiagram() const void ProjectPrintWindow::exportToPDF() { - auto file_name = QFileDialog::getSaveFileName(this, tr("Exporter sous : "), m_printer->outputFileName(), tr("Fichier (*.pdf)")); + auto file_name = QFileDialog::getSaveFileName(this, tr("Exporter sous : "), m_printer->outputFileName(), tr("Fichier (*.pdf)")); if (file_name.isEmpty()) { return; } diff --git a/sources/print/projectprintwindow.h b/sources/print/projectprintwindow.h index 9a2ee25ad..25d83c857 100644 --- a/sources/print/projectprintwindow.h +++ b/sources/print/projectprintwindow.h @@ -40,7 +40,7 @@ class QCheckBox; */ class ProjectPrintWindow : public QMainWindow { - Q_OBJECT + Q_OBJECT public: static void launchDialog(QETProject *project, QPrinter::OutputFormat format = QPrinter::NativeFormat, QWidget *parent = nullptr); diff --git a/sources/project/projectpropertieshandler.cpp b/sources/project/projectpropertieshandler.cpp index 1e239e074..7fcbbd044 100644 --- a/sources/project/projectpropertieshandler.cpp +++ b/sources/project/projectpropertieshandler.cpp @@ -1,30 +1,30 @@ /* - Copyright 2006-2024 The QElectroTech Team - This file is part of QElectroTech. + 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 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. + 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 . + You should have received a copy of the GNU General Public License + along with QElectroTech. If not, see . */ #include "projectpropertieshandler.h" #include "../qetproject.h" ProjectPropertiesHandler::ProjectPropertiesHandler(QETProject *project) : - m_project(project) + m_project(project) { } TerminalStripLayoutsHandler &ProjectPropertiesHandler::terminalStripLayoutHandler() { - return m_terminal_strip_layout_handler; + return m_terminal_strip_layout_handler; } diff --git a/sources/project/projectpropertieshandler.h b/sources/project/projectpropertieshandler.h index e77a216b3..71338bfae 100644 --- a/sources/project/projectpropertieshandler.h +++ b/sources/project/projectpropertieshandler.h @@ -1,19 +1,19 @@ /* - Copyright 2006-2024 The QElectroTech Team - This file is part of QElectroTech. + 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 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. + 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 . + You should have received a copy of the GNU General Public License + along with QElectroTech. If not, see . */ #ifndef PROJECTPROPERTIESHANDLER_H #define PROJECTPROPERTIESHANDLER_H @@ -39,15 +39,15 @@ class QETProject; */ class ProjectPropertiesHandler { - public: - ProjectPropertiesHandler(QETProject *project); + public: + ProjectPropertiesHandler(QETProject *project); - TerminalStripLayoutsHandler& terminalStripLayoutHandler(); + TerminalStripLayoutsHandler& terminalStripLayoutHandler(); - private: - QPointer m_project; + private: + QPointer m_project; - TerminalStripLayoutsHandler m_terminal_strip_layout_handler; + TerminalStripLayoutsHandler m_terminal_strip_layout_handler; }; #endif // PROJECTPROPERTIESHANDLER_H diff --git a/sources/properties/elementdata.cpp b/sources/properties/elementdata.cpp index 3e02c874f..daffd22b6 100644 --- a/sources/properties/elementdata.cpp +++ b/sources/properties/elementdata.cpp @@ -443,7 +443,7 @@ ElementData::SlaveState ElementData::slaveStateFromString(const QString &string) return ElementData::SW; } else if (string == QLatin1String("Other")){ return ElementData::Other; - } + } qDebug() << "ElementData::slaveStateFromString : string : " << string diff --git a/sources/qetgraphicsitem/conductor.cpp b/sources/qetgraphicsitem/conductor.cpp index dc9d23595..116491f9a 100644 --- a/sources/qetgraphicsitem/conductor.cpp +++ b/sources/qetgraphicsitem/conductor.cpp @@ -1765,29 +1765,29 @@ void Conductor::setSequenceNum(const autonum::sequentialNumbers& sn) */ void Conductor::setUpConnectionForFormula(QString old_formula, QString new_formula) { - Diagram *diagram_ {diagram()}; - if (!diagram_) { - diagram_ = terminal1->diagram(); - } - if (diagram_) + Diagram *diagram_ {diagram()}; + if (!diagram_) { + diagram_ = terminal1->diagram(); + } + if (diagram_) { //Because the variable %F is a reference to another text which can contain variables, //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()); + old_formula.replace("%F", diagram_->border_and_titleblock.folio()); if (old_formula.contains("%id")) - disconnect(diagram_->project(), &QETProject::projectDiagramsOrderChanged, this, &Conductor::refreshText); + disconnect(diagram_->project(), &QETProject::projectDiagramsOrderChanged, this, &Conductor::refreshText); //Label is frozen, so we don't update it. if (m_freeze_label == true) return; if (new_formula.contains("%F")) - new_formula.replace("%F", diagram_->border_and_titleblock.folio()); + new_formula.replace("%F", diagram_->border_and_titleblock.folio()); if (new_formula.contains("%id")) - connect(diagram_->project(), &QETProject::projectDiagramsOrderChanged, this, &Conductor::refreshText); + connect(diagram_->project(), &QETProject::projectDiagramsOrderChanged, this, &Conductor::refreshText); } } diff --git a/sources/qetgraphicsitem/conductor.h b/sources/qetgraphicsitem/conductor.h index 63be5387f..d7b7d8e88 100644 --- a/sources/qetgraphicsitem/conductor.h +++ b/sources/qetgraphicsitem/conductor.h @@ -137,7 +137,7 @@ class Conductor : public QGraphicsObject {return m_autoNum_seq;} void setSequenceNum(const autonum::sequentialNumbers& sn); - QList junctions() const; + QList junctions() const; private: void setUpConnectionForFormula( @@ -227,7 +227,7 @@ class Conductor : public QGraphicsObject static int getCoeff(const qreal &, const qreal &); static int getSign(const qreal &); QHash shareOffsetBetweenSegments(const qreal &offset, const QList &, const qreal & = 0.01) const; - static QPointF extendTerminal(const QPointF &, Qet::Orientation, qreal = 10); + static QPointF extendTerminal(const QPointF &, Qet::Orientation, qreal = 10); static Qt::Corner movementType(const QPointF &, const QPointF &); static QPointF movePointIntoPolygon(const QPointF &, const QPainterPath &); }; diff --git a/sources/qetgraphicsitem/element.cpp b/sources/qetgraphicsitem/element.cpp index 74c9fe580..7a0f48575 100644 --- a/sources/qetgraphicsitem/element.cpp +++ b/sources/qetgraphicsitem/element.cpp @@ -427,17 +427,17 @@ bool Element::buildFromXml(const QDomElement &xml_def_elmt, int *state) return(false); } - //Check if the current version can read the xml description - const auto elmt_version = QetVersion::fromXmlAttribute(xml_def_elmt); - if (!elmt_version.isNull() - && QetVersion::currentVersion() < elmt_version) - { - std::cerr << qPrintable( - QObject::tr("Avertissement : l'élément " - " a été enregistré avec une version" - " ultérieure de QElectroTech.") - ) << std::endl; - } + //Check if the current version can read the xml description + const auto elmt_version = QetVersion::fromXmlAttribute(xml_def_elmt); + if (!elmt_version.isNull() + && QetVersion::currentVersion() < elmt_version) + { + std::cerr << qPrintable( + QObject::tr("Avertissement : l'élément " + " a été enregistré avec une version" + " ultérieure de QElectroTech.") + ) << std::endl; + } //This attribute must be present and valid int w = 0, h = 0, hot_x = 0, hot_y = 0; diff --git a/sources/undocommand/addgraphicsobjectcommand.cpp b/sources/undocommand/addgraphicsobjectcommand.cpp index 7053c9e91..968b7eee0 100644 --- a/sources/undocommand/addgraphicsobjectcommand.cpp +++ b/sources/undocommand/addgraphicsobjectcommand.cpp @@ -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 . + 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 . */ #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(m_item.data())) { - return qgi->name(); + return qgi->name(); } else if (dynamic_cast(m_item.data())) { return QObject::tr("un champ texte"); } else if (dynamic_cast(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"); + } } diff --git a/sources/undocommand/addgraphicsobjectcommand.h b/sources/undocommand/addgraphicsobjectcommand.h index 96f3ebd91..005c895dc 100644 --- a/sources/undocommand/addgraphicsobjectcommand.h +++ b/sources/undocommand/addgraphicsobjectcommand.h @@ -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 . + 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 . */ #ifndef ADDGRAPHICSOBJECTCOMMAND_H #define ADDGRAPHICSOBJECTCOMMAND_H @@ -32,21 +32,21 @@ class Diagram; class AddGraphicsObjectCommand : public QUndoCommand { public: - AddGraphicsObjectCommand(QGraphicsObject *qgo, Diagram *diagram, - const QPointF &pos = QPointF(), - QUndoCommand *parent = nullptr); - ~AddGraphicsObjectCommand() override; + AddGraphicsObjectCommand(QGraphicsObject *qgo, Diagram *diagram, + const QPointF &pos = QPointF(), + QUndoCommand *parent = nullptr); + ~AddGraphicsObjectCommand() override; - void undo() override; - void redo() override; + void undo() override; + void redo() override; - private: - QString itemText() const; + private: + QString itemText() const; - private: - QPointer m_item; - Diagram *m_diagram = nullptr; - QPointF m_pos; + private: + QPointer m_item; + Diagram *m_diagram = nullptr; + QPointF m_pos; }; #endif // ADDGRAPHICSOBJECTCOMMAND_H diff --git a/sources/undocommand/changeelementdatacommand.cpp b/sources/undocommand/changeelementdatacommand.cpp index b4245cd96..b74f62635 100644 --- a/sources/undocommand/changeelementdatacommand.cpp +++ b/sources/undocommand/changeelementdatacommand.cpp @@ -1,40 +1,40 @@ /* - 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 . + 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 . */ #include "changeelementdatacommand.h" #include "../qetgraphicsitem/element.h" ChangeElementDataCommand::ChangeElementDataCommand(Element *element, ElementData new_data, QUndoCommand *parent) : QUndoCommand(parent), - m_element(element), - m_old_data(element->elementData()), - m_new_data(new_data) + m_element(element), + m_old_data(element->elementData()), + m_new_data(new_data) { - setText(QObject::tr("Modifier les propriétés d'un élement")); + setText(QObject::tr("Modifier les propriétés d'un élement")); } void ChangeElementDataCommand::undo() { - if (m_element) { + if (m_element) { m_element.data()->setElementData(m_old_data); - } + } } void ChangeElementDataCommand::redo() { - if (m_element) { + if (m_element) { m_element.data()->setElementData(m_new_data); - } + } } diff --git a/sources/undocommand/changeelementdatacommand.h b/sources/undocommand/changeelementdatacommand.h index e760a3d69..21a278d89 100644 --- a/sources/undocommand/changeelementdatacommand.h +++ b/sources/undocommand/changeelementdatacommand.h @@ -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 . + 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 . */ #ifndef CHANGEELEMENTDATACOMMAND_H #define CHANGEELEMENTDATACOMMAND_H @@ -25,14 +25,14 @@ class Element; class ChangeElementDataCommand : public QUndoCommand { - public: + public: ChangeElementDataCommand(Element *element, ElementData new_data, QUndoCommand *parent = nullptr); - void undo() override; - void redo() override; + void undo() override; + void redo() override; - private: - QPointer m_element; - ElementData m_old_data, m_new_data; + private: + QPointer m_element; + ElementData m_old_data, m_new_data; }; #endif // CHANGEELEMENTDATACOMMAND_H diff --git a/sources/undocommand/itemmodelcommand.h b/sources/undocommand/itemmodelcommand.h index 5274c7253..965c21950 100644 --- a/sources/undocommand/itemmodelcommand.h +++ b/sources/undocommand/itemmodelcommand.h @@ -30,15 +30,15 @@ class QAbstractItemModel; */ class ModelIndexCommand : public QUndoCommand { - public: + public: ModelIndexCommand(QAbstractItemModel *model, const QModelIndex &index, QUndoCommand *parent = nullptr); void setData(const QVariant &value, int role = Qt::DisplayRole); virtual void redo() override; virtual void undo() override; - private: - QPointer m_model; + private: + QPointer m_model; QModelIndex m_index; QVariant m_old_value, m_new_value; diff --git a/sources/undocommand/movegraphicsitemcommand.cpp b/sources/undocommand/movegraphicsitemcommand.cpp index 33dd89b7e..20037efcc 100644 --- a/sources/undocommand/movegraphicsitemcommand.cpp +++ b/sources/undocommand/movegraphicsitemcommand.cpp @@ -1,19 +1,19 @@ /* - Copyright 2006-2022 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 . + Copyright 2006-2022 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 . */ #include #include @@ -33,25 +33,25 @@ * @param parent : parent undo command */ MoveGraphicsItemCommand::MoveGraphicsItemCommand(Diagram *diagram, - const DiagramContent &content, - const QPointF &movement, - QUndoCommand *parent) : - QUndoCommand{parent}, - m_diagram{diagram}, - m_content{content}, - m_movement{movement} + const DiagramContent &content, + const QPointF &movement, + QUndoCommand *parent) : + QUndoCommand{parent}, + m_diagram{diagram}, + m_content{content}, + m_movement{movement} { - const auto moved_content_sentence = m_content.sentence(DiagramContent::Elements - | DiagramContent::TextFields - | DiagramContent::ConductorsToUpdate - | DiagramContent::ConductorsToMove - | DiagramContent::Images - | DiagramContent::Shapes - | DiagramContent::ElementTextFields - | DiagramContent::TerminalStrip); + const auto moved_content_sentence = m_content.sentence(DiagramContent::Elements + | DiagramContent::TextFields + | DiagramContent::ConductorsToUpdate + | DiagramContent::ConductorsToMove + | DiagramContent::Images + | DiagramContent::Shapes + | DiagramContent::ElementTextFields + | DiagramContent::TerminalStrip); - setText(QString(QObject::tr("déplacer %1", - "undo caption - %1 is a sentence listing the moved content").arg(moved_content_sentence))); + setText(QString(QObject::tr("déplacer %1", + "undo caption - %1 is a sentence listing the moved content").arg(moved_content_sentence))); } /** @@ -60,13 +60,13 @@ MoveGraphicsItemCommand::MoveGraphicsItemCommand(Diagram *diagram, */ void MoveGraphicsItemCommand::undo() { - if (m_diagram) - { - m_diagram->showMe(); - m_anim_group.setDirection(QAnimationGroup::Forward); - m_anim_group.start(); - } - QUndoCommand::undo(); + if (m_diagram) + { + m_diagram->showMe(); + m_anim_group.setDirection(QAnimationGroup::Forward); + m_anim_group.start(); + } + QUndoCommand::undo(); } /** @@ -75,21 +75,21 @@ void MoveGraphicsItemCommand::undo() */ void MoveGraphicsItemCommand::redo() { - if (m_diagram) - { - m_diagram->showMe(); - if (m_first_redo) - { - m_first_redo = false; - move(-m_movement); - } - else - { - m_anim_group.setDirection(QAnimationGroup::Backward); - m_anim_group.start(); - } - } - QUndoCommand::redo(); + if (m_diagram) + { + m_diagram->showMe(); + if (m_first_redo) + { + m_first_redo = false; + move(-m_movement); + } + else + { + m_anim_group.setDirection(QAnimationGroup::Backward); + m_anim_group.start(); + } + } + QUndoCommand::redo(); } /** @@ -99,57 +99,57 @@ void MoveGraphicsItemCommand::redo() */ void MoveGraphicsItemCommand::move(const QPointF &movement) { - for (auto &&qgi : m_content.items(DiagramContent::Elements - | DiagramContent::TextFields - | DiagramContent::Images - | DiagramContent::Shapes - | DiagramContent::TextGroup - | DiagramContent::ElementTextFields - | DiagramContent::Tables - | DiagramContent::TerminalStrip)) - { - //If item have a parent and the parent is in m_content, - //we don't apply movement because this item will be moved by his parent - if (const auto parent_ = qgi->parentItem()) { - if (m_content.items().contains(parent_)) { - continue; - } - } + for (auto &&qgi : m_content.items(DiagramContent::Elements + | DiagramContent::TextFields + | DiagramContent::Images + | DiagramContent::Shapes + | DiagramContent::TextGroup + | DiagramContent::ElementTextFields + | DiagramContent::Tables + | DiagramContent::TerminalStrip)) + { + //If item have a parent and the parent is in m_content, + //we don't apply movement because this item will be moved by his parent + if (const auto parent_ = qgi->parentItem()) { + if (m_content.items().contains(parent_)) { + continue; + } + } - if (const auto graphics_object = qgi->toGraphicsObject()) { - setupAnimation(graphics_object, - "pos", - graphics_object->pos(), - graphics_object->pos() + movement); - } - else if (qgi->type() == QGraphicsItemGroup::Type) - { - //ElementTextItemGroup is a QObject not a QGraphicsObject - if (ElementTextItemGroup *etig = dynamic_cast(qgi)) { - setupAnimation(etig, - "pos", - etig->pos(), - etig->pos() + movement); - } - } - else - { - qgi->setPos(qgi->pos() + movement); - } - } + if (const auto graphics_object = qgi->toGraphicsObject()) { + setupAnimation(graphics_object, + "pos", + graphics_object->pos(), + graphics_object->pos() + movement); + } + else if (qgi->type() == QGraphicsItemGroup::Type) + { + //ElementTextItemGroup is a QObject not a QGraphicsObject + if (ElementTextItemGroup *etig = dynamic_cast(qgi)) { + setupAnimation(etig, + "pos", + etig->pos(), + etig->pos() + movement); + } + } + else + { + qgi->setPos(qgi->pos() + movement); + } + } - //Move some conductors - for (const auto &conductor : qAsConst(m_content.m_conductors_to_move)) { - setupAnimation(conductor, - "pos", - conductor->pos(), - conductor->pos() + movement); - } + //Move some conductors + for (const auto &conductor : qAsConst(m_content.m_conductors_to_move)) { + setupAnimation(conductor, + "pos", + conductor->pos(), + conductor->pos() + movement); + } - //Recalcul the path of other conductors - for (const auto &conductor : qAsConst(m_content.m_conductors_to_update)) { - setupAnimation(conductor, "animPath", 1, 1); - } + //Recalcul the path of other conductors + for (const auto &conductor : qAsConst(m_content.m_conductors_to_update)) { + setupAnimation(conductor, "animPath", 1, 1); + } } /** @@ -162,14 +162,14 @@ void MoveGraphicsItemCommand::move(const QPointF &movement) * @param end */ void MoveGraphicsItemCommand::setupAnimation(QObject *target, - const QByteArray &property_name, - const QVariant &start, - const QVariant &end) + const QByteArray &property_name, + const QVariant &start, + const QVariant &end) { - QPropertyAnimation *animation{new QPropertyAnimation(target, property_name)}; - animation->setDuration(300); - animation->setStartValue(start); - animation->setEndValue(end); - animation->setEasingCurve(QEasingCurve::OutQuad); - m_anim_group.addAnimation(animation); + QPropertyAnimation *animation{new QPropertyAnimation(target, property_name)}; + animation->setDuration(300); + animation->setStartValue(start); + animation->setEndValue(end); + animation->setEasingCurve(QEasingCurve::OutQuad); + m_anim_group.addAnimation(animation); } diff --git a/sources/xml/terminalstripitemxml.cpp b/sources/xml/terminalstripitemxml.cpp index 954dece8e..d10e946da 100644 --- a/sources/xml/terminalstripitemxml.cpp +++ b/sources/xml/terminalstripitemxml.cpp @@ -1,19 +1,19 @@ /* - Copyright 2006-2022 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 . + Copyright 2006-2022 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 . */ #include "terminalstripitemxml.h" @@ -37,16 +37,16 @@ const QString STRIP_ITEMS_TAG_NAME { QStringLiteral("terminal_strip_items") }; */ QDomElement TerminalStripItemXml::toXml(const QVector &items, QDomDocument &document) { - auto dom_element = document.createElement(STRIP_ITEMS_TAG_NAME); - for (const auto &item : items) - { - const auto child_ = toXml(item, document); - if (!child_.isNull()) { - dom_element.appendChild(child_); - } - } + auto dom_element = document.createElement(STRIP_ITEMS_TAG_NAME); + for (const auto &item : items) + { + const auto child_ = toXml(item, document); + if (!child_.isNull()) { + dom_element.appendChild(child_); + } + } - return dom_element; + return dom_element; } /** @@ -59,20 +59,20 @@ QDomElement TerminalStripItemXml::toXml(const QVector &item */ QVector TerminalStripItemXml::fromXml(Diagram *diagram, const QDomElement &xml_elmt) { - QVector returned_vector; + QVector returned_vector; - for (const auto &dom_elmt : QETXML::subChild(xml_elmt, - STRIP_ITEMS_TAG_NAME, - STRIP_ITEM_TAG_NAME)) - { - auto strip_item = new TerminalStripItem(); - diagram->addItem(strip_item); - returned_vector << strip_item; + for (const auto &dom_elmt : QETXML::subChild(xml_elmt, + STRIP_ITEMS_TAG_NAME, + STRIP_ITEM_TAG_NAME)) + { + auto strip_item = new TerminalStripItem(); + diagram->addItem(strip_item); + returned_vector << strip_item; - TerminalStripItemXml::fromXml(strip_item, diagram->project(), dom_elmt); - } + TerminalStripItemXml::fromXml(strip_item, diagram->project(), dom_elmt); + } - return returned_vector; + return returned_vector; } /** @@ -84,21 +84,21 @@ QVector TerminalStripItemXml::fromXml(Diagram *diagram, con */ QDomElement TerminalStripItemXml::toXml(TerminalStripItem *item, QDomDocument &document) { - if (item->terminalStrip()) - { - //Terminal strip item dom element - auto dom_element = document.createElement(STRIP_ITEM_TAG_NAME); + if (item->terminalStrip()) + { + //Terminal strip item dom element + auto dom_element = document.createElement(STRIP_ITEM_TAG_NAME); - auto dom_strip = document.createElement(QStringLiteral("terminal_strip")); - dom_strip.setAttribute(QStringLiteral("uuid"), item->terminalStrip()->uuid().toString()); - dom_element.appendChild(dom_strip); + auto dom_strip = document.createElement(QStringLiteral("terminal_strip")); + dom_strip.setAttribute(QStringLiteral("uuid"), item->terminalStrip()->uuid().toString()); + dom_element.appendChild(dom_strip); - dom_element.appendChild(QETXML::qGraphicsItemPosToXml(item, document)); + dom_element.appendChild(QETXML::qGraphicsItemPosToXml(item, document)); - return dom_element; - } else { - return QDomElement(); - } + return dom_element; + } else { + return QDomElement(); + } } /** @@ -112,29 +112,29 @@ QDomElement TerminalStripItemXml::toXml(TerminalStripItem *item, QDomDocument &d */ bool TerminalStripItemXml::fromXml(TerminalStripItem *item, QETProject *project, const QDomElement &xml_elmt) { - if (xml_elmt.tagName() == STRIP_ITEM_TAG_NAME) - { - bool a{false}; + if (xml_elmt.tagName() == STRIP_ITEM_TAG_NAME) + { + bool a{false}; - const auto ts = xml_elmt.firstChildElement(QStringLiteral("terminal_strip")); - if (!ts.isNull()) - { - const QUuid uuid_(ts.attribute(QStringLiteral("uuid"))); - item->m_pending_strip_uuid = uuid_; + const auto ts = xml_elmt.firstChildElement(QStringLiteral("terminal_strip")); + if (!ts.isNull()) + { + const QUuid uuid_(ts.attribute(QStringLiteral("uuid"))); + item->m_pending_strip_uuid = uuid_; - for (const auto &ts : project->terminalStrip()) { - if (ts->uuid() == uuid_) { - item->setTerminalStrip(ts); - a = true; - break; - } - } - } + for (const auto &ts : project->terminalStrip()) { + if (ts->uuid() == uuid_) { + item->setTerminalStrip(ts); + a = true; + break; + } + } + } - bool b{QETXML::qGraphicsItemPosFromXml(item, - xml_elmt.firstChildElement(QStringLiteral("pos")))}; + bool b{QETXML::qGraphicsItemPosFromXml(item, + xml_elmt.firstChildElement(QStringLiteral("pos")))}; - return (a && b); - } - return false; + return (a && b); + } + return false; } diff --git a/sources/xml/terminalstripitemxml.h b/sources/xml/terminalstripitemxml.h index c0e738f13..a59d855d6 100644 --- a/sources/xml/terminalstripitemxml.h +++ b/sources/xml/terminalstripitemxml.h @@ -1,19 +1,19 @@ /* - Copyright 2006-2022 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 . + Copyright 2006-2022 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 . */ #ifndef TERMINALSTRIPITEMXML_H #define TERMINALSTRIPITEMXML_H @@ -26,12 +26,12 @@ class Diagram; class TerminalStripItemXml { - public: - static QDomElement toXml(const QVector &items, QDomDocument &document); - static QVector fromXml(Diagram *diagram, const QDomElement &xml_elmt); + public: + static QDomElement toXml(const QVector &items, QDomDocument &document); + static QVector fromXml(Diagram *diagram, const QDomElement &xml_elmt); - static QDomElement toXml(TerminalStripItem *item, QDomDocument &document); - static bool fromXml(TerminalStripItem *item, QETProject *project, const QDomElement &xml_elmt); + static QDomElement toXml(TerminalStripItem *item, QDomDocument &document); + static bool fromXml(TerminalStripItem *item, QETProject *project, const QDomElement &xml_elmt); }; #endif // TERMINALSTRIPITEMXML_H