correct more indentations / whitespace

This commit is contained in:
plc-user
2024-04-24 18:02:00 +02:00
parent fa68d545d0
commit 0d44933432
17 changed files with 168 additions and 168 deletions

View File

@@ -23,7 +23,7 @@
#include <QDialog> #include <QDialog>
namespace Ui { namespace Ui {
class RenameDialog; class RenameDialog;
} }
class RenameDialog : public QDialog class RenameDialog : public QDialog

View File

@@ -124,7 +124,7 @@ void ReplaceConductorDialog::setProperties(const ConductorProperties &properties
ui->m_pen_cb ->setChecked (m_properties.singleLineProperties.isPen()); ui->m_pen_cb ->setChecked (m_properties.singleLineProperties.isPen());
ui->m_phase_cb ->setChecked (m_properties.singleLineProperties.phasesCount()); ui->m_phase_cb ->setChecked (m_properties.singleLineProperties.phasesCount());
ui->m_phase_slider->setValue (m_properties.singleLineProperties.phasesCount()); ui->m_phase_slider->setValue (m_properties.singleLineProperties.phasesCount());
updatePreview(false); updatePreview(false);
} }
@@ -252,7 +252,7 @@ void ReplaceConductorDialog::setColorButton2(const QColor &color)
void ReplaceConductorDialog::on_m_erase_formula_cb_clicked() void ReplaceConductorDialog::on_m_erase_formula_cb_clicked()
{ {
ui->m_formula_le->setText(ui->m_erase_formula_cb->isChecked() ui->m_formula_le->setText(ui->m_erase_formula_cb->isChecked()
? SearchAndReplaceWorker::eraseText() ? SearchAndReplaceWorker::eraseText()
: QString()); : QString());
ui->m_formula_le->setDisabled(ui->m_erase_formula_cb->isChecked()); ui->m_formula_le->setDisabled(ui->m_erase_formula_cb->isChecked());

View File

@@ -34,7 +34,7 @@ EllipseEditor::EllipseEditor(QETElementEditor *editor, PartEllipse *part, QWidge
ui(new Ui::EllipseEditor), ui(new Ui::EllipseEditor),
m_part(part) m_part(part)
{ {
ui->setupUi(this); ui->setupUi(this);
m_style = new StyleEditor(editor); m_style = new StyleEditor(editor);
ui->m_main_layout->insertWidget(0, m_style); ui->m_main_layout->insertWidget(0, m_style);
updateForm(); updateForm();

View File

@@ -33,7 +33,7 @@ class StyleEditor;
*/ */
class EllipseEditor : public ElementItemEditor class EllipseEditor : public ElementItemEditor
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit EllipseEditor (QETElementEditor *editor, PartEllipse *part = nullptr, QWidget *parent = nullptr); explicit EllipseEditor (QETElementEditor *editor, PartEllipse *part = nullptr, QWidget *parent = nullptr);

View File

@@ -21,7 +21,7 @@
#include "../elementitemeditor.h" #include "../elementitemeditor.h"
namespace Ui { namespace Ui {
class LineEditor; class LineEditor;
} }
class PartLine; class PartLine;
@@ -33,11 +33,11 @@ class StyleEditor;
*/ */
class LineEditor : public ElementItemEditor class LineEditor : public ElementItemEditor
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit LineEditor(QETElementEditor *editor, PartLine *part = nullptr, QWidget *parent = nullptr); explicit LineEditor(QETElementEditor *editor, PartLine *part = nullptr, QWidget *parent = nullptr);
~LineEditor() override; ~LineEditor() override;
bool setPart(CustomElementPart *part) override; bool setPart(CustomElementPart *part) override;
bool setParts(QList <CustomElementPart *> parts) override; bool setParts(QList <CustomElementPart *> parts) override;

View File

@@ -106,7 +106,7 @@ void QETElementEditor::contextMenu(QPoint p, QList<QAction *> actions)
menu.addAction(ui->m_delete_action); menu.addAction(ui->m_delete_action);
menu.addAction(ui->m_cut_action); menu.addAction(ui->m_cut_action);
menu.addAction(ui->m_copy_action); menu.addAction(ui->m_copy_action);
menu.addAction((ui->m_rotate_action)); menu.addAction((ui->m_rotate_action));
menu.addSeparator(); menu.addSeparator();
menu.addAction(ui->m_paste_action); menu.addAction(ui->m_paste_action);
menu.addAction(ui->m_paste_in_area_action); menu.addAction(ui->m_paste_in_area_action);
@@ -1026,10 +1026,10 @@ void QETElementEditor::setupActions()
depth_toolbar -> addActions(m_depth_action_group -> actions()); depth_toolbar -> addActions(m_depth_action_group -> actions());
addToolBar(Qt::TopToolBarArea, depth_toolbar); addToolBar(Qt::TopToolBarArea, depth_toolbar);
//Rotate action //Rotate action
connect(ui->m_rotate_action, &QAction::triggered, [this]() {this -> elementScene() -> undoStack().push(new RotateElementsCommand(this->elementScene()));}); connect(ui->m_rotate_action, &QAction::triggered, [this]() {this -> elementScene() -> undoStack().push(new RotateElementsCommand(this->elementScene()));});
//Zoom action //Zoom action
ui->m_zoom_in_action -> setShortcut(QKeySequence::ZoomIn); ui->m_zoom_in_action -> setShortcut(QKeySequence::ZoomIn);
ui->m_zoom_out_action -> setShortcut(QKeySequence::ZoomOut); ui->m_zoom_out_action -> setShortcut(QKeySequence::ZoomOut);
ui->m_zoom_fit_best_action -> setShortcut(QKeySequence(tr("Ctrl+9"))); ui->m_zoom_fit_best_action -> setShortcut(QKeySequence(tr("Ctrl+9")));

View File

@@ -1,19 +1,19 @@
/* /*
Copyright 2006-2024 The QElectroTech Team Copyright 2006-2024 The QElectroTech Team
This file is part of QElectroTech. This file is part of QElectroTech.
QElectroTech is free software: you can redistribute it and/or modify QElectroTech is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or the Free Software Foundation, either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
QElectroTech is distributed in the hope that it will be useful, QElectroTech is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>. along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "terminaleditor.h" #include "terminaleditor.h"
#include "ui_terminaleditor.h" #include "ui_terminaleditor.h"
@@ -114,9 +114,9 @@ CustomElementPart *TerminalEditor::currentPart() const
*/ */
void TerminalEditor::init() void TerminalEditor::init()
{ {
ui->m_orientation_cb->addItem(QET::Icons::North, tr("Nord"), Qet::North); ui->m_orientation_cb->addItem(QET::Icons::North, tr("Nord"), Qet::North);
ui->m_orientation_cb->addItem(QET::Icons::East, tr("Est"), Qet::East); ui->m_orientation_cb->addItem(QET::Icons::East, tr("Est"), Qet::East);
ui->m_orientation_cb->addItem(QET::Icons::South, tr("Sud"), Qet::South); ui->m_orientation_cb->addItem(QET::Icons::South, tr("Sud"), Qet::South);
ui->m_orientation_cb->addItem(QET::Icons::West, tr("Ouest"), Qet::West); ui->m_orientation_cb->addItem(QET::Icons::West, tr("Ouest"), Qet::West);
ui->m_type_cb->addItem(tr("Générique"), TerminalData::Generic); ui->m_type_cb->addItem(tr("Générique"), TerminalData::Generic);

View File

@@ -1,19 +1,19 @@
/* /*
Copyright 2006-2024 The QElectroTech Team Copyright 2006-2024 The QElectroTech Team
This file is part of QElectroTech. This file is part of QElectroTech.
QElectroTech is free software: you can redistribute it and/or modify QElectroTech is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or the Free Software Foundation, either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
QElectroTech is distributed in the hope that it will be useful, QElectroTech is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>. along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef TERMINALEDITOR_H #ifndef TERMINALEDITOR_H
#define TERMINALEDITOR_H #define TERMINALEDITOR_H
@@ -33,18 +33,18 @@ class PartTerminal;
*/ */
class TerminalEditor : public ElementItemEditor class TerminalEditor : public ElementItemEditor
{ {
Q_OBJECT Q_OBJECT
public: public:
TerminalEditor(QETElementEditor *editor, QWidget *parent = nullptr); TerminalEditor(QETElementEditor *editor, QWidget *parent = nullptr);
~TerminalEditor() override; ~TerminalEditor() override;
void updateForm() override; void updateForm() override;
bool setPart(CustomElementPart *new_part) override; bool setPart(CustomElementPart *new_part) override;
CustomElementPart *currentPart() const override; CustomElementPart *currentPart() const override;
QList<CustomElementPart *> currentParts() const override {return QList<CustomElementPart *>();} QList<CustomElementPart *> currentParts() const override {return QList<CustomElementPart *>();}
private: private:
void init(); void init();
void posEdited(); void posEdited();
void orientationEdited(); void orientationEdited();
@@ -53,8 +53,8 @@ class TerminalEditor : public ElementItemEditor
void activeConnections(bool active); void activeConnections(bool active);
void activeChangeConnections(bool active); void activeChangeConnections(bool active);
private: private:
Ui::TerminalEditor *ui; Ui::TerminalEditor *ui;
QVector<QMetaObject::Connection> m_editor_connections, QVector<QMetaObject::Connection> m_editor_connections,
m_change_connections; m_change_connections;
PartTerminal *m_part = nullptr; PartTerminal *m_part = nullptr;

View File

@@ -295,83 +295,83 @@ void TextEditor::setUpWidget(QWidget *parent)
setWindowTitle(tr("Form")); setWindowTitle(tr("Form"));
resize(378, 133); resize(378, 133);
QGridLayout *gridLayout = new QGridLayout(parent); QGridLayout *gridLayout = new QGridLayout(parent);
gridLayout->setObjectName(QString::fromUtf8("gridLayout")); gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
m_y_sb = new QSpinBox(parent); m_y_sb = new QSpinBox(parent);
m_y_sb->setObjectName(QString::fromUtf8("m_y_sb")); m_y_sb->setObjectName(QString::fromUtf8("m_y_sb"));
m_y_sb->setMinimum(-10000); m_y_sb->setMinimum(-10000);
m_y_sb->setMaximum(10000); m_y_sb->setMaximum(10000);
gridLayout->addWidget(m_y_sb, 1, 3, 1, 1); gridLayout->addWidget(m_y_sb, 1, 3, 1, 1);
QLabel*label_2 = new QLabel(tr("Y :"),parent); QLabel*label_2 = new QLabel(tr("Y :"),parent);
gridLayout->addWidget(label_2, 1, 2, 1, 1); gridLayout->addWidget(label_2, 1, 2, 1, 1);
QLabel*label_4 = new QLabel(tr("Police :"),parent); QLabel*label_4 = new QLabel(tr("Police :"),parent);
gridLayout->addWidget(label_4, 2, 0, 1, 1); gridLayout->addWidget(label_4, 2, 0, 1, 1);
m_rotation_sb = new QSpinBox(parent); m_rotation_sb = new QSpinBox(parent);
m_rotation_sb->setSuffix(tr("\302\260")); m_rotation_sb->setSuffix(tr("\302\260"));
m_rotation_sb->setWrapping(true); m_rotation_sb->setWrapping(true);
m_rotation_sb->setMaximum(360); m_rotation_sb->setMaximum(360);
gridLayout->addWidget(m_rotation_sb, 1, 5, 1, 1); gridLayout->addWidget(m_rotation_sb, 1, 5, 1, 1);
QLabel *label_3 = new QLabel(tr("Rotation :"),parent); QLabel *label_3 = new QLabel(tr("Rotation :"),parent);
gridLayout->addWidget(label_3, 1, 4, 1, 1); gridLayout->addWidget(label_3, 1, 4, 1, 1);
m_x_sb = new QSpinBox(parent); m_x_sb = new QSpinBox(parent);
m_x_sb->setObjectName(QString::fromUtf8("m_x_sb")); m_x_sb->setObjectName(QString::fromUtf8("m_x_sb"));
m_x_sb->setMinimum(-10000); m_x_sb->setMinimum(-10000);
m_x_sb->setMaximum(10000); m_x_sb->setMaximum(10000);
gridLayout->addWidget(m_x_sb, 1, 1, 1, 1); gridLayout->addWidget(m_x_sb, 1, 1, 1, 1);
QLabel *label = new QLabel(tr("X :"),parent); QLabel *label = new QLabel(tr("X :"),parent);
gridLayout->addWidget(label, 1, 0, 1, 1); gridLayout->addWidget(label, 1, 0, 1, 1);
m_size_sb = new QSpinBox(parent); m_size_sb = new QSpinBox(parent);
m_size_sb->setObjectName(QString::fromUtf8("m_size_sb")); m_size_sb->setObjectName(QString::fromUtf8("m_size_sb"));
gridLayout->addWidget(m_size_sb, 2, 1, 1, 1); gridLayout->addWidget(m_size_sb, 2, 1, 1, 1);
m_line_edit = new QLineEdit(parent); m_line_edit = new QLineEdit(parent);
m_line_edit->setObjectName(QString::fromUtf8("m_line_edit")); m_line_edit->setObjectName(QString::fromUtf8("m_line_edit"));
m_line_edit->setClearButtonEnabled(true); m_line_edit->setClearButtonEnabled(true);
m_line_edit->setPlaceholderText(tr("Entrer votre texte ici")); m_line_edit->setPlaceholderText(tr("Entrer votre texte ici"));
gridLayout->addWidget(m_line_edit, 0, 0, 1, 6); gridLayout->addWidget(m_line_edit, 0, 0, 1, 6);
#ifdef BUILD_WITHOUT_KF5 #ifdef BUILD_WITHOUT_KF5
#else #else
m_color_pb = new KColorButton(parent); m_color_pb = new KColorButton(parent);
m_color_pb->setObjectName(QString::fromUtf8("m_color_pb")); m_color_pb->setObjectName(QString::fromUtf8("m_color_pb"));
connect( connect(
m_color_pb, m_color_pb,
&KColorButton::changed, &KColorButton::changed,
this, this,
&TextEditor::on_m_color_pb_changed); &TextEditor::on_m_color_pb_changed);
gridLayout->addWidget(m_color_pb, 2, 5, 1, 1); gridLayout->addWidget(m_color_pb, 2, 5, 1, 1);
#endif #endif
QLabel *label_5 = new QLabel(parent); QLabel *label_5 = new QLabel(parent);
label_5->setObjectName(QString::fromUtf8("label_5")); label_5->setObjectName(QString::fromUtf8("label_5"));
gridLayout->addWidget(label_5, 2, 4, 1, 1); gridLayout->addWidget(label_5, 2, 4, 1, 1);
m_font_pb = new QPushButton(tr("Couleur :"),parent); m_font_pb = new QPushButton(tr("Couleur :"),parent);
connect(m_font_pb, connect(m_font_pb,
&QPushButton::pressed, &QPushButton::pressed,
this, this,
&TextEditor::on_m_font_pb_clicked); &TextEditor::on_m_font_pb_clicked);
gridLayout->addWidget(m_font_pb, 2, 2, 1, 2); gridLayout->addWidget(m_font_pb, 2, 2, 1, 2);
QSpacerItem *verticalSpacer = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding); QSpacerItem *verticalSpacer = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);
gridLayout->addItem(verticalSpacer, 3, 2, 1, 1); gridLayout->addItem(verticalSpacer, 3, 2, 1, 1);
setLayout(gridLayout); setLayout(gridLayout);
} }

View File

@@ -64,17 +64,17 @@ void AboutQETDialog::setAbout()
tr(" Les développeurs de QElectroTech", "about tab, developers line") + tr(" Les développeurs de QElectroTech", "about tab, developers line") +
"<br><br>" "<br><br>"
"<a href=\"https://qelectrotech.org/\">https://qelectrotech.org/</a>" "<a href=\"https://qelectrotech.org/\">https://qelectrotech.org/</a>"
"<br><br>" + "<br><br>" +
"The program is provided AS IS with NO WARRANTY OF ANY KIND," "The program is provided AS IS with NO WARRANTY OF ANY KIND,"
"<br>" "<br>"
" INCLUDING THE WARRANTY OF DESIGN, " " INCLUDING THE WARRANTY OF DESIGN, "
"<br>" "<br>"
"MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE."; "MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.";
"<br>" "<br>"
"<br><br>" + "<br><br>" +
tr("Contact : <a href=\"mailto:qet@lists.tuxfamily.org\">qet@lists.tuxfamily.org</a>", "about tab, contact line"); tr("Contact : <a href=\"mailto:qet@lists.tuxfamily.org\">qet@lists.tuxfamily.org</a>", "about tab, contact line");
ui->m_about_label->setText(str); ui->m_about_label->setText(str);
} }
@@ -91,7 +91,7 @@ void AboutQETDialog::setAuthors()
addAuthor(ui->m_author_label, "Ronny Desmedt", "r.desmedt@live.be", tr("Convertisseur DXF")); addAuthor(ui->m_author_label, "Ronny Desmedt", "r.desmedt@live.be", tr("Convertisseur DXF"));
addAuthor(ui->m_author_label, "Raul Roda", "raulroda8@gmail.com", tr("Plugin Bornier")); addAuthor(ui->m_author_label, "Raul Roda", "raulroda8@gmail.com", tr("Plugin Bornier"));
addAuthor(ui->m_author_label, "Abhishek Bansal", "abhishek@qelectrotech.org", tr("Développement")); addAuthor(ui->m_author_label, "Abhishek Bansal", "abhishek@qelectrotech.org", tr("Développement"));
addAuthor(ui->m_author_label, "Simon De Backer", "debacker@qelectrotech.org", tr("Développement")); addAuthor(ui->m_author_label, "Simon De Backer", "debacker@qelectrotech.org", tr("Développement"));
addAuthor(ui->m_author_label, "David Varley", "David.Varley@cborn.com", tr("Développement")); addAuthor(ui->m_author_label, "David Varley", "David.Varley@cborn.com", tr("Développement"));
addAuthor(ui->m_author_label, "Damian Caceres", "damiancaceresmoreno@yahoo.es", tr("Développement")); addAuthor(ui->m_author_label, "Damian Caceres", "damiancaceresmoreno@yahoo.es", tr("Développement"));
addAuthor(ui->m_author_label, "Martin Marmsoler", "martin.marmsoler@gmail.com", tr("Développement")); addAuthor(ui->m_author_label, "Martin Marmsoler", "martin.marmsoler@gmail.com", tr("Développement"));
@@ -166,7 +166,7 @@ void AboutQETDialog::setContributors()
void AboutQETDialog::setVersion() void AboutQETDialog::setVersion()
{ {
QString str = "<span style=\"font-weight:bold;font-size:16pt;\">QElectroTech V " QString str = "<span style=\"font-weight:bold;font-size:16pt;\">QElectroTech V "
+ QetVersion::displayedVersion() + QetVersion::displayedVersion()
+ "</span>"; + "</span>";
ui->m_version_label->setText(str + MachineInfo::instance()->compilation_info()); ui->m_version_label->setText(str + MachineInfo::instance()->compilation_info());
} }

View File

@@ -122,12 +122,12 @@ GeneralConfigurationPage::GeneralConfigurationPage(QWidget *parent) :
ui->m_highlight_integrated_elements->setChecked(settings.value("diagrameditor/highlight-integrated-elements", true).toBool()); ui->m_highlight_integrated_elements->setChecked(settings.value("diagrameditor/highlight-integrated-elements", true).toBool());
ui->m_default_elements_info->setPlainText(settings.value("elementeditor/default-informations", "").toString()); ui->m_default_elements_info->setPlainText(settings.value("elementeditor/default-informations", "").toString());
/* /*
Nombre maximum de primitives affichees par la "liste des parties" Nombre maximum de primitives affichees par la "liste des parties"
Au-dela, un petit message est affiche, indiquant que ce nombre a ete depasse Au-dela, un petit message est affiche, indiquant que ce nombre a ete depasse
et que la liste ne sera donc pas mise a jour. et que la liste ne sera donc pas mise a jour.
*/ */
ui->MaxPartsElementEditorList_sb->setValue(settings.value("elementeditor/max-parts-element-editor-list", 200).toInt()); ui->MaxPartsElementEditorList_sb->setValue(settings.value("elementeditor/max-parts-element-editor-list", 200).toInt());
QString path = settings.value("elements-collections/common-collection-path", "default").toString(); QString path = settings.value("elements-collections/common-collection-path", "default").toString();
if (path != "default") if (path != "default")
@@ -209,7 +209,7 @@ void GeneralConfigurationPage::applyConf()
//ELEMENT EDITOR //ELEMENT EDITOR
settings.setValue("elementeditor/default-informations", ui->m_default_elements_info->toPlainText()); settings.setValue("elementeditor/default-informations", ui->m_default_elements_info->toPlainText());
settings.setValue("elementeditor/max-parts-element-editor-list", ui->MaxPartsElementEditorList_sb->value()); settings.setValue("elementeditor/max-parts-element-editor-list", ui->MaxPartsElementEditorList_sb->value());
//DIAGRAM VIEW //DIAGRAM VIEW
settings.setValue("diagramview/gestures", ui->m_use_gesture_trackpad->isChecked()); settings.setValue("diagramview/gestures", ui->m_use_gesture_trackpad->isChecked());
@@ -223,7 +223,7 @@ void GeneralConfigurationPage::applyConf()
//NOMENCLATURE //NOMENCLATURE
settings.setValue("nomenclature/terminal-exportlist",ui->m_export_terminal->isChecked()); settings.setValue("nomenclature/terminal-exportlist",ui->m_export_terminal->isChecked());
//DIAGRAM EDITOR //DIAGRAM EDITOR
QString view_mode = ui->m_use_tab_mode_rb->isChecked() ? "tabbed" : "windowed"; QString view_mode = ui->m_use_tab_mode_rb->isChecked() ? "tabbed" : "windowed";
settings.setValue("diagrameditor/viewmode", view_mode) ; settings.setValue("diagrameditor/viewmode", view_mode) ;
@@ -520,11 +520,11 @@ void GeneralConfigurationPage::on_m_indi_text_font_pb_clicked()
void GeneralConfigurationPage::on_MaxPartsElementEditorList_sb_valueChanged(int value) void GeneralConfigurationPage::on_MaxPartsElementEditorList_sb_valueChanged(int value)
{ {
if (value > 500) { if (value > 500) {
ui->MaxPartsElementEditorList_sb->setToolTip(tr("To high values might lead to crashes of the application.")); ui->MaxPartsElementEditorList_sb->setToolTip(tr("To high values might lead to crashes of the application."));
ui->MaxPartsElementEditorList_sb->setStyleSheet("background-color: orange"); ui->MaxPartsElementEditorList_sb->setStyleSheet("background-color: orange");
} else { } else {
ui->MaxPartsElementEditorList_sb->setToolTip(""); ui->MaxPartsElementEditorList_sb->setToolTip("");
ui->MaxPartsElementEditorList_sb->setStyleSheet(""); ui->MaxPartsElementEditorList_sb->setStyleSheet("");
} }
} }

View File

@@ -1,4 +1,4 @@
/* /*
Copyright 2006-2024 The QElectroTech Team Copyright 2006-2024 The QElectroTech Team
This file is part of QElectroTech. This file is part of QElectroTech.
@@ -47,7 +47,7 @@ class GeneralConfigurationPage : public ConfigPage
void on_m_company_tbt_path_cb_currentIndexChanged(int index); void on_m_company_tbt_path_cb_currentIndexChanged(int index);
void on_m_custom_tbt_path_cb_currentIndexChanged(int index); void on_m_custom_tbt_path_cb_currentIndexChanged(int index);
void on_m_indi_text_font_pb_clicked(); void on_m_indi_text_font_pb_clicked();
void on_MaxPartsElementEditorList_sb_valueChanged(int value); void on_MaxPartsElementEditorList_sb_valueChanged(int value);
private: private:
void fillLang(); void fillLang();

View File

@@ -296,7 +296,7 @@ void LinkSingleElementWidget::buildTree()
QStringList search_list; QStringList search_list;
QStringList str_list; QStringList str_list;
if (!elmt->conductors().isEmpty()) if (!elmt->conductors().isEmpty())
{ {
ConductorProperties cp = elmt->conductors().first()->properties(); ConductorProperties cp = elmt->conductors().first()->properties();
str_list << cp.text; str_list << cp.text;
@@ -316,7 +316,7 @@ void LinkSingleElementWidget::buildTree()
search_list << str_list.last(); search_list << str_list.last();
} }
else else
str_list << "" << "" << "" << "" << ""; str_list << "" << "" << "" << "" << "";
if (Diagram *diag = elmt->diagram()) if (Diagram *diag = elmt->diagram())
{ {

View File

@@ -36,13 +36,13 @@ ProjectPropertiesDialog::ProjectPropertiesDialog(QETProject *project, QWidget *p
m_properties_dialog -> setWindowTitle(QObject::tr("Propriétés du projet", "window title")); m_properties_dialog -> setWindowTitle(QObject::tr("Propriétés du projet", "window title"));
m_properties_dialog -> addPage(new ProjectMainConfigPage(project)); m_properties_dialog -> addPage(new ProjectMainConfigPage(project));
NewDiagramPage *newDiagramPage = new NewDiagramPage(project,parent,this); NewDiagramPage *newDiagramPage = new NewDiagramPage(project,parent,this);
m_properties_dialog -> addPage(newDiagramPage); m_properties_dialog -> addPage(newDiagramPage);
ProjectAutoNumConfigPage *projectAutoNumConfigPage = new ProjectAutoNumConfigPage (project); ProjectAutoNumConfigPage *projectAutoNumConfigPage = new ProjectAutoNumConfigPage (project);
m_properties_dialog -> addPage(projectAutoNumConfigPage); m_properties_dialog -> addPage(projectAutoNumConfigPage);
m_properties_dialog->addPage(new TerminalStripProjectConfigPage { project, parent }); m_properties_dialog->addPage(new TerminalStripProjectConfigPage { project, parent });
connect(projectAutoNumConfigPage,SIGNAL(setAutoNum(QString)),newDiagramPage,SLOT(setFolioAutonum(QString))); connect(projectAutoNumConfigPage,SIGNAL(setAutoNum(QString)),newDiagramPage,SLOT(setFolioAutonum(QString)));
connect(projectAutoNumConfigPage,SIGNAL(saveCurrentTbp()),newDiagramPage,SLOT(saveCurrentTbp())); connect(projectAutoNumConfigPage,SIGNAL(saveCurrentTbp()),newDiagramPage,SLOT(saveCurrentTbp()));

View File

@@ -32,8 +32,8 @@ class ProjectPropertiesDialog : public QObject {
enum Page { enum Page {
Main = 0, Main = 0,
Diagram = 1, Diagram = 1,
Autonum = 2, Autonum = 2,
TerminalStrip = 3 TerminalStrip = 3
}; };
ProjectPropertiesDialog(QETProject *project, QWidget *parent = nullptr); ProjectPropertiesDialog(QETProject *project, QWidget *parent = nullptr);

View File

@@ -64,8 +64,8 @@ ShapeGraphicsItemPropertiesWidget::~ShapeGraphicsItemPropertiesWidget()
*/ */
void ShapeGraphicsItemPropertiesWidget::setItem(QetShapeItem *shape) void ShapeGraphicsItemPropertiesWidget::setItem(QetShapeItem *shape)
{ {
if (m_shape != shape) { if (m_shape != shape) {
clearEditConnection(); clearEditConnection();
} }
if (!shape) { if (!shape) {
return; return;
@@ -75,7 +75,7 @@ void ShapeGraphicsItemPropertiesWidget::setItem(QetShapeItem *shape)
ui->m_close_polygon->setVisible(m_shape->shapeType() == QetShapeItem::Polygon); ui->m_close_polygon->setVisible(m_shape->shapeType() == QetShapeItem::Polygon);
ui->m_filling_gb->setHidden(m_shape->shapeType() == QetShapeItem::Line); ui->m_filling_gb->setHidden(m_shape->shapeType() == QetShapeItem::Line);
updateUi(); updateUi();
setUpEditConnection(); setUpEditConnection();
} }
@@ -86,11 +86,11 @@ void ShapeGraphicsItemPropertiesWidget::setItem(QetShapeItem *shape)
*/ */
void ShapeGraphicsItemPropertiesWidget::setItems(QList<QetShapeItem *> shapes_list) void ShapeGraphicsItemPropertiesWidget::setItems(QList<QetShapeItem *> shapes_list)
{ {
clearEditConnection(); clearEditConnection();
m_shapes_list.clear(); m_shapes_list.clear();
m_shape = nullptr; m_shape = nullptr;
if (shapes_list.isEmpty()) { if (shapes_list.isEmpty()) {
updateUi(); updateUi();
} }
else if (shapes_list.size() == 1) else if (shapes_list.size() == 1)
@@ -357,7 +357,7 @@ void ShapeGraphicsItemPropertiesWidget::updateUi()
//Disconnect every connections of editor widgets //Disconnect every connections of editor widgets
//to avoid an unwanted edition (QSpinBox emit valueChanged no matter if changer by user or by program) //to avoid an unwanted edition (QSpinBox emit valueChanged no matter if changer by user or by program)
clearEditConnection(); clearEditConnection();
if (m_shape) if (m_shape)
{ {
@@ -455,8 +455,8 @@ bool ShapeGraphicsItemPropertiesWidget::setLiveEdit(bool live_edit)
if (m_live_edit) { if (m_live_edit) {
setUpEditConnection(); setUpEditConnection();
} else { } else {
clearEditConnection(); clearEditConnection();
} }
return true; return true;
} }
@@ -468,46 +468,46 @@ bool ShapeGraphicsItemPropertiesWidget::setLiveEdit(bool live_edit)
*/ */
void ShapeGraphicsItemPropertiesWidget::setUpEditConnection() void ShapeGraphicsItemPropertiesWidget::setUpEditConnection()
{ {
clearEditConnection(); clearEditConnection();
if (m_shape || !m_shapes_list.isEmpty()) if (m_shape || !m_shapes_list.isEmpty())
{ {
m_edit_connection << connect (ui->m_style_cb, QOverload<int>::of(&QComboBox::activated), m_edit_connection << connect (ui->m_style_cb, QOverload<int>::of(&QComboBox::activated),
this, &ShapeGraphicsItemPropertiesWidget::apply); this, &ShapeGraphicsItemPropertiesWidget::apply);
m_edit_connection << connect (ui->m_size_dsb, QOverload<double>::of(&QDoubleSpinBox::valueChanged), m_edit_connection << connect (ui->m_size_dsb, QOverload<double>::of(&QDoubleSpinBox::valueChanged),
this, &ShapeGraphicsItemPropertiesWidget::apply); this, &ShapeGraphicsItemPropertiesWidget::apply);
m_edit_connection << connect (ui->m_color_kpb, &KColorButton::changed, m_edit_connection << connect (ui->m_color_kpb, &KColorButton::changed,
this, &ShapeGraphicsItemPropertiesWidget::apply); this, &ShapeGraphicsItemPropertiesWidget::apply);
m_edit_connection << connect (ui->m_brush_style_cb, QOverload<int>::of(&QComboBox::activated), m_edit_connection << connect (ui->m_brush_style_cb, QOverload<int>::of(&QComboBox::activated),
this, &ShapeGraphicsItemPropertiesWidget::apply); this, &ShapeGraphicsItemPropertiesWidget::apply);
m_edit_connection << connect (ui->m_brush_color_kpb, &KColorButton::changed, m_edit_connection << connect (ui->m_brush_color_kpb, &KColorButton::changed,
this, &ShapeGraphicsItemPropertiesWidget::apply); this, &ShapeGraphicsItemPropertiesWidget::apply);
m_edit_connection << connect (ui->m_close_polygon, &QCheckBox::clicked, m_edit_connection << connect (ui->m_close_polygon, &QCheckBox::clicked,
this, &ShapeGraphicsItemPropertiesWidget::apply); this, &ShapeGraphicsItemPropertiesWidget::apply);
m_edit_connection << connect (m_shape, &QetShapeItem::penChanged, m_edit_connection << connect (m_shape, &QetShapeItem::penChanged,
this, &ShapeGraphicsItemPropertiesWidget::updateUi); this, &ShapeGraphicsItemPropertiesWidget::updateUi);
m_edit_connection << connect (m_shape, &QetShapeItem::closeChanged, m_edit_connection << connect (m_shape, &QetShapeItem::closeChanged,
this, &ShapeGraphicsItemPropertiesWidget::updateUi); this, &ShapeGraphicsItemPropertiesWidget::updateUi);
m_edit_connection << connect (m_shape, &QetShapeItem::brushChanged, m_edit_connection << connect (m_shape, &QetShapeItem::brushChanged,
this, &ShapeGraphicsItemPropertiesWidget::updateUi); this, &ShapeGraphicsItemPropertiesWidget::updateUi);
} }
} }
void ShapeGraphicsItemPropertiesWidget::clearEditConnection() void ShapeGraphicsItemPropertiesWidget::clearEditConnection()
{ {
for (const auto &c : qAsConst(m_edit_connection)) { for (const auto &c : qAsConst(m_edit_connection)) {
disconnect(c); disconnect(c);
} }
m_edit_connection.clear(); m_edit_connection.clear();
} }
void ShapeGraphicsItemPropertiesWidget::on_m_lock_pos_cb_clicked() void ShapeGraphicsItemPropertiesWidget::on_m_lock_pos_cb_clicked()

View File

@@ -53,12 +53,12 @@ class ShapeGraphicsItemPropertiesWidget : public PropertiesEditorWidget
private: private:
void setUpEditConnection(); void setUpEditConnection();
void clearEditConnection(); void clearEditConnection();
private slots: private slots:
void on_m_lock_pos_cb_clicked(); void on_m_lock_pos_cb_clicked();
private: private:
Ui::ShapeGraphicsItemPropertiesWidget *ui; Ui::ShapeGraphicsItemPropertiesWidget *ui;
QetShapeItem *m_shape; QetShapeItem *m_shape;
QList <QPointer<QetShapeItem>> m_shapes_list; QList <QPointer<QetShapeItem>> m_shapes_list;