diff --git a/sources/QPropertyUndoCommand/qpropertyundocommand.h b/sources/QPropertyUndoCommand/qpropertyundocommand.h index 77f274777..8216ebf2f 100644 --- a/sources/QPropertyUndoCommand/qpropertyundocommand.h +++ b/sources/QPropertyUndoCommand/qpropertyundocommand.h @@ -33,8 +33,15 @@ class QObject; class QPropertyUndoCommand : public QUndoCommand { public: - QPropertyUndoCommand(QObject *object, const char *property_name, const QVariant &old_value, const QVariant &new_value, QUndoCommand *parent = nullptr); - QPropertyUndoCommand(QObject *object, const char *property_name, const QVariant &old_value, QUndoCommand *parent = nullptr); + QPropertyUndoCommand(QObject *object, + const char *property_name, + const QVariant &old_value, + const QVariant &new_value, + QUndoCommand *parent = nullptr); + QPropertyUndoCommand(QObject *object, + const char *property_name, + const QVariant &old_value, + QUndoCommand *parent = nullptr); QPropertyUndoCommand(const QPropertyUndoCommand *other); void setNewValue(const QVariant &new_value); diff --git a/sources/QetGraphicsItemModeler/qetgraphicshandlerutility.cpp b/sources/QetGraphicsItemModeler/qetgraphicshandlerutility.cpp index 9647a3a80..6dc87c051 100644 --- a/sources/QetGraphicsItemModeler/qetgraphicshandlerutility.cpp +++ b/sources/QetGraphicsItemModeler/qetgraphicshandlerutility.cpp @@ -76,7 +76,9 @@ QVector QetGraphicsHandlerUtility::pointsForLine(const QLineF &line) { @param span_angle : span angle in degree; @return */ -QVector QetGraphicsHandlerUtility::pointsForArc(const QRectF &rect, qreal start_angle, qreal span_angle) +QVector QetGraphicsHandlerUtility::pointsForArc(const QRectF &rect, + qreal start_angle, + qreal span_angle) { QVector vector; QPainterPath path; @@ -101,7 +103,9 @@ QVector QetGraphicsHandlerUtility::pointsForArc(const QRectF &rect, qre If index is lower than 0 or higher than 7, this method return old_rect. */ -QRectF QetGraphicsHandlerUtility::rectForPosAtIndex(const QRectF &old_rect, const QPointF &pos, int index) +QRectF QetGraphicsHandlerUtility::rectForPosAtIndex(const QRectF &old_rect, + const QPointF &pos, + int index) { if (index < 0 || index > 7) return old_rect; @@ -132,7 +136,10 @@ QRectF QetGraphicsHandlerUtility::rectForPosAtIndex(const QRectF &old_rect, cons If index is lower than 0 or higher than 7, this method return old_rect. */ -QRectF QetGraphicsHandlerUtility::mirrorRectForPosAtIndex(const QRectF &old_rect, const QPointF &pos, int index) +QRectF QetGraphicsHandlerUtility::mirrorRectForPosAtIndex( + const QRectF &old_rect, + const QPointF &pos, + int index) { if (index < 0 || index > 7) return old_rect; diff --git a/sources/SearchAndReplace/searchandreplaceworker.cpp b/sources/SearchAndReplace/searchandreplaceworker.cpp index fa100e38f..9ee860ad9 100644 --- a/sources/SearchAndReplace/searchandreplaceworker.cpp +++ b/sources/SearchAndReplace/searchandreplaceworker.cpp @@ -246,7 +246,11 @@ void SearchAndReplaceWorker::replaceConductor(Conductor *conductor) @param texts : @param conductors : */ -void SearchAndReplaceWorker::replaceAdvanced(QList diagrams, QList elements, QList texts, QList conductors) +void SearchAndReplaceWorker::replaceAdvanced( + QList diagrams, + QList elements, + QList texts, + QList conductors) { QETProject *project_ = nullptr; @@ -364,7 +368,9 @@ void SearchAndReplaceWorker::replaceAdvanced(QList diagrams, QListsetText(str); cb->setChecked(str == eraseText() ? true : false); diff --git a/sources/SearchAndReplace/searchandreplaceworker.h b/sources/SearchAndReplace/searchandreplaceworker.h index 0f6e7f7bb..903b09f62 100644 --- a/sources/SearchAndReplace/searchandreplaceworker.h +++ b/sources/SearchAndReplace/searchandreplaceworker.h @@ -61,16 +61,27 @@ class SearchAndReplaceWorker void replaceIndiText(IndependentTextItem *text); void replaceConductor(QList list); void replaceConductor(Conductor *conductor); - void replaceAdvanced (QList diagrams = QList(), QList elements = QList(),\ - QList texts = QList(), QList conductors = QList()); + void replaceAdvanced ( + QList diagrams = QList(), + QList elements = QList(), + QList + texts = QList(), + QList + conductors = QList()); - static QString eraseText() {return QString("XXXXXXXXXXXXXXXXXXX");} + static QString eraseText() + {return QString("XXXXXXXXXXXXXXXXXXX");} static QDate eraseDate() {return QDate(1900, 1, 1);} - static void setupLineEdit(QLineEdit *l, QCheckBox *cb, QString str); + static void setupLineEdit(QLineEdit *l, + QCheckBox *cb, + QString str); static ConductorProperties invalidConductorProperties(); - static ConductorProperties applyChange(const ConductorProperties &original, const ConductorProperties &change); - static QString applyChange(const QString &original, const QString &change); + static ConductorProperties applyChange( + const ConductorProperties &original, + const ConductorProperties &change); + static QString applyChange(const QString &original, + const QString &change); private: TitleBlockProperties replaceAdvanced (Diagram *diagram); diff --git a/sources/SearchAndReplace/ui/replaceconductordialog.cpp b/sources/SearchAndReplace/ui/replaceconductordialog.cpp index 12a0f23e6..96aaf7566 100644 --- a/sources/SearchAndReplace/ui/replaceconductordialog.cpp +++ b/sources/SearchAndReplace/ui/replaceconductordialog.cpp @@ -29,7 +29,9 @@ typedef SearchAndReplaceWorker sarw; @param properties @param parent */ -ReplaceConductorDialog::ReplaceConductorDialog(const ConductorProperties &properties, QWidget *parent) : +ReplaceConductorDialog::ReplaceConductorDialog( + const ConductorProperties &properties, + QWidget *parent) : QDialog(parent), ui(new Ui::ReplaceConductorDialog) { diff --git a/sources/SearchAndReplace/ui/replaceconductordialog.h b/sources/SearchAndReplace/ui/replaceconductordialog.h index a28ed243d..a6e3b771d 100644 --- a/sources/SearchAndReplace/ui/replaceconductordialog.h +++ b/sources/SearchAndReplace/ui/replaceconductordialog.h @@ -35,7 +35,9 @@ class ReplaceConductorDialog : public QDialog Q_OBJECT public: - explicit ReplaceConductorDialog(const ConductorProperties &properties, QWidget *parent = 0); + explicit ReplaceConductorDialog( + const ConductorProperties &properties, + QWidget *parent = 0); ~ReplaceConductorDialog(); void updatePreview(bool b=true); void setProperties(const ConductorProperties &properties); diff --git a/sources/editor/editorcommands.cpp b/sources/editor/editorcommands.cpp index 2b93b41a6..73e3453e7 100644 --- a/sources/editor/editorcommands.cpp +++ b/sources/editor/editorcommands.cpp @@ -482,10 +482,13 @@ QList ScalePartsCommand::scaledPrimitives() const { /** @brief ScalePartsCommand::setTransformation Define the transformation applied by this command - @param original_rect Bounding rectangle for all scaled primitives before the operation - @param original_rect Bounding rectangle for all scaled primitives after the operation -*/ -void ScalePartsCommand::setTransformation(const QRectF &original_rect, const QRectF &new_rect) { + @param original_rect : + Bounding rectangle for all scaled primitives before the operation + @param new_rect : + Bounding rectangle for all scaled primitives after the operation + */ +void ScalePartsCommand::setTransformation(const QRectF &original_rect, + const QRectF &new_rect) { original_rect_ = original_rect; new_rect_ = new_rect; } diff --git a/sources/factory/qetgraphicstablefactory.cpp b/sources/factory/qetgraphicstablefactory.cpp index 5e42263b9..b3025f85f 100644 --- a/sources/factory/qetgraphicstablefactory.cpp +++ b/sources/factory/qetgraphicstablefactory.cpp @@ -41,7 +41,10 @@ QetGraphicsTableFactory::QetGraphicsTableFactory() */ void QetGraphicsTableFactory::createAndAddNomenclature(Diagram *diagram) { - QScopedPointer d(new AddTableDialog(new ElementQueryWidget(), diagram->views().first())); + QScopedPointer d( + new AddTableDialog( + new ElementQueryWidget(), + diagram->views().first())); d->setWindowTitle(QObject::tr("Ajouter une nomenclature")); if (d->exec()) { @@ -57,7 +60,10 @@ void QetGraphicsTableFactory::createAndAddNomenclature(Diagram *diagram) */ void QetGraphicsTableFactory::createAndAddSummary(Diagram *diagram) { - QScopedPointer d(new AddTableDialog(new SummaryQueryWidget(), diagram->views().first())); + QScopedPointer d( + new AddTableDialog( + new SummaryQueryWidget(), + diagram->views().first())); d->setWindowTitle(QObject::tr("Ajouter un sommaire")); if (d->exec()) { diff --git a/sources/qetdiagrameditor.cpp b/sources/qetdiagrameditor.cpp index 9f1a78db4..1860838e9 100644 --- a/sources/qetdiagrameditor.cpp +++ b/sources/qetdiagrameditor.cpp @@ -1500,7 +1500,14 @@ void QETDiagramEditor::slot_updateComplexActions() if(!dv) { QList action_list; - action_list << m_conductor_reset << m_find_element << m_cut << m_copy << m_delete_selection << m_rotate_selection << m_edit_selection << m_group_selected_texts; + action_list << m_conductor_reset + << m_find_element + << m_cut + << m_copy + << m_delete_selection + << m_rotate_selection + << m_edit_selection + << m_group_selected_texts; for(QAction *action : action_list) action->setEnabled(false); @@ -1532,8 +1539,18 @@ void QETDiagramEditor::slot_updateComplexActions() QList texts = DiagramContent(diagram_).selectedTexts(); QList groups = DiagramContent(diagram_).selectedTextsGroup(); int selected_texts = texts.count(); - int selected_conductor_texts = 0; for(DiagramTextItem *dti : texts) {if(dti->type() == ConductorTextItem::Type) selected_conductor_texts++;} - int selected_dynamic_elmt_text = 0; for(DiagramTextItem *dti : texts) {if(dti->type() == DynamicElementTextItem::Type) selected_dynamic_elmt_text++;} + int selected_conductor_texts = 0; + for(DiagramTextItem *dti : texts) + { + if(dti->type() == ConductorTextItem::Type) + selected_conductor_texts++; + } + int selected_dynamic_elmt_text = 0; + for(DiagramTextItem *dti : texts) + { + if(dti->type() == DynamicElementTextItem::Type) + selected_dynamic_elmt_text++; + } m_rotate_texts->setEnabled(!ro && (selected_texts || groups.size())); //Action that need only element text selected @@ -1556,11 +1573,13 @@ void QETDiagramEditor::slot_updateComplexActions() int selected_image = dc.count(DiagramContent::Images); int selected_shape = dc.count(DiagramContent::Shapes); - int selected_editable = selected_elements_count + - (selected_texts - selected_conductor_texts - selected_dynamic_elmt_text) + - selected_image + - selected_shape + - selected_conductors_count; + int selected_editable = selected_elements_count + + (selected_texts + - selected_conductor_texts + - selected_dynamic_elmt_text) + + selected_image + + selected_shape + + selected_conductors_count; if (selected_editable == 1) { @@ -1568,41 +1587,47 @@ void QETDiagramEditor::slot_updateComplexActions() //edit element if (selected_elements_count) { - m_edit_selection -> setText(tr("Éditer l'élement", "edit element")); + m_edit_selection -> setText(tr("Éditer l'élement", + "edit element")); m_edit_selection -> setIcon(QET::Icons::ElementEdit); } //edit text field else if (selected_texts) { - m_edit_selection -> setText(tr("Éditer le champ de texte", "edit text field")); + m_edit_selection -> setText(tr("Éditer le champ de texte", + "edit text field")); m_edit_selection -> setIcon(QET::Icons::EditText); } //edit image else if (selected_image) { - m_edit_selection -> setText(tr("Éditer l'image", "edit image")); + m_edit_selection -> setText(tr("Éditer l'image", + "edit image")); m_edit_selection -> setIcon(QET::Icons::resize_image); } //edit conductor else if (selected_conductors_count) { - m_edit_selection -> setText(tr("Éditer le conducteur", "edit conductor")); + m_edit_selection -> setText(tr("Éditer le conducteur", + "edit conductor")); m_edit_selection -> setIcon(QET::Icons::ConductorEdit); } } //not an editable item else { - m_edit_selection -> setText(tr("Éditer l'objet sélectionné", "edit selected item")); + m_edit_selection -> setText(tr("Éditer l'objet sélectionné", + "edit selected item")); m_edit_selection -> setIcon(QET::Icons::ElementEdit); m_edit_selection -> setEnabled(false); } - //Actions for edit Z value - QList list = dc.items(DiagramContent::SelectedOnly | \ - DiagramContent::Elements | \ - DiagramContent::Shapes | \ - DiagramContent::Images); + //Actions for edit Z value + QList list = dc.items( + DiagramContent::SelectedOnly + | DiagramContent::Elements + | DiagramContent::Shapes + | DiagramContent::Images); m_depth_action_group->setEnabled(list.isEmpty()? false : true); } @@ -1668,24 +1693,32 @@ void QETDiagramEditor::addProjectView(ProjectView *project_view) foreach(DiagramView *dv, project_view -> diagram_views()) diagramWasAdded(dv); - //Manage the close event of project - connect(project_view, SIGNAL(projectClosed(ProjectView*)), this, SLOT(projectWasClosed(ProjectView *))); - //Manage the adding of diagram - connect(project_view, SIGNAL(diagramAdded(DiagramView *)), this, SLOT(diagramWasAdded(DiagramView *))); + //Manage the close event of project + connect(project_view, SIGNAL(projectClosed(ProjectView*)), + this, SLOT(projectWasClosed(ProjectView *))); + //Manage the adding of diagram + connect(project_view, SIGNAL(diagramAdded(DiagramView *)), + this, SLOT(diagramWasAdded(DiagramView *))); if (QETProject *project = project_view -> project()) - connect(project, SIGNAL(readOnlyChanged(QETProject *, bool)), this, SLOT(slot_updateActions())); + connect(project, SIGNAL(readOnlyChanged(QETProject *, bool)), + this, SLOT(slot_updateActions())); - //Manage request for edit or find element and titleblock - connect (project_view, &ProjectView::findElementRequired, this, &QETDiagramEditor::findElementInPanel); - connect (project_view, &ProjectView::editElementRequired, this, &QETDiagramEditor::editElementInEditor); + //Manage request for edit or find element and titleblock + connect (project_view, &ProjectView::findElementRequired, + this, &QETDiagramEditor::findElementInPanel); + connect (project_view, &ProjectView::editElementRequired, + this, &QETDiagramEditor::editElementInEditor); - // display error messages sent by the project view - connect(project_view, SIGNAL(errorEncountered(QString)), this, SLOT(showError(const QString &))); + // display error messages sent by the project view + connect(project_view, SIGNAL(errorEncountered(QString)), + this, SLOT(showError(const QString &))); //We maximise the new window if the current window is inexistent or maximized QWidget *current_window = m_workspace.activeSubWindow(); - bool maximise = ((!current_window) || (current_window -> windowState() & Qt::WindowMaximized)); + bool maximise = ((!current_window) + || (current_window -> windowState() + & Qt::WindowMaximized)); //Add the new window QMdiSubWindow *sub_window = m_workspace.addSubWindow(project_view); @@ -2129,8 +2162,15 @@ void QETDiagramEditor::removeDiagramFromProject() */ void QETDiagramEditor::diagramWasAdded(DiagramView *dv) { - connect(dv->diagram(), &QGraphicsScene::selectionChanged, this, &QETDiagramEditor::selectionChanged, Qt::DirectConnection); - connect(dv, SIGNAL(modeChanged()), this, SLOT(slot_updateModeActions())); + connect(dv->diagram(), + &QGraphicsScene::selectionChanged, + this, + &QETDiagramEditor::selectionChanged, + Qt::DirectConnection); + connect(dv, + SIGNAL(modeChanged()), + this, + SLOT(slot_updateModeActions())); } /** @@ -2148,7 +2188,8 @@ void QETDiagramEditor::findElementInPanel(const ElementsLocation &location) @param location Emplacement de l'element a editer */ void QETDiagramEditor::editElementInEditor(const ElementsLocation &location) { - QETApp::instance() -> openElementLocations(QList() << location); + QETApp::instance() -> openElementLocations(QList() + << location); } /** diff --git a/sources/qetgraphicsitem/ViewItem/qetgraphicstableitem.cpp b/sources/qetgraphicsitem/ViewItem/qetgraphicstableitem.cpp index dbed22bd1..fec02a9ff 100644 --- a/sources/qetgraphicsitem/ViewItem/qetgraphicstableitem.cpp +++ b/sources/qetgraphicsitem/ViewItem/qetgraphicstableitem.cpp @@ -39,7 +39,8 @@ static int no_model_width = 40; @param table : table to adjust @param margins : margins between table and folio. */ -void QetGraphicsTableItem::adjustTableToFolio(QetGraphicsTableItem *table, QMargins margins) +void QetGraphicsTableItem::adjustTableToFolio(QetGraphicsTableItem *table, + QMargins margins) { if (!table->diagram()) { return; @@ -68,7 +69,8 @@ void QetGraphicsTableItem::adjustTableToFolio(QetGraphicsTableItem *table, QMarg if not open a dialog to advise user what to do. @param table */ -void QetGraphicsTableItem::checkInsufficientRowsCount(QetGraphicsTableItem *table) +void QetGraphicsTableItem::checkInsufficientRowsCount( + QetGraphicsTableItem *table) { if (!table->diagram() || !table->model()) { return; diff --git a/sources/qetproject.cpp b/sources/qetproject.cpp index 283943022..62599da48 100644 --- a/sources/qetproject.cpp +++ b/sources/qetproject.cpp @@ -794,7 +794,9 @@ void QETProject::autoFolioNumberingNewFolios(){ @param autonum : used, index from selected tabs "from" and "to" rename folios with selected autonum */ -void QETProject::autoFolioNumberingSelectedFolios(int from, int to, const QString& autonum){ +void QETProject::autoFolioNumberingSelectedFolios(int from, + int to, + const QString& autonum){ int total_folio = m_diagrams_list.count(); DiagramContext project_wide_properties = m_project_properties; for (int i=from; i<=to; i++) { @@ -802,8 +804,13 @@ void QETProject::autoFolioNumberingSelectedFolios(int from, int to, const QStrin NumerotationContext nC = folioAutoNum(autonum); NumerotationContextCommands nCC = NumerotationContextCommands(nC); m_diagrams_list[i] -> border_and_titleblock.setFolio("%autonum"); - m_diagrams_list[i] -> border_and_titleblock.setFolioData(i + 1, total_folio, nCC.toRepresentedString(), project_wide_properties); - m_diagrams_list[i] -> project() -> addFolioAutoNum(autonum,nCC.next()); + m_diagrams_list[i] -> border_and_titleblock.setFolioData( + i + 1, + total_folio, + nCC.toRepresentedString(), + project_wide_properties); + m_diagrams_list[i] -> project() -> addFolioAutoNum( + autonum,nCC.next()); m_diagrams_list[i] -> update(); } }