diff --git a/lang/qet_nl.qm b/lang/qet_nl.qm
index 79ce484c8..ab1ad824d 100644
Binary files a/lang/qet_nl.qm and b/lang/qet_nl.qm differ
diff --git a/lang/qet_nl.ts b/lang/qet_nl.ts
index 0859c5df7..19bda0584 100644
--- a/lang/qet_nl.ts
+++ b/lang/qet_nl.ts
@@ -51,7 +51,7 @@
log
-
+ Log
@@ -103,7 +103,7 @@
Collection
- Collectie
+ Collectie
@@ -607,7 +607,7 @@ Noot: Geen van deze opties bepalen het wel of niet automatisch nummeren, alleen
Dialog
-
+ Exporteren
@@ -617,12 +617,12 @@ Noot: Geen van deze opties bepalen het wel of niet automatisch nummeren, alleen
inclure les en-têtes
-
+ Inclusief kopteksten
Formater en tant que liste de materiel
-
+ Volgens materiaallijst
@@ -661,13 +661,13 @@ Noot: Geen van deze opties bepalen het wel of niet automatisch nummeren, alleen
Position du folio
- Plaats van het blad
+ Plaats van het blad
Quantité numéro d'article
Special field with name : designation quantity
-
+ Aantal itemnummer
@@ -3311,7 +3311,7 @@ Hier kunt u de standaardtekst hiervoor opgeven voor nieuwe elementen :
Japonais
-
+ Japans
@@ -3490,7 +3490,7 @@ Hier kunt u de standaardtekst hiervoor opgeven voor nieuwe elementen :
TextLabel
- Tekstlabel
+ Tekstlabel
@@ -3592,7 +3592,8 @@ Hier kunt u de standaardtekst hiervoor opgeven voor nieuwe elementen :
<center>ATTENTION :</center>
il manque %1 lignes afin d'afficher l'intégralité des informations
-
+ <center>ATTENTIE :</center>
+ er missen %1 regels om alle informatie weer te geven
@@ -4073,12 +4074,12 @@ Hiervoor gebruikt u de geavanceerde tekstbewerker.
Compilation :
- Compilatie:
+ Compilatie:
Compilation :
-
+ Compilatie :
@@ -4975,12 +4976,12 @@ Wilt u de wijzigingen opslaan?
Revenir au debut du projet
-
+ Ga terug naar het begin van het project
Aller à la fin du projet
-
+ Ga naar het einde van het project
@@ -5062,7 +5063,7 @@ Wilt u de wijzigingen opslaan?
LTR
Translate this string to RTL if you are translating to a Right-to-Left language, else translate to LTR
- LTR
+ LTR
@@ -5146,13 +5147,13 @@ Wilt u de wijzigingen opslaan?
Cartouches QET
title of the title block templates collection provided by QElectroTech
- QElectroTech titelbloksjablonen
+ QElectroTech titelbloksjablonen
Cartouches utilisateur
title of the user's title block templates collection
- Mijn titelbloksjablonen
+ Mijn titelbloksjablonen
@@ -8654,7 +8655,7 @@ Wilt u deze vervangen ?
To install the plugin qet_tb_generator<br>Visit :<br><a href='https://pypi.python.org/pypi/qet-tb-generator'>qet-tb-generator</a><br><br>Requires python 3.5 or above.<br><br><B><U> First install on Linux</B></U><br>1. check you have pip3 installed: pip3 --version<br>If not install with: sudo apt-get install python3-pip<br>2. Install the program: sudo pip3 install qet_tb_generator<br>3. Run the program: qet_tb_generator<br><br><B><U> Update on Linux</B></U><br>sudo pip3 install --upgrade qet_tb_generator<br>
-
+ Installatie van de qet_tb_generator<br>Ga naar:<br><a href='https://pypi.python.org/pypi/qet-tb-generator'>qet-tb-generator</a><br><br>Vereist Python 3.5 of hoger.<br><br><B><U> Eerste installatie onder Linux</B></U><br>1. Controleer of je pip3 geinstalleerd hebt: pip3 --version<br>Indien nodig installeer met: sudo apt get install python3-pip<br>2. Installeer het programma: sudo pip3 install qet_tb_generator<br>3 Voer het programma uit: qet_tb_generator<br><br><B><U> Updaten onder Linux</B></U><br>sudo pip3 install --upgrade qet_tb_generator<br>
@@ -8679,7 +8680,7 @@ Wilt u deze vervangen ?
Coller
-
+ Plakken
@@ -8703,18 +8704,20 @@ Wilt u deze vervangen ?
Les information à afficher sont supérieurs à la quantité maximal pouvant être affiché par les tableaux.
Veuillez ajouter un nouveau tableau ou regler les tableaux existant afin d'afficher l'integralité des informations.
-
+ Er is meer informatie dan in de tabellen kan worden weergegeven.
+Maak een nieuwe tabel of pas de huidige tabellen aan zodat alle informatie kan worden weergegeven.
Les information à afficher sont supérieurs à la quantité maximal pouvant être affiché par le tableau.
Veuillez ajouter un nouveau tableau ou regler le tableau existant afin d'afficher l'integralité des informations.
-
+ Er is meer informatie dan in de tabel kan worden weergegeven.
+Maak een nieuwe tabel of pas de huidige tabel aan zodat alle informatie kan worden weergegeven.
Limitation de tableau
-
+ Tabelgrenzen
@@ -12901,13 +12904,13 @@ Maximale afmeting : %2px
Unstable file format!
-
+ Instabiel bestandsformaat!
<p><b>ATTENTION: This application version is UNSTABLE!</b></p><p>Everything you do with this application can break your workspace, libraries or projects! Saved files will not be readable with stable releases of QElectroTech. It's highly recommended to create a backup before proceeding. If you are unsure, please download an official stable release instead.</p><p>Are you really sure to continue with the risk of breaking your files?!</p>
this text is not finished yet, expect changes!
-
+ <p><b>ATTENTIE: Deze programmaversie is NIET STABIEL!</></p><p>Door het gebruik van deze versie kun je je werkomgeving, bibliotheken of projecten beschadigen! Hiermee opgeslagen bestanden zijn niet leesbaar voor stabiele versies van QElectroTech. Het wordt met klem aangeraden backups te maken voor je verder gaat. Als je enigszins twijfelt, download dan een officiele stabiel versie </p><p>Weet je zeker dat je verder wilt gaan met het risico je bestanden te beschadigen?!</p>
diff --git a/sources/ElementsCollection/elementslocation.cpp b/sources/ElementsCollection/elementslocation.cpp
index 826398b8b..cd09896e4 100644
--- a/sources/ElementsCollection/elementslocation.cpp
+++ b/sources/ElementsCollection/elementslocation.cpp
@@ -53,7 +53,8 @@ ElementsLocation::ElementsLocation(const QString &path, QETProject *project) :
@brief ElementsLocation::~ElementsLocation
Destructeur
*/
-ElementsLocation::~ElementsLocation() {
+ElementsLocation::~ElementsLocation()
+{
}
/**
@@ -110,7 +111,8 @@ ElementsLocation &ElementsLocation::operator=(const ElementsLocation &other) {
\~French true si other et cet ElementsLocation sont identiques,
false sinon
*/
-bool ElementsLocation::operator==(const ElementsLocation &other) const {
+bool ElementsLocation::operator==(const ElementsLocation &other) const
+{
return(
m_collection_path == other.m_collection_path &&\
m_project == other.m_project
@@ -124,7 +126,8 @@ bool ElementsLocation::operator==(const ElementsLocation &other) const {
@return true si other et cet ElementsLocation sont differents,
false sinon
*/
-bool ElementsLocation::operator!=(const ElementsLocation &other) const {
+bool ElementsLocation::operator!=(const ElementsLocation &other) const
+{
return(
m_collection_path != other.m_collection_path ||\
m_project != other.m_project
@@ -139,7 +142,8 @@ bool ElementsLocation::operator!=(const ElementsLocation &other) const {
For exemple if this location represent an element they return myElement.
@see fileName()
*/
-QString ElementsLocation::baseName() const {
+QString ElementsLocation::baseName() const
+{
QRegExp regexp("^.*([^/]+)\\.elmt$");
if (regexp.exactMatch(m_collection_path)) {
return(regexp.capturedTexts().at(1));
@@ -203,7 +207,8 @@ QString ElementsLocation::fileSystemPath() const
@return The path of this location.
@deprecated use instead collectionPath(true)
*/
-QString ElementsLocation::path() const {
+QString ElementsLocation::path() const
+{
return(m_collection_path);
}
@@ -343,7 +348,8 @@ bool ElementsLocation::addToPath(const QString &string)
@return the location of the parent category, or a copy of this location
when it represents a root category.
*/
-ElementsLocation ElementsLocation::parent() const {
+ElementsLocation ElementsLocation::parent() const
+{
ElementsLocation copy(*this);
QRegExp re1("^([a-z]+://)(.*)/*$");
if (re1.exactMatch(m_collection_path)) {
@@ -362,7 +368,8 @@ ElementsLocation ElementsLocation::parent() const {
\~French
le projet de cet emplacement ou 0 si celui-ci n'est pas lie a un projet.
*/
-QETProject *ElementsLocation::project() const {
+QETProject *ElementsLocation::project() const
+{
return(m_project);
}
@@ -384,7 +391,8 @@ void ElementsLocation::setProject(QETProject *project) {
\~French
true si l'emplacement semble utilisable (chemin virtuel non vide).
*/
-bool ElementsLocation::isNull() const {
+bool ElementsLocation::isNull() const
+{
return(m_collection_path.isEmpty());
}
@@ -393,7 +401,8 @@ bool ElementsLocation::isNull() const {
@return A character string representing the location
\~French Une chaine de caracteres representant l'emplacement
*/
-QString ElementsLocation::toString() const {
+QString ElementsLocation::toString() const
+{
QString result;
if (m_project) {
int project_id = QETApp::projectId(m_project);
@@ -409,7 +418,8 @@ QString ElementsLocation::toString() const {
@brief ElementsLocation::isElement
@return true if this location represent an element
*/
-bool ElementsLocation::isElement() const {
+bool ElementsLocation::isElement() const
+{
return m_collection_path.endsWith(".elmt");
}
@@ -417,7 +427,8 @@ bool ElementsLocation::isElement() const {
@brief ElementsLocation::isDirectory
@return true if this location represent a directory
*/
-bool ElementsLocation::isDirectory() const {
+bool ElementsLocation::isDirectory() const
+{
return (!isElement() && !m_collection_path.isEmpty());
}
diff --git a/sources/ElementsCollection/xmlelementcollection.cpp b/sources/ElementsCollection/xmlelementcollection.cpp
index 9afbf2c1e..308194d7c 100644
--- a/sources/ElementsCollection/xmlelementcollection.cpp
+++ b/sources/ElementsCollection/xmlelementcollection.cpp
@@ -107,7 +107,8 @@ XmlElementCollection::XmlElementCollection(const QDomElement &dom_element,
of the dom element is : collection
@return The root QDomElement of the collection
*/
-QDomElement XmlElementCollection::root() const {
+QDomElement XmlElementCollection::root() const
+{
return m_dom_document.documentElement();
}
@@ -116,7 +117,8 @@ QDomElement XmlElementCollection::root() const {
@return The QDomElement import (the begining of a xml collection) or
a null QDomElement if doesn't exist.
*/
-QDomElement XmlElementCollection::importCategory() const {
+QDomElement XmlElementCollection::importCategory() const
+{
return root().firstChildElement("category");
}
diff --git a/sources/NameList/nameslist.cpp b/sources/NameList/nameslist.cpp
index 904ea4377..bd2bac29d 100644
--- a/sources/NameList/nameslist.cpp
+++ b/sources/NameList/nameslist.cpp
@@ -24,13 +24,15 @@ int NamesList::MetaTypeId = qRegisterMetaType("NamesList");
/**
Constructeur
*/
-NamesList::NamesList() {
+NamesList::NamesList()
+{
}
/**
Destructeur
*/
-NamesList::~NamesList() {
+NamesList::~NamesList()
+{
}
/**
@@ -56,28 +58,32 @@ void NamesList::removeName(const QString &lang) {
/**
Supprime tous les noms
*/
-void NamesList::clearNames() {
+void NamesList::clearNames()
+{
hash_names.clear();
}
/**
@return La liste de toutes les langues disponibles
*/
-QList NamesList::langs() const {
+QList NamesList::langs() const
+{
return(hash_names.keys());
}
/**
@return true si la liste de noms est vide, false sinon
*/
-bool NamesList::isEmpty() const {
+bool NamesList::isEmpty() const
+{
return(hash_names.isEmpty());
}
/**
@return Le nombre de noms dans la liste
*/
-int NamesList::count() const {
+int NamesList::count() const
+{
return(hash_names.count());
}
@@ -95,7 +101,8 @@ QString &NamesList::operator[](const QString &lang) {
@return Le nom dans la langue donnee ou QString() si ce nom n'est pas
defini
*/
-const QString NamesList::operator[](const QString &lang) const {
+const QString NamesList::operator[](const QString &lang) const
+{
return(hash_names.value(lang));
}
@@ -166,7 +173,8 @@ void NamesList::fromXml(const pugi::xml_node &xml_element, const QHash &xml_options) const {
+QDomElement NamesList::toXml(QDomDocument &xml_document, const QHash &xml_options) const
+{
QHash xml_opt = getXmlOptions(xml_options);
QDomElement names_elmt = xml_document.createElement(xml_opt["ParentTagName"]);
QHashIterator names_iterator(hash_names);
@@ -187,7 +195,8 @@ QDomElement NamesList::toXml(QDomDocument &xml_document, const QHash NamesList::getXmlOptions(const QHash &xml_options) const {
+QHash NamesList::getXmlOptions(const QHash &xml_options) const
+{
QHash new_xml_options = xml_options;
if (!xml_options.contains("ParentTagName")) {
new_xml_options.insert("ParentTagName", "names");
@@ -205,7 +214,8 @@ QHash NamesList::getXmlOptions(const QHash &
@param nl une autre liste de noms
@return true si les listes de noms sont differentes, false sinon
*/
-bool NamesList::operator!=(const NamesList &nl) const {
+bool NamesList::operator!=(const NamesList &nl) const
+{
return(hash_names != nl.hash_names);
}
@@ -213,7 +223,8 @@ bool NamesList::operator!=(const NamesList &nl) const {
@param nl une autre liste de noms
@return true si les listes de noms sont identiques, false sinon
*/
-bool NamesList::operator==(const NamesList &nl) const {
+bool NamesList::operator==(const NamesList &nl) const
+{
return(hash_names == nl.hash_names);
}
@@ -228,7 +239,8 @@ bool NamesList::operator==(const NamesList &nl) const {
@param fallback_name name to be returned when no adequate name has been found
@return The adequate name regarding the current system locale.
*/
-QString NamesList::name(const QString &fallback_name) const {
+QString NamesList::name(const QString &fallback_name) const
+{
QString system_language = QETApp::langFromSetting();
QString returned_name;
if (!hash_names[system_language].isEmpty()) {
diff --git a/sources/NameList/ui/namelistdialog.cpp b/sources/NameList/ui/namelistdialog.cpp
index 1f90eed88..ea05a7619 100644
--- a/sources/NameList/ui/namelistdialog.cpp
+++ b/sources/NameList/ui/namelistdialog.cpp
@@ -35,7 +35,8 @@ NameListDialog::NameListDialog(QWidget *parent) :
#endif
}
-NameListDialog::~NameListDialog() {
+NameListDialog::~NameListDialog()
+{
delete ui;
}
@@ -48,7 +49,8 @@ void NameListDialog::setInformationText(const QString &text) {
@return the name list widget used by this dialog.
The ownership of the namelistwidget stay to this dialog
*/
-NameListWidget *NameListDialog::namelistWidget() const {
+NameListWidget *NameListDialog::namelistWidget() const
+{
return m_namelist_widget;
}
@@ -62,6 +64,7 @@ void NameListDialog::setHelpText(const QString &text)
}
}
-void NameListDialog::showHelpDialog() {
+void NameListDialog::showHelpDialog()
+{
QMessageBox::information(this, tr("Variables de cartouche"), m_help_text);
}
diff --git a/sources/NameList/ui/namelistwidget.cpp b/sources/NameList/ui/namelistwidget.cpp
index 58ab5519c..a0d280970 100644
--- a/sources/NameList/ui/namelistwidget.cpp
+++ b/sources/NameList/ui/namelistwidget.cpp
@@ -122,7 +122,8 @@ void NameListWidget::setReadOnly(bool ro)
@return true if empty.
An empty dialog, is a dialog without any edited lang.
*/
-bool NameListWidget::isEmpty() const {
+bool NameListWidget::isEmpty() const
+{
return names().isEmpty();
}
diff --git a/sources/PropertiesEditor/propertieseditordockwidget.cpp b/sources/PropertiesEditor/propertieseditordockwidget.cpp
index 74154feaf..d3278a122 100644
--- a/sources/PropertiesEditor/propertieseditordockwidget.cpp
+++ b/sources/PropertiesEditor/propertieseditordockwidget.cpp
@@ -103,7 +103,8 @@ bool PropertiesEditorDockWidget::addEditor(PropertiesEditorWidget *editor,
@brief PropertiesEditorDockWidget::editors
@return all editor used in this dock
*/
-QList PropertiesEditorDockWidget::editors() const {
+QList PropertiesEditorDockWidget::editors() const
+{
return m_editor_list;
}
diff --git a/sources/PropertiesEditor/propertieseditorwidget.cpp b/sources/PropertiesEditor/propertieseditorwidget.cpp
index 79c310617..1e3190fd0 100644
--- a/sources/PropertiesEditor/propertieseditorwidget.cpp
+++ b/sources/PropertiesEditor/propertieseditorwidget.cpp
@@ -41,7 +41,8 @@ QUndoCommand *PropertiesEditorWidget::associatedUndo() const{
@brief PropertiesEditorWidget::title
@return the title of this editor
*/
-QString PropertiesEditorWidget::title() const {
+QString PropertiesEditorWidget::title() const
+{
return QString();
}
@@ -68,6 +69,7 @@ bool PropertiesEditorWidget::setLiveEdit(bool live_edit) {
@return true if this editor is in live edit mode
else return fasle.
*/
-bool PropertiesEditorWidget::isLiveEdit() const {
+bool PropertiesEditorWidget::isLiveEdit() const
+{
return m_live_edit;
}
diff --git a/sources/QetGraphicsItemModeler/qetgraphicshandleritem.cpp b/sources/QetGraphicsItemModeler/qetgraphicshandleritem.cpp
index 607e747ca..09947c2fe 100644
--- a/sources/QetGraphicsItemModeler/qetgraphicshandleritem.cpp
+++ b/sources/QetGraphicsItemModeler/qetgraphicshandleritem.cpp
@@ -37,7 +37,8 @@ QetGraphicsHandlerItem::QetGraphicsHandlerItem(qreal size) :
@brief QetGraphicsHandlerItem::boundingRect
@return
*/
-QRectF QetGraphicsHandlerItem::boundingRect() const {
+QRectF QetGraphicsHandlerItem::boundingRect() const
+{
return m_br;
}
diff --git a/sources/SearchAndReplace/ui/replaceconductordialog.cpp b/sources/SearchAndReplace/ui/replaceconductordialog.cpp
index 96aaf7566..3b167045f 100644
--- a/sources/SearchAndReplace/ui/replaceconductordialog.cpp
+++ b/sources/SearchAndReplace/ui/replaceconductordialog.cpp
@@ -319,7 +319,8 @@ void ReplaceConductorDialog::on_m_neutral_cb_toggled(bool checked)
}
}
-void ReplaceConductorDialog::on_m_update_preview_pb_clicked() {
+void ReplaceConductorDialog::on_m_update_preview_pb_clicked()
+{
updatePreview();
}
diff --git a/sources/SearchAndReplace/ui/replacefoliowidget.cpp b/sources/SearchAndReplace/ui/replacefoliowidget.cpp
index 40cedbc74..a86d78d2e 100644
--- a/sources/SearchAndReplace/ui/replacefoliowidget.cpp
+++ b/sources/SearchAndReplace/ui/replacefoliowidget.cpp
@@ -140,7 +140,8 @@ ReplaceFolioDialog::~ReplaceFolioDialog()
@brief ReplaceFolioDialog::titleBlockProperties
@return The title block properties edited by this dialog
*/
-TitleBlockProperties ReplaceFolioDialog::titleBlockProperties() const {
+TitleBlockProperties ReplaceFolioDialog::titleBlockProperties() const
+{
return m_widget->titleBlockProperties();
}
@@ -152,49 +153,56 @@ void ReplaceFolioDialog::setTitleBlockProperties(
const TitleBlockProperties &properties) {
m_widget->setTitleBlockProperties(properties);
}
-void ReplaceFolioWidget::on_m_title_cb_clicked() {
+void ReplaceFolioWidget::on_m_title_cb_clicked()
+{
ui->m_title_le->setText(ui->m_title_cb->isChecked()
? SearchAndReplaceWorker::eraseText()
: QString());
ui->m_title_le->setDisabled(ui->m_title_cb->isChecked());
}
-void ReplaceFolioWidget::on_m_author_cb_clicked() {
+void ReplaceFolioWidget::on_m_author_cb_clicked()
+{
ui->m_author_le->setText(ui->m_author_cb->isChecked()
? SearchAndReplaceWorker::eraseText()
: QString());
ui->m_author_le->setDisabled(ui->m_author_cb->isChecked());
}
-void ReplaceFolioWidget::on_m_file_cb_clicked() {
+void ReplaceFolioWidget::on_m_file_cb_clicked()
+{
ui->m_file_le->setText(ui->m_file_cb->isChecked()
? SearchAndReplaceWorker::eraseText()
: QString());
ui->m_file_le->setDisabled(ui->m_file_cb->isChecked());
}
-void ReplaceFolioWidget::on_m_folio_cb_clicked() {
+void ReplaceFolioWidget::on_m_folio_cb_clicked()
+{
ui->m_folio_le->setText(ui->m_folio_cb->isChecked()
? SearchAndReplaceWorker::eraseText()
: QString());
ui->m_folio_le->setDisabled(ui->m_folio_cb->isChecked());
}
-void ReplaceFolioWidget::on_m_plant_cb_clicked() {
+void ReplaceFolioWidget::on_m_plant_cb_clicked()
+{
ui->m_plant->setText(ui->m_plant_cb->isChecked()
? SearchAndReplaceWorker::eraseText()
: QString());
ui->m_plant->setDisabled(ui->m_plant_cb->isChecked());
}
-void ReplaceFolioWidget::on_m_loc_cb_clicked() {
+void ReplaceFolioWidget::on_m_loc_cb_clicked()
+{
ui->m_loc->setText(ui->m_loc_cb->isChecked()
? SearchAndReplaceWorker::eraseText()
: QString());
ui->m_loc->setDisabled(ui->m_loc_cb->isChecked());
}
-void ReplaceFolioWidget::on_m_indice_cb_clicked() {
+void ReplaceFolioWidget::on_m_indice_cb_clicked()
+{
ui->m_indice->setText(ui->m_indice_cb->isChecked()
? SearchAndReplaceWorker::eraseText()
: QString());
diff --git a/sources/SearchAndReplace/ui/searchandreplacewidget.cpp b/sources/SearchAndReplace/ui/searchandreplacewidget.cpp
index b94d501ca..cf740b8cf 100644
--- a/sources/SearchAndReplace/ui/searchandreplacewidget.cpp
+++ b/sources/SearchAndReplace/ui/searchandreplacewidget.cpp
@@ -70,7 +70,8 @@ SearchAndReplaceWidget::SearchAndReplaceWidget(QWidget *parent) :
@brief SearchAndReplaceWidget::~SearchAndReplaceWidget
Destructor
*/
-SearchAndReplaceWidget::~SearchAndReplaceWidget() {
+SearchAndReplaceWidget::~SearchAndReplaceWidget()
+{
delete ui;
}
diff --git a/sources/autoNum/assignvariables.cpp b/sources/autoNum/assignvariables.cpp
index 88d0a67f1..68e03facf 100644
--- a/sources/autoNum/assignvariables.cpp
+++ b/sources/autoNum/assignvariables.cpp
@@ -44,7 +44,8 @@ namespace autonum
hundred_folio = other.hundred_folio;
}
- sequentialNumbers::~sequentialNumbers() {}
+ sequentialNumbers::~sequentialNumbers()
+{}
sequentialNumbers &sequentialNumbers::operator=(
const sequentialNumbers &other)
diff --git a/sources/autoNum/numerotationcontext.cpp b/sources/autoNum/numerotationcontext.cpp
index 25c922b3d..1f932e9fa 100644
--- a/sources/autoNum/numerotationcontext.cpp
+++ b/sources/autoNum/numerotationcontext.cpp
@@ -23,7 +23,8 @@
/**
Constructor
*/
-NumerotationContext::NumerotationContext(){
+NumerotationContext::NumerotationContext()
+{
}
/**
@@ -36,7 +37,8 @@ NumerotationContext::NumerotationContext(QDomElement &e) {
/**
@brief NumerotationContext::clear, clear the content
*/
-void NumerotationContext::clear () {
+void NumerotationContext::clear ()
+{
content_.clear();
}
@@ -75,7 +77,8 @@ bool NumerotationContext::addValue(const QString &type,
@param i
@return the string at position i
*/
-QString NumerotationContext::operator [] (const int &i) const {
+QString NumerotationContext::operator [] (const int &i) const
+{
return (content_.at(i));
}
@@ -90,7 +93,8 @@ void NumerotationContext::operator << (const NumerotationContext &other) {
@brief NumerotationContext::size
@return size of context
*/
-int NumerotationContext::size() const {
+int NumerotationContext::size() const
+{
return (content_.size());
}
@@ -98,7 +102,8 @@ int NumerotationContext::size() const {
@brief NumerotationContext::isEmpty
@return true if numerotation contet is empty
*/
-bool NumerotationContext::isEmpty() const {
+bool NumerotationContext::isEmpty() const
+{
if (content_.size() > 0) return false;
return true;
}
@@ -107,7 +112,8 @@ bool NumerotationContext::isEmpty() const {
@param i
@return the content at position i 1:type 2:value 3:increase
*/
-QStringList NumerotationContext::itemAt(const int i) const {
+QStringList NumerotationContext::itemAt(const int i) const
+{
return (content_.at(i).split("|"));
}
@@ -115,7 +121,8 @@ QStringList NumerotationContext::itemAt(const int i) const {
@brief validRegExpNum
@return all type use to numerotation
*/
-QString NumerotationContext::validRegExpNum () const {
+QString NumerotationContext::validRegExpNum () const
+{
return ("unit|unitfolio|ten|tenfolio|hundred|hundredfolio|string|idfolio|folio|plant|locmach|elementline|elementcolumn|elementprefix");
}
@@ -123,7 +130,8 @@ QString NumerotationContext::validRegExpNum () const {
@brief NumerotationContext::validRegExpNumber
@return all type represents a number
*/
-QString NumerotationContext::validRegExpNumber() const {
+QString NumerotationContext::validRegExpNumber() const
+{
return ("unit|unitfolio|ten|tenfolio|hundred|hundredfolio");
}
@@ -131,7 +139,8 @@ QString NumerotationContext::validRegExpNumber() const {
@brief NumerotationContext::keyIsAcceptable
@return true if type is acceptable
*/
-bool NumerotationContext::keyIsAcceptable(const QString &type) const {
+bool NumerotationContext::keyIsAcceptable(const QString &type) const
+{
return (type.contains(QRegExp(validRegExpNum())));
}
@@ -139,7 +148,8 @@ bool NumerotationContext::keyIsAcceptable(const QString &type) const {
@brief NumerotationContext::keyIsNumber
@return true if type represent a number
*/
-bool NumerotationContext::keyIsNumber(const QString &type) const {
+bool NumerotationContext::keyIsNumber(const QString &type) const
+{
return (type.contains(QRegExp(validRegExpNumber())));
}
diff --git a/sources/autoNum/numerotationcontextcommands.cpp b/sources/autoNum/numerotationcontextcommands.cpp
index 22faf6b4d..706162a20 100644
--- a/sources/autoNum/numerotationcontextcommands.cpp
+++ b/sources/autoNum/numerotationcontextcommands.cpp
@@ -30,7 +30,8 @@ NumerotationContextCommands::NumerotationContextCommands(const NumerotationConte
/**
@brief Destructor
*/
-NumerotationContextCommands::~NumerotationContextCommands() {
+NumerotationContextCommands::~NumerotationContextCommands()
+{
if (strategy_) delete strategy_;
}
@@ -38,7 +39,8 @@ NumerotationContextCommands::~NumerotationContextCommands() {
@brief NumerotationContextCommands::next
@return the next numerotation context
*/
-NumerotationContext NumerotationContextCommands::next() {
+NumerotationContext NumerotationContextCommands::next()
+{
NumerotationContext contextnum;
for (int i=0; iclear();
@@ -204,7 +205,8 @@ void AutoNumberingDockWidget::setConductorActive(DiagramView* dv) {
@brief AutoNumberingDockWidget::setActive
Set current used autonumberings
*/
-void AutoNumberingDockWidget::setActive() {
+void AutoNumberingDockWidget::setActive()
+{
if (m_project_view!=nullptr) {
//Conductor
@@ -233,7 +235,8 @@ void AutoNumberingDockWidget::setActive() {
@brief AutoNumberingDockWidget::conductorAutoNumChanged
Add new or remove conductor auto num from combobox
*/
-void AutoNumberingDockWidget::conductorAutoNumChanged() {
+void AutoNumberingDockWidget::conductorAutoNumChanged()
+{
ui->m_conductor_cb->clear();
//Conductor Combobox
@@ -263,7 +266,8 @@ void AutoNumberingDockWidget::on_m_conductor_cb_activated(int)
@brief AutoNumberingDockWidget::elementAutoNumChanged
Add new or remove element auto num from combobox
*/
-void AutoNumberingDockWidget::elementAutoNumChanged() {
+void AutoNumberingDockWidget::elementAutoNumChanged()
+{
ui->m_element_cb->clear();
@@ -290,7 +294,8 @@ void AutoNumberingDockWidget::on_m_element_cb_activated(int)
@brief AutoNumberingDockWidget::folioAutoNumChanged
Add new or remove folio auto num from combobox
*/
-void AutoNumberingDockWidget::folioAutoNumChanged() {
+void AutoNumberingDockWidget::folioAutoNumChanged()
+{
ui->m_folio_cb->clear();
diff --git a/sources/autoNum/ui/numparteditorw.cpp b/sources/autoNum/ui/numparteditorw.cpp
index 8525ccfc3..7e4e3ae80 100644
--- a/sources/autoNum/ui/numparteditorw.cpp
+++ b/sources/autoNum/ui/numparteditorw.cpp
@@ -149,7 +149,8 @@ void NumPartEditorW::setVisibleItems()
@brief NumPartEditorW::toNumContext
@return the display to NumerotationContext
*/
-NumerotationContext NumPartEditorW::toNumContext() {
+NumerotationContext NumPartEditorW::toNumContext()
+{
NumerotationContext nc;
QString type_str;
switch (type_) {
@@ -214,7 +215,8 @@ NumerotationContext NumPartEditorW::toNumContext() {
@brief NumPartEditorW::isValid
@return true if value field isn't empty or if type is folio
*/
-bool NumPartEditorW::isValid() {
+bool NumPartEditorW::isValid()
+{
if (type_ == folio
|| type_ == idfolio
|| type_ == elementline
@@ -266,7 +268,8 @@ void NumPartEditorW::on_type_cb_activated(int) {
@brief NumPartEditorW::on_value_field_textChanged
emit changed when value_field text changed
*/
-void NumPartEditorW::on_value_field_textEdited() {
+void NumPartEditorW::on_value_field_textEdited()
+{
emit changed();
}
diff --git a/sources/borderproperties.cpp b/sources/borderproperties.cpp
index d3a23d66e..a2aa3de5f 100644
--- a/sources/borderproperties.cpp
+++ b/sources/borderproperties.cpp
@@ -48,7 +48,8 @@ BorderProperties::BorderProperties() :
@brief BorderProperties::~BorderProperties
destructor
*/
-BorderProperties::~BorderProperties() {
+BorderProperties::~BorderProperties()
+{
}
/**
@@ -95,7 +96,8 @@ bool BorderProperties::operator!=(const BorderProperties &bp) {
XML element to which attributes will be added
\~French Element XML auquel seront ajoutes des attributs
*/
-void BorderProperties::toXml(QDomElement &e) const {
+void BorderProperties::toXml(QDomElement &e) const
+{
e.setAttribute("cols", columns_count);
e.setAttribute("colsize", QString("%1").arg(columns_width));
e.setAttribute("rows", rows_count);
@@ -134,7 +136,8 @@ void BorderProperties::fromXml(QDomElement &e) {
prefix to be added before the names of the parameters
\~French prefixe a ajouter devant les noms des parametres
*/
-void BorderProperties::toSettings(QSettings &settings, const QString &prefix) const {
+void BorderProperties::toSettings(QSettings &settings, const QString &prefix) const
+{
settings.setValue(prefix + "cols", columns_count);
settings.setValue(prefix + "colsize", columns_width);
settings.setValue(prefix + "displaycols", display_columns);
diff --git a/sources/bordertitleblock.cpp b/sources/bordertitleblock.cpp
index 073adbac5..9f230cc63 100644
--- a/sources/bordertitleblock.cpp
+++ b/sources/bordertitleblock.cpp
@@ -71,7 +71,8 @@ BorderTitleBlock::BorderTitleBlock(QObject *parent) :
@brief BorderTitleBlock::~BorderTitleBlock
\~French Destructeur - ne fait rien
*/
-BorderTitleBlock::~BorderTitleBlock() {
+BorderTitleBlock::~BorderTitleBlock()
+{
}
/**
@@ -96,7 +97,8 @@ QRectF BorderTitleBlock::titleBlockRect() const
@brief BorderTitleBlock::titleblockInformation
@return
*/
-DiagramContext BorderTitleBlock::titleblockInformation() const {
+DiagramContext BorderTitleBlock::titleblockInformation() const
+{
return m_titleblock_template_renderer->context();
}
@@ -131,7 +133,8 @@ QRectF BorderTitleBlock::titleBlockRectForQPainter() const
It's like unite outsideBorderRect and titleBlockRect.
The rect is in scene coordinate
*/
-QRectF BorderTitleBlock::borderAndTitleBlockRect() const {
+QRectF BorderTitleBlock::borderAndTitleBlockRect() const
+{
return diagram_rect_ | titleBlockRect();
}
@@ -276,7 +279,8 @@ void BorderTitleBlock::borderFromXml(const QDomElement &xml_elmt) {
@return the properties of the titleblock
\~French les proprietes du cartouches
*/
-TitleBlockProperties BorderTitleBlock::exportTitleBlock() {
+TitleBlockProperties BorderTitleBlock::exportTitleBlock()
+{
TitleBlockProperties ip;
ip.author = author();
@@ -330,7 +334,8 @@ void BorderTitleBlock::importTitleBlock(const TitleBlockProperties &ip) {
@return border properties
\~French les proprietes de la bordure
*/
-BorderProperties BorderTitleBlock::exportBorder() {
+BorderProperties BorderTitleBlock::exportBorder()
+{
BorderProperties bp;
bp.columns_count = columnsCount();
bp.columns_width = columnsWidth();
@@ -364,7 +369,8 @@ void BorderTitleBlock::importBorder(const BorderProperties &bp) {
@return the titleblock template used to render the titleblock
@see TitleBlockTemplateRenderer::titleBlockTemplate()
*/
-const TitleBlockTemplate *BorderTitleBlock::titleBlockTemplate() {
+const TitleBlockTemplate *BorderTitleBlock::titleBlockTemplate()
+{
return(m_titleblock_template_renderer -> titleBlockTemplate());
}
@@ -384,7 +390,8 @@ void BorderTitleBlock::setTitleBlockTemplate(
@brief BorderTitleBlock::titleBlockTemplateName
@return The name of the template used to render the titleblock.
*/
-QString BorderTitleBlock::titleBlockTemplateName() const {
+QString BorderTitleBlock::titleBlockTemplateName() const
+{
QString tbt_name = m_titleblock_template_renderer -> titleBlockTemplate() -> name();
return((tbt_name == "default") ? "" : tbt_name);
}
diff --git a/sources/bordertitleblock.h b/sources/bordertitleblock.h
index 27c6f6b4f..39a7f93a6 100644
--- a/sources/bordertitleblock.h
+++ b/sources/bordertitleblock.h
@@ -79,14 +79,16 @@ class BorderTitleBlock : public QObject
@return the diagram width,
i.e. the width of the border without title block
*/
- qreal diagramWidth() const {
+ qreal diagramWidth() const
+{
return(columnsTotalWidth() + rowsHeaderWidth()); }
/**
@brief diagramHeight
@return the diagram height,
i.e. the height of the border without title block
*/
- qreal diagramHeight() const {
+ qreal diagramHeight() const
+{
return(rowsTotalHeight() + columnsHeaderHeight()); }
QRectF titleBlockRect () const;
diff --git a/sources/conductorautonumerotation.cpp b/sources/conductorautonumerotation.cpp
index fa3152d62..2ef7eb843 100644
--- a/sources/conductorautonumerotation.cpp
+++ b/sources/conductorautonumerotation.cpp
@@ -53,7 +53,8 @@ ConductorAutoNumerotation::ConductorAutoNumerotation(
@brief ConductorAutoNumerotation::numerate
execute the automatic numerotation
*/
-void ConductorAutoNumerotation::numerate() {
+void ConductorAutoNumerotation::numerate()
+{
if (!m_conductor) return;
if (conductor_list.size() >= 1 ) numeratePotential();
else if (m_conductor -> properties().type == ConductorProperties::Multi)
diff --git a/sources/conductorprofile.cpp b/sources/conductorprofile.cpp
index 422b5052e..edc5a02a5 100644
--- a/sources/conductorprofile.cpp
+++ b/sources/conductorprofile.cpp
@@ -21,7 +21,8 @@
#include "terminal.h"
/// Constructeur
-ConductorProfile::ConductorProfile() {
+ConductorProfile::ConductorProfile()
+{
}
/**
@@ -64,23 +65,27 @@ ConductorProfile &ConductorProfile::operator=(const ConductorProfile &c) {
}
/// destructeur
-ConductorProfile::~ConductorProfile() {
+ConductorProfile::~ConductorProfile()
+{
setNull();
}
/// @return true si le profil est nul
-bool ConductorProfile::isNull() const {
+bool ConductorProfile::isNull() const
+{
return(segments.isEmpty());
}
/// supprime les segments du profil de conducteur
-void ConductorProfile::setNull() {
+void ConductorProfile::setNull()
+{
foreach(ConductorSegmentProfile *csp, segments) delete csp;
segments.clear();
}
/// @return la largeur occupee par le conducteur
-qreal ConductorProfile::width() const {
+qreal ConductorProfile::width() const
+{
qreal width = 0.0;
foreach(ConductorSegmentProfile *csp, segments) {
if (csp -> isHorizontal) width += csp -> length;
@@ -101,7 +106,8 @@ qreal ConductorProfile::height() const{
@param type Type de Segments
@return Le nombre de segments composant le conducteur.
*/
-uint ConductorProfile::segmentsCount(QET::ConductorSegmentType type) const {
+uint ConductorProfile::segmentsCount(QET::ConductorSegmentType type) const
+{
if (type == QET::Both) return(segments.count());
uint nb_seg = 0;
foreach(ConductorSegmentProfile *csp, segments) {
@@ -112,7 +118,8 @@ uint ConductorProfile::segmentsCount(QET::ConductorSegmentType type) const {
}
/// @return les segments horizontaux de ce profil
-QList ConductorProfile::horizontalSegments() {
+QList ConductorProfile::horizontalSegments()
+{
QList segments_list;
foreach(ConductorSegmentProfile *csp, segments) {
if (csp -> isHorizontal) segments_list << csp;
@@ -121,7 +128,8 @@ QList ConductorProfile::horizontalSegments() {
}
/// @return les segments verticaux de ce profil
-QList ConductorProfile::verticalSegments() {
+QList ConductorProfile::verticalSegments()
+{
QList segments_list;
foreach(ConductorSegmentProfile *csp, segments) {
if (!csp -> isHorizontal) segments_list << csp;
diff --git a/sources/conductorproperties.cpp b/sources/conductorproperties.cpp
index 231228c00..0377c103f 100644
--- a/sources/conductorproperties.cpp
+++ b/sources/conductorproperties.cpp
@@ -31,7 +31,8 @@ SingleLineProperties::SingleLineProperties() :
}
/// Destructeur
-SingleLineProperties::~SingleLineProperties() {
+SingleLineProperties::~SingleLineProperties()
+{
}
/**
@@ -43,7 +44,8 @@ void SingleLineProperties::setPhasesCount(int n) {
}
/// @return le nombre de phases (0, 1, 2, ou 3)
-unsigned short int SingleLineProperties::phasesCount() {
+unsigned short int SingleLineProperties::phasesCount()
+{
return(phases);
}
@@ -52,7 +54,8 @@ unsigned short int SingleLineProperties::phasesCount() {
(Protective Earth Neutral) representation and if it features the ground and
the neutral.
*/
-bool SingleLineProperties::isPen() const {
+bool SingleLineProperties::isPen() const
+{
return(hasNeutral && hasGround && is_pen);
}
@@ -211,7 +214,8 @@ void SingleLineProperties::drawPen(QPainter *painter,
ajoutes a l'element e.
@param e Element XML auquel seront ajoutes des attributs
*/
-void SingleLineProperties::toXml(QDomElement &e) const {
+void SingleLineProperties::toXml(QDomElement &e) const
+{
e.setAttribute("ground", hasGround ? "true" : "false");
e.setAttribute("neutral", hasNeutral ? "true" : "false");
e.setAttribute("phase", phases);
@@ -251,7 +255,8 @@ ConductorProperties::ConductorProperties() :
/**
Destructeur
*/
-ConductorProperties::~ConductorProperties() {
+ConductorProperties::~ConductorProperties()
+{
}
@@ -802,7 +807,8 @@ void ConductorProperties::readStyle(const QString &style_string) {
Exporte le style du conducteur sous forme d'une chaine de caracteres
@return une chaine de caracteres decrivant le style du conducteur
*/
-QString ConductorProperties::writeStyle() const {
+QString ConductorProperties::writeStyle() const
+{
if (style == Qt::DashLine) {
return("line-style: dashed;");
} else if (style == Qt::DashDotLine) {
@@ -816,7 +822,8 @@ QString ConductorProperties::writeStyle() const {
@param other l'autre ensemble de proprietes avec lequel il faut effectuer la comparaison
@return true si les deux ensembles de proprietes sont identiques, false sinon
*/
-int SingleLineProperties::operator==(const SingleLineProperties &other) const {
+int SingleLineProperties::operator==(const SingleLineProperties &other) const
+{
return(
other.hasGround == hasGround &&\
other.hasNeutral == hasNeutral &&\
@@ -829,7 +836,8 @@ int SingleLineProperties::operator==(const SingleLineProperties &other) const {
@param other l'autre ensemble de proprietes avec lequel il faut effectuer la comparaison
@return true si les deux ensembles de proprietes sont differents, false sinon
*/
-int SingleLineProperties::operator!=(const SingleLineProperties &other) const {
+int SingleLineProperties::operator!=(const SingleLineProperties &other) const
+{
return(!(other == (*this)));
}
@@ -838,7 +846,8 @@ int SingleLineProperties::operator!=(const SingleLineProperties &other) const {
@param prefix prefix a ajouter devant les noms des parametres
*/
void SingleLineProperties::toSettings(QSettings &settings,
- const QString &prefix) const {
+ const QString &prefix) const
+{
settings.setValue(prefix + "hasGround", hasGround);
settings.setValue(prefix + "hasNeutral", hasNeutral);
settings.setValue(prefix + "phases", phases);
diff --git a/sources/conductorsegment.cpp b/sources/conductorsegment.cpp
index 200063009..967c2277c 100644
--- a/sources/conductorsegment.cpp
+++ b/sources/conductorsegment.cpp
@@ -41,7 +41,8 @@ ConductorSegment::ConductorSegment(
/**
Destructeur - Relie le segment precedent au suivant
*/
-ConductorSegment::~ConductorSegment() {
+ConductorSegment::~ConductorSegment()
+{
if (hasPreviousSegment()) previousSegment() -> setNextSegment(nextSegment());
if (hasNextSegment()) nextSegment() -> setPreviousSegment(previousSegment());
}
@@ -54,7 +55,8 @@ ConductorSegment::~ConductorSegment() {
@param possible_dx La valeur du mouvement possible (au maximum)
@return true si le mouvement est possible ; false s'il doit etre limite
*/
-bool ConductorSegment::canMove1stPointX(const qreal &asked_dx, qreal &possible_dx) const {
+bool ConductorSegment::canMove1stPointX(const qreal &asked_dx, qreal &possible_dx) const
+{
Q_ASSERT_X(isVertical(), "ConductorSegment::canMove1stPointX", "segment non vertical");
@@ -113,7 +115,8 @@ bool ConductorSegment::canMove1stPointX(const qreal &asked_dx, qreal &possible_d
@param possible_dx La valeur du mouvement possible (au maximum)
@return true si le mouvement est possible ; false s'il doit etre limite
*/
-bool ConductorSegment::canMove2ndPointX(const qreal &asked_dx, qreal &possible_dx) const {
+bool ConductorSegment::canMove2ndPointX(const qreal &asked_dx, qreal &possible_dx) const
+{
Q_ASSERT_X(isVertical(), "ConductorSegment::canMove2ndPointX", "segment non vertical");
@@ -172,7 +175,8 @@ bool ConductorSegment::canMove2ndPointX(const qreal &asked_dx, qreal &possible_d
@param possible_dy La valeur du mouvement possible (au maximum)
@return true si le mouvement est possible ; false s'il doit etre limite
*/
-bool ConductorSegment::canMove1stPointY(const qreal &asked_dy, qreal &possible_dy) const {
+bool ConductorSegment::canMove1stPointY(const qreal &asked_dy, qreal &possible_dy) const
+{
Q_ASSERT_X(isHorizontal(), "ConductorSegment::canMove1stPointY", "segment non horizontal");
@@ -231,7 +235,8 @@ bool ConductorSegment::canMove1stPointY(const qreal &asked_dy, qreal &possible_d
@param possible_dy La valeur du mouvement possible (au maximum)
@return true si le mouvement est possible ; false s'il doit etre limite
*/
-bool ConductorSegment::canMove2ndPointY(const qreal &asked_dy, qreal &possible_dy) const {
+bool ConductorSegment::canMove2ndPointY(const qreal &asked_dy, qreal &possible_dy) const
+{
Q_ASSERT_X(isHorizontal(), "ConductorSegment::canMove2ndPointY", "segment non horizontal");
@@ -401,59 +406,68 @@ void ConductorSegment::setNextSegment(ConductorSegment *ns) {
}
/// @return true si ce segment est un segment statique, cad un segment relie a une borne
-bool ConductorSegment::isStatic() const {
+bool ConductorSegment::isStatic() const
+{
return(isFirstSegment() || isLastSegment());
}
/// @return true si ce segment est le premier du conducteur
-bool ConductorSegment::isFirstSegment() const {
+bool ConductorSegment::isFirstSegment() const
+{
return(!hasPreviousSegment());
}
/// @return true si ce segment est le dernier du conducteur
-bool ConductorSegment::isLastSegment() const {
+bool ConductorSegment::isLastSegment() const
+{
return(!hasNextSegment());
}
/**
@return Le segment precedent
*/
-ConductorSegment *ConductorSegment::previousSegment() const {
+ConductorSegment *ConductorSegment::previousSegment() const
+{
return(previous_segment);
}
/**
@return Le segment suivant
*/
-ConductorSegment *ConductorSegment::nextSegment() const {
+ConductorSegment *ConductorSegment::nextSegment() const
+{
return(next_segment);
}
/**
@return true si le segment est vertical, false sinon
*/
-bool ConductorSegment::isVertical() const {
+bool ConductorSegment::isVertical() const
+{
return(point1.x() == point2.x());
}
/**
@return true si le segment est horizontal, false sinon
*/
-bool ConductorSegment::isHorizontal() const {
+bool ConductorSegment::isHorizontal() const
+{
return(point1.y() == point2.y());
}
/**
@return le premier point du segment
*/
-QPointF ConductorSegment::firstPoint() const {
+QPointF ConductorSegment::firstPoint() const
+{
return(point1);
}
/**
@return le second point du segment
*/
-QPointF ConductorSegment::secondPoint() const {
+QPointF ConductorSegment::secondPoint() const
+{
return(point2);
}
@@ -476,21 +490,24 @@ void ConductorSegment::setSecondPoint(const QPointF &p) {
/**
@return true si le segment a un segment precedent, false sinon
*/
-bool ConductorSegment::hasPreviousSegment() const {
+bool ConductorSegment::hasPreviousSegment() const
+{
return(previous_segment != nullptr);
}
/**
@return true si le segment a un segment suivant, false sinon
*/
-bool ConductorSegment::hasNextSegment() const {
+bool ConductorSegment::hasNextSegment() const
+{
return(next_segment != nullptr);
}
/**
@return Le centre du rectangle delimitant le conducteur
*/
-QPointF ConductorSegment::middle() const {
+QPointF ConductorSegment::middle() const
+{
return(
QPointF(
(point1.x()+ point2.x()) / 2.0,
@@ -502,7 +519,8 @@ QPointF ConductorSegment::middle() const {
/**
@return La longueur du conducteur
*/
-qreal ConductorSegment::length() const {
+qreal ConductorSegment::length() const
+{
if (isHorizontal()) {
return(secondPoint().x() - firstPoint().x());
} else {
@@ -511,11 +529,13 @@ qreal ConductorSegment::length() const {
}
/// @return QET::Horizontal si le segment est horizontal, QET::Vertical sinon
-QET::ConductorSegmentType ConductorSegment::type() const {
+QET::ConductorSegmentType ConductorSegment::type() const
+{
return(isHorizontal() ? QET::Horizontal : QET::Vertical);
}
/// @return true si les deux points constituant le segment sont egaux
-bool ConductorSegment::isPoint() const {
+bool ConductorSegment::isPoint() const
+{
return(point1 == point2);
}
diff --git a/sources/configdialog.cpp b/sources/configdialog.cpp
index fe5c5e788..0f813706f 100644
--- a/sources/configdialog.cpp
+++ b/sources/configdialog.cpp
@@ -92,13 +92,15 @@ ConfigDialog::ConfigDialog(QWidget *parent) : QDialog(parent) {
}
/// Destructeur
-ConfigDialog::~ConfigDialog() {
+ConfigDialog::~ConfigDialog()
+{
}
/**
Construit la liste des pages sur la gauche
*/
-void ConfigDialog::buildPagesList() {
+void ConfigDialog::buildPagesList()
+{
pages_list -> clear();
foreach(ConfigPage *page, pages) {
addPageToList(page);
@@ -119,7 +121,8 @@ void ConfigDialog::addPageToList(ConfigPage *page) {
/**
Applique la configuration de toutes les pages
*/
-void ConfigDialog::applyConf() {
+void ConfigDialog::applyConf()
+{
foreach(ConfigPage *page, pages) {
page -> applyConf();
}
diff --git a/sources/configpages.cpp b/sources/configpages.cpp
index ffc174bf6..573c9c94d 100644
--- a/sources/configpages.cpp
+++ b/sources/configpages.cpp
@@ -103,7 +103,8 @@ NewDiagramPage::NewDiagramPage(QETProject *project,
/**
@brief NewDiagramPage::~NewDiagramPage
*/
-NewDiagramPage::~NewDiagramPage() {
+NewDiagramPage::~NewDiagramPage()
+{
disconnect(ipw,SIGNAL(openAutoNumFolioEditor(QString)),this,SLOT(changeToAutoFolioTab()));
}
@@ -113,7 +114,8 @@ NewDiagramPage::~NewDiagramPage() {
If there is a project, save in the project,
else save to the default conf of QElectroTech
*/
-void NewDiagramPage::applyConf() {
+void NewDiagramPage::applyConf()
+{
if (m_project) { //If project we save to the project
if (m_project -> isReadOnly()) return;
bool modified_project = false;
@@ -182,7 +184,8 @@ void NewDiagramPage::applyConf() {
@brief NewDiagramPage::icon
@return icon of this page
*/
-QIcon NewDiagramPage::icon() const {
+QIcon NewDiagramPage::icon() const
+{
if (m_project) return(QET::Icons::NewDiagram);
return(QET::Icons::Projects);
}
@@ -191,7 +194,8 @@ QIcon NewDiagramPage::icon() const {
@brief NewDiagramPage::title
@return title of this page
*/
-QString NewDiagramPage::title() const {
+QString NewDiagramPage::title() const
+{
if (m_project) return(tr("Nouveau folio", "configuration page title"));
return(tr("Nouveau projet", "configuration page title"));
}
@@ -200,7 +204,8 @@ QString NewDiagramPage::title() const {
@brief NewDiagramPage::changeToAutoFolioTab
Set the current tab to Autonum
*/
-void NewDiagramPage::changeToAutoFolioTab(){
+void NewDiagramPage::changeToAutoFolioTab()
+{
if (m_project){
ppd_->setCurrentPage(ProjectPropertiesDialog::Autonum);
ppd_->changeToFolio();
@@ -222,7 +227,8 @@ void NewDiagramPage::setFolioAutonum(QString autoNum){
@brief NewDiagramPage::saveCurrentTbp
Save current TBP to retrieve after auto folio num
*/
-void NewDiagramPage::saveCurrentTbp(){
+void NewDiagramPage::saveCurrentTbp()
+{
savedTbp = ipw->properties();
}
@@ -230,7 +236,8 @@ void NewDiagramPage::saveCurrentTbp(){
@brief NewDiagramPage::loadSavedTbp
Retrieve saved auto folio num
*/
-void NewDiagramPage::loadSavedTbp(){
+void NewDiagramPage::loadSavedTbp()
+{
ipw->setProperties(savedTbp);
applyConf();
}
@@ -260,7 +267,8 @@ ExportConfigPage::ExportConfigPage(QWidget *parent) : ConfigPage(parent) {
}
/// Destructeur
-ExportConfigPage::~ExportConfigPage() {
+ExportConfigPage::~ExportConfigPage()
+{
}
/**
@@ -273,12 +281,14 @@ void ExportConfigPage::applyConf()
}
/// @return l'icone de cette page
-QIcon ExportConfigPage::icon() const {
+QIcon ExportConfigPage::icon() const
+{
return(QET::Icons::DocumentExport);
}
/// @return le titre de cette page
-QString ExportConfigPage::title() const {
+QString ExportConfigPage::title() const
+{
return(tr("Export", "configuration page title"));
}
@@ -308,7 +318,8 @@ PrintConfigPage::PrintConfigPage(QWidget *parent) : ConfigPage(parent) {
}
/// Destructeur
-PrintConfigPage::~PrintConfigPage() {
+PrintConfigPage::~PrintConfigPage()
+{
}
/**
@@ -329,12 +340,14 @@ void PrintConfigPage::applyConf()
}
/// @return l'icone de cette page
-QIcon PrintConfigPage::icon() const {
+QIcon PrintConfigPage::icon() const
+{
return(QET::Icons::Printer);
}
/// @return le titre de cette page
-QString PrintConfigPage::title() const {
+QString PrintConfigPage::title() const
+{
return(tr("Impression", "configuration page title"));
}
diff --git a/sources/createdxf.cpp b/sources/createdxf.cpp
index 22ca8c17a..f4c09a51e 100644
--- a/sources/createdxf.cpp
+++ b/sources/createdxf.cpp
@@ -39,7 +39,7 @@ Createdxf::~Createdxf()
}
/* Header section of every DXF file.*/
-void Createdxf::dxfBegin (const QString& fileName)
+void Createdxf::dxfBegin (const QString& fileName)
{
// Creation of an output stream object in text mode.
@@ -75,7 +75,7 @@ void Createdxf::dxfBegin (const QString& fileName)
To_Dxf << 30 << "\r\n";
To_Dxf << "0.0" << "\r\n";
To_Dxf << 9 << "\r\n";
-
+
To_Dxf << "$EXTMIN" << "\r\n";
To_Dxf << 10 << "\r\n";
To_Dxf << "0.0" << "\r\n";
@@ -87,7 +87,7 @@ void Createdxf::dxfBegin (const QString& fileName)
To_Dxf << "4000.0" << "\r\n";
To_Dxf << 20 << "\r\n";
To_Dxf << "4000.0" << "\r\n";
-
+
To_Dxf << 9 << "\r\n";
To_Dxf << "$LIMMIN" << "\r\n";
To_Dxf << 10 << "\r\n";
@@ -109,7 +109,7 @@ void Createdxf::dxfBegin (const QString& fileName)
To_Dxf << 0 << "\r\n";
To_Dxf << "TABLE" << "\r\n";
To_Dxf << 2 << "\r\n";
-
+
To_Dxf << "VPORT" << "\r\n";
To_Dxf << 70 << "\r\n";
To_Dxf << 1 << "\r\n";
@@ -190,7 +190,7 @@ void Createdxf::dxfBegin (const QString& fileName)
To_Dxf << 0 << "\r\n";
To_Dxf << "TABLE" << "\r\n";
To_Dxf << 2 << "\r\n";
-
+
To_Dxf << "LTYPE" << "\r\n";
To_Dxf << 70 << "\r\n";
To_Dxf << 1 << "\r\n";
@@ -209,7 +209,7 @@ void Createdxf::dxfBegin (const QString& fileName)
To_Dxf << 40 << "\r\n";
To_Dxf << 0.00 << "\r\n";
To_Dxf << 0 << "\r\n";
-
+
To_Dxf << "ENDTAB" << "\r\n";
To_Dxf << 0 << "\r\n";
To_Dxf << "ENDSEC" << "\r\n";
@@ -228,8 +228,12 @@ void Createdxf::dxfBegin (const QString& fileName)
}
}
-/* End Section of every DXF File*/
-void Createdxf::dxfEnd (const QString& fileName)
+/**
+ @brief Createdxf::dxfEnd
+ End Section of every DXF File
+ @param fileName
+*/
+void Createdxf::dxfEnd(const QString& fileName)
{
// Creation of an output stream object in text mode.
if (!fileName.isEmpty()) {
@@ -251,9 +255,21 @@ void Createdxf::dxfEnd (const QString& fileName)
}
}
-
-/* draw circle in dxf format*/
-void Createdxf::drawCircle (const QString& fileName, double radius, double x, double y, int colour)
+/**
+ @brief Createdxf::drawCircle
+ draw circle in dxf format
+ @param fileName
+ @param radius
+ @param x
+ @param y
+ @param colour
+*/
+void Createdxf::drawCircle(
+ const QString& fileName,
+ double radius,
+ double x,
+ double y,
+ int colour)
{
if (!fileName.isEmpty()) {
QFile file(fileName);
@@ -285,9 +301,23 @@ void Createdxf::drawCircle (const QString& fileName, double radius, double x, do
}
}
-
-/* draw line in DXF Format*/
-void Createdxf::drawLine (const QString &fileName, double x1, double y1, double x2, double y2,const int &colour)
+/**
+ @brief Createdxf::drawLine
+ draw line in DXF Format
+ @param fileName
+ @param x1
+ @param y1
+ @param x2
+ @param y2
+ @param colour
+*/
+void Createdxf::drawLine (
+ const QString &fileName,
+ double x1,
+ double y1,
+ double x2,
+ double y2,
+ const int &colour)
{
if (!fileName.isEmpty()) {
QFile file(fileName);
@@ -323,7 +353,8 @@ void Createdxf::drawLine (const QString &fileName, double x1, double y1, double
}
}
-long Createdxf::RGBcodeTable[255]{
+long Createdxf::RGBcodeTable[255]
+{
0x000000, 0xff0000, 0xffff00, 0x00ff00, 0x00ffff,
0x0000ff, 0xff00ff, 0xffffff, 0x414141, 0x808080,
0xff0000, 0xffaaaa, 0xbd0000, 0xbd7e7e, 0x810000,
@@ -415,7 +446,11 @@ int Createdxf::getcolorCode (const long red, const long green, const long blue)
@param line
@param colorcode
*/
-void Createdxf::drawLine(const QString &filepath, const QLineF &line, const int &colorcode) {
+void Createdxf::drawLine(
+ const QString &filepath,
+ const QLineF &line,
+ const int &colorcode)
+{
drawLine(filepath, line.p1().x() * xScale,
sheetHeight - (line.p1().y() * yScale),
line.p2().x() * xScale,
@@ -423,7 +458,19 @@ void Createdxf::drawLine(const QString &filepath, const QLineF &line, const int
colorcode);
}
-void Createdxf::drawArcEllipse(const QString &file_path, qreal x, qreal y, qreal w, qreal h, qreal startAngle, qreal spanAngle, qreal hotspot_x, qreal hotspot_y, qreal rotation_angle, const int &colorcode) {
+void Createdxf::drawArcEllipse(
+ const QString &file_path,
+ qreal x,
+ qreal y,
+ qreal w,
+ qreal h,
+ qreal startAngle,
+ qreal spanAngle,
+ qreal hotspot_x,
+ qreal hotspot_y,
+ qreal rotation_angle,
+ const int &colorcode)
+{
// vector of parts of arc (stored as a pair of startAngle and spanAngle) for each quadrant.
QVector< QPair > arc_parts_vector;
@@ -534,7 +581,12 @@ void Createdxf::drawArcEllipse(const QString &file_path, qreal x, qreal y, qreal
arc_endAngle = temp;
}
- QPointF transformed_point = ExportDialog::rotation_transformed(center_x, center_y, hotspot_x, hotspot_y, rotation_angle);
+ QPointF transformed_point = ExportDialog::rotation_transformed(
+ center_x,
+ center_y,
+ hotspot_x,
+ hotspot_y,
+ rotation_angle);
center_x = transformed_point.x();
center_y = transformed_point.y();
arc_endAngle *= 180/3.142;
@@ -542,7 +594,14 @@ void Createdxf::drawArcEllipse(const QString &file_path, qreal x, qreal y, qreal
arc_endAngle -= rotation_angle;
arc_startAngle -= rotation_angle;
- drawArc(file_path, center_x, center_y, radius, arc_startAngle, arc_endAngle, colorcode);
+ drawArc(
+ file_path,
+ center_x,
+ center_y,
+ radius,
+ arc_startAngle,
+ arc_endAngle,
+ colorcode);
}
}
@@ -553,16 +612,37 @@ void Createdxf::drawArcEllipse(const QString &file_path, qreal x, qreal y, qreal
@param rect
@param colorcode
*/
-void Createdxf::drawEllipse(const QString &filepath, const QRectF &rect, const int &colorcode) {
- drawArcEllipse(filepath, rect.topLeft().x() * xScale,
- sheetHeight - (rect.topLeft().y() * yScale),
- rect.width() * xScale,
- rect.height() * yScale,
- 0, 360, 0, 0, 0, colorcode);
+void Createdxf::drawEllipse(
+ const QString &filepath,
+ const QRectF &rect,
+ const int &colorcode)
+{
+ drawArcEllipse(
+ filepath,
+ rect.topLeft().x() * xScale,
+ sheetHeight - (rect.topLeft().y() * yScale),
+ rect.width() * xScale,
+ rect.height() * yScale,
+ 0, 360, 0, 0, 0, colorcode);
}
-/* draw rectangle in dxf format */
-void Createdxf::drawRectangle (const QString &fileName, double x1, double y1, double width, double height, const int &colour)
+/**
+ @brief Createdxf::drawRectangle
+ draw rectangle in dxf format
+ @param fileName
+ @param x1
+ @param y1
+ @param width
+ @param height
+ @param colour
+*/
+void Createdxf::drawRectangle (
+ const QString &fileName,
+ double x1,
+ double y1,
+ double width,
+ double height,
+ const int &colour)
{
if (!fileName.isEmpty()) {
QFile file(fileName);
@@ -654,40 +734,47 @@ void Createdxf::drawRectangle (const QString &fileName, double x1, double y1, do
/**
@brief Createdxf::drawRectangle
- Convenience function for draw rectangle
+ Convenience function for draw rectangle
@param filepath
@param rect
@param colorcode
*/
-void Createdxf::drawRectangle(const QString &filepath,
- const QRectF &rect,
- const int &colorcode) {
- drawRectangle(filepath, rect.bottomLeft().x() * xScale,
- sheetHeight - (rect.bottomLeft().y() * yScale),
- rect.width() * xScale,
- rect.height() * yScale,
- colorcode);
+void Createdxf::drawRectangle(
+ const QString &filepath,
+ const QRectF &rect,
+ const int &colorcode) {
+ drawRectangle(
+ filepath,
+ rect.bottomLeft().x() * xScale,
+ sheetHeight - (rect.bottomLeft().y() * yScale),
+ rect.width() * xScale,
+ rect.height() * yScale,
+ colorcode);
}
/**
- @brief Createdxf::drawPolygon
- Convenience function for draw polygon
- @param filepath
- @param poly
- @param colorcode
+ @brief Createdxf::drawPolygon
+ Convenience function for draw polygon
+ @param filepath
+ @param poly
+ @param colorcode
*/
-void Createdxf::drawPolygon(const QString &filepath,
- const QPolygonF &poly,
- const int &colorcode) {
- int lc = 0;
- QPointF plast;
- foreach(QPointF p, poly) {
- if(lc++) {
- QLineF ql(plast,p);
- drawLine(filepath,ql,colorcode);
- }
- plast = p;
- }
+void Createdxf::drawPolygon(
+ const QString &filepath,
+ const QPolygonF &poly,
+ const int &colorcode)
+{
+ int lc = 0;
+ QPointF plast;
+ foreach(QPointF p, poly)
+ {
+ if(lc++)
+ {
+ QLineF ql(plast,p);
+ drawLine(filepath,ql,colorcode);
+ }
+ plast = p;
+ }
}
/**
@brief Createdxf::drawArc
@@ -700,13 +787,14 @@ void Createdxf::drawPolygon(const QString &filepath,
@param endAngle
@param color
*/
-void Createdxf::drawArc(const QString& fileName,
- double x,
- double y,
- double rad,
- double startAngle,
- double endAngle,
- int color)
+void Createdxf::drawArc(
+ const QString& fileName,
+ double x,
+ double y,
+ double rad,
+ double startAngle,
+ double endAngle,
+ int color)
{
if (!fileName.isEmpty()) {
QFile file(fileName);
@@ -753,13 +841,14 @@ void Createdxf::drawArc(const QString& fileName,
@param rotation
@param colour
*/
-void Createdxf::drawText(const QString& fileName,
- const QString& text,
- double x,
- double y,
- double height,
- double rotation,
- int colour)
+void Createdxf::drawText(
+ const QString& fileName,
+ const QString& text,
+ double x,
+ double y,
+ double height,
+ double rotation,
+ int colour)
{
if (!fileName.isEmpty()) {
QFile file(fileName);
@@ -844,17 +933,17 @@ void Createdxf::drawTextAligned(
To_Dxf << 50 << "\r\n";
To_Dxf << rotation << "\r\n"; // Text Rotation
#if 0
- // If "Fit to width", then check if width of text < width specified then change it "center align or left align"
+ // If "Fit to width", then check if width of text < width specified then change it "center align or left align"
if (hAlign == 5) {
int xDiff = xAlign - x;
- int len = text.length();
- int t = xDiff/height;
+ int len = text.length();
+ int t = xDiff/height;
if (text.length() < xDiff/height && !leftAlign) {
hAlign = 1;
- xAlign = x+ (xAlign / 2);
+ xAlign = x+ (xAlign / 2);
} else if (text.length() < xDiff/height && leftAlign) {
- hAlign = 0;
- xAlign = x;
+ hAlign = 0;
+ xAlign = x;
// file.close();
// return;
}
diff --git a/sources/createdxf.h b/sources/createdxf.h
index e294ff2b2..7e9f88227 100644
--- a/sources/createdxf.h
+++ b/sources/createdxf.h
@@ -21,99 +21,112 @@
#include
#include
-
-/* This class exports the project to DXF Format */
+/**
+ @brief The Createdxf class
+ This class exports the project to DXF Format
+*/
class Createdxf
-{
- public:
- Createdxf();
- ~Createdxf();
- static void dxfBegin (const QString&);
- static void dxfEnd(const QString&);
- // you can add more functions to create more drawings.
- static void drawCircle(const QString&,
- double,
- double,
- double,
- int);
- static void drawArc(const QString&,
- double x,
- double y,
- double rad,
- double startAngle,
- double endAngle,
- int color);
- static void drawDonut(QString,double,double,double,int);
+{
+ public:
+ Createdxf();
+ ~Createdxf();
+ static void dxfBegin (const QString&);
+ static void dxfEnd(const QString&);
+ // you can add more functions to create more drawings.
+ static void drawCircle(
+ const QString&,
+ double,
+ double,
+ double,
+ int);
+ static void drawArc(
+ const QString&,
+ double x,
+ double y,
+ double rad,
+ double startAngle,
+ double endAngle,
+ int color);
+ static void drawDonut(QString,double,double,double,int);
- static void drawArcEllipse (const QString &file_path,
- qreal x,
- qreal y,
- qreal w,
- qreal h,
- qreal startAngle,
- qreal spanAngle,
- qreal hotspot_x,
- qreal hotspot_y,
- qreal rotation_angle,
- const int &colorcode);
+ static void drawArcEllipse (
+ const QString &file_path,
+ qreal x,
+ qreal y,
+ qreal w,
+ qreal h,
+ qreal startAngle,
+ qreal spanAngle,
+ qreal hotspot_x,
+ qreal hotspot_y,
+ qreal rotation_angle,
+ const int &colorcode);
static void drawEllipse (const QString &filepath,
const QRectF &rect,
const int &colorcode);
- static void drawRectangle(const QString &filepath,
- double,
- double,
- double,
- double,
- const int &colorcode);
- static void drawRectangle(const QString &filepath,
- const QRectF &rect,
- const int &colorcode);
+ static void drawRectangle(
+ const QString &filepath,
+ double,
+ double,
+ double,
+ double,
+ const int &colorcode);
+ static void drawRectangle(
+ const QString &filepath,
+ const QRectF &rect,
+ const int &colorcode);
- static void drawPolygon(const QString &filepath,
- const QPolygonF &poly,
- const int &colorcode);
+ static void drawPolygon(
+ const QString &filepath,
+ const QPolygonF &poly,
+ const int &colorcode);
- static void drawLine(const QString &filapath,
- double,
- double,
- double,
- double,
- const int &clorcode);
- static void drawLine(const QString &filepath,
- const QLineF &line,
- const int &colorcode);
+ static void drawLine(
+ const QString &filapath,
+ double,
+ double,
+ double,
+ double,
+ const int &clorcode);
+ static void drawLine(
+ const QString &filepath,
+ const QLineF &line,
+ const int &colorcode);
- static void drawText(const QString&,
- const QString&,
- double,double,
- double,
- double,
- int);
- static void drawTextAligned(const QString& fileName,
- const QString& text,
- double x,
- double y,
- double height,
- double rotation,
- double oblique,
- int hAlign,
- int vAlign,
- double xAlign,
- double xScale,
- int colour);
+ static void drawText(
+ const QString&,
+ const QString&,
+ double,double,
+ double,
+ double,
+ int);
+ static void drawTextAligned(
+ const QString& fileName,
+ const QString& text,
+ double x,
+ double y,
+ double height,
+ double rotation,
+ double oblique,
+ int hAlign,
+ int vAlign,
+ double xAlign,
+ double xScale,
+ int colour);
- static int getcolorCode (const long red,
- const long green,
- const long blue);
- static long RGBcodeTable[];
+ static int getcolorCode (
+ const long red,
+ const long green,
+ const long blue);
+ static long RGBcodeTable[];
- static const double sheetWidth;
- static const double sheetHeight;
- static double xScale;
- static double yScale;
+ static const double sheetWidth;
+ static const double sheetHeight;
+ static double xScale;
+ static double yScale;
};
#endif // CREATEDXF_H
diff --git a/sources/dataBase/projectdatabase.cpp b/sources/dataBase/projectdatabase.cpp
index 122063f98..072ea30e8 100644
--- a/sources/dataBase/projectdatabase.cpp
+++ b/sources/dataBase/projectdatabase.cpp
@@ -49,7 +49,8 @@ projectDataBase::projectDataBase(QETProject *project, const QString &connection_
@brief projectDataBase::~projectDataBase
Destructor
*/
-projectDataBase::~projectDataBase() {
+projectDataBase::~projectDataBase()
+{
m_data_base.close();
}
@@ -71,7 +72,8 @@ void projectDataBase::updateDB()
@brief projectDataBase::project
@return the project of this database
*/
-QETProject *projectDataBase::project() const {
+QETProject *projectDataBase::project() const
+{
return m_project;
}
diff --git a/sources/dataBase/ui/elementquerywidget.cpp b/sources/dataBase/ui/elementquerywidget.cpp
index 0e56f12d7..48d6c8ea2 100644
--- a/sources/dataBase/ui/elementquerywidget.cpp
+++ b/sources/dataBase/ui/elementquerywidget.cpp
@@ -98,7 +98,8 @@ ElementQueryWidget::ElementQueryWidget(QWidget *parent) :
/**
@brief ElementQueryWidget::~ElementQueryWidget
*/
-ElementQueryWidget::~ElementQueryWidget() {
+ElementQueryWidget::~ElementQueryWidget()
+{
delete ui;
}
@@ -413,7 +414,8 @@ void ElementQueryWidget::setCount(QString text, bool set)
/**
@brief ElementQueryWidget::updateQueryLine
*/
-void ElementQueryWidget::updateQueryLine() {
+void ElementQueryWidget::updateQueryLine()
+{
ui->m_sql_query->setText(queryStr());
}
@@ -464,7 +466,8 @@ void ElementQueryWidget::setUpItems()
@param key
@return the filter associated to key
*/
-QPair ElementQueryWidget::FilterFor(const QString &key) const {
+QPair ElementQueryWidget::FilterFor(const QString &key) const
+{
return m_filter.value(key, qMakePair(0, QString()));
}
diff --git a/sources/dataBase/ui/summaryquerywidget.cpp b/sources/dataBase/ui/summaryquerywidget.cpp
index 31f9386d9..6c54dedc9 100644
--- a/sources/dataBase/ui/summaryquerywidget.cpp
+++ b/sources/dataBase/ui/summaryquerywidget.cpp
@@ -153,7 +153,8 @@ void SummaryQueryWidget::fillSavedQuery()
/**
@brief SummaryQueryWidget::updateQueryLine
*/
-void SummaryQueryWidget::updateQueryLine() {
+void SummaryQueryWidget::updateQueryLine()
+{
ui->m_user_query_le->setText(queryStr());
}
diff --git a/sources/diagram.cpp b/sources/diagram.cpp
index 371cd9227..ae17c2c90 100644
--- a/sources/diagram.cpp
+++ b/sources/diagram.cpp
@@ -516,7 +516,8 @@ void Diagram::keyReleaseEvent(QKeyEvent *e)
@brief Diagram::uuid
@return the uuid of this diagram
*/
-QUuid Diagram::uuid() {
+QUuid Diagram::uuid()
+{
return m_uuid;
}
@@ -561,7 +562,8 @@ void Diagram::clearEventInterface()
@brief Diagram::conductorsAutonumName
@return the name of autonum to use.
*/
-QString Diagram::conductorsAutonumName() const {
+QString Diagram::conductorsAutonumName() const
+{
return m_conductors_autonum_name;
}
@@ -648,7 +650,8 @@ bool Diagram::toPaintDevice(QPaintDevice &pix,
\~ @return The size of the image generated by toImage()
\~French La taille de l'image generee par toImage()
*/
-QSize Diagram::imageSize() const {
+QSize Diagram::imageSize() const
+{
// determine la zone source = contenu du schema + marges
qreal image_width, image_height;
if (!use_border_) {
@@ -677,7 +680,8 @@ QSize Diagram::imageSize() const {
\~French true si le schema est considere comme vide, false sinon.
Un schema vide ne contient ni element, ni conducteur, ni champ de texte
*/
-bool Diagram::isEmpty() const {
+bool Diagram::isEmpty() const
+{
return(!items().count());
}
@@ -687,7 +691,8 @@ bool Diagram::isEmpty() const {
each potential are in the QList
and each conductors of one potential are in the QSet
*/
-QList < QSet > Diagram::potentials() {
+QList < QSet > Diagram::potentials()
+{
QList < QSet > potential_List;
if (content().conductors().size() == 0)
return (potential_List); //return an empty potential
@@ -1673,7 +1678,8 @@ void Diagram::setTitleBlockTemplate(const QString &template_name)
Select all schema objects
\~French Selectionne tous les objets du schema
*/
-void Diagram::selectAll() {
+void Diagram::selectAll()
+{
if (items().isEmpty()) return;
blockSignals(true);
@@ -1687,7 +1693,8 @@ void Diagram::selectAll() {
Deselects all selected objects
\~French Deslectionne tous les objets selectionnes
*/
-void Diagram::deselectAll() {
+void Diagram::deselectAll()
+{
if (items().isEmpty()) return;
clearSelection();
@@ -1698,7 +1705,8 @@ void Diagram::deselectAll() {
Reverses the selection state of all schema objects
Inverse l'etat de selection de tous les objets du schema
*/
-void Diagram::invertSelection() {
+void Diagram::invertSelection()
+{
if (items().isEmpty()) return;
blockSignals(true);
@@ -1854,7 +1862,8 @@ void Diagram::changeZValue(QET::DepthOption option)
This class loads all folio sequential variables related
to the current autonum
*/
-void Diagram::loadElmtFolioSeq() {
+void Diagram::loadElmtFolioSeq()
+{
QString title = project()->elementCurrentAutoNum();
NumerotationContext nc = project()->elementAutoNum(title);
@@ -1939,7 +1948,8 @@ void Diagram::loadElmtFolioSeq() {
This class loads all conductor folio sequential variables related
to the current autonum
*/
-void Diagram::loadCndFolioSeq() {
+void Diagram::loadCndFolioSeq()
+{
//Conductor
QString title = project()->conductorCurrentAutoNum();
NumerotationContext nc = project()->conductorAutoNum(title);
@@ -2020,7 +2030,8 @@ void Diagram::loadCndFolioSeq() {
@return title of the titleblock
\~Frenchle titre du cartouche
*/
-QString Diagram::title() const {
+QString Diagram::title() const
+{
return(border_and_titleblock.title());
}
@@ -2028,7 +2039,8 @@ QString Diagram::title() const {
@brief Diagram::elements
@return the list containing all elements
*/
-QList Diagram::elements() const {
+QList Diagram::elements() const
+{
QList element_list;
foreach (QGraphicsItem *qgi, items()) {
if (Element *elmt = qgraphicsitem_cast(qgi))
@@ -2041,7 +2053,8 @@ QList Diagram::elements() const {
@brief Diagram::conductors
@return the list containing all conductors
*/
-QList Diagram::conductors() const {
+QList Diagram::conductors() const
+{
QList cnd_list;
foreach (QGraphicsItem *qgi, items()) {
if (Conductor *cnd = qgraphicsitem_cast(qgi))
@@ -2054,7 +2067,8 @@ QList Diagram::conductors() const {
@brief Diagram::elementsMover
@return
*/
-ElementsMover &Diagram::elementsMover() {
+ElementsMover &Diagram::elementsMover()
+{
return m_elements_mover;
}
@@ -2062,7 +2076,8 @@ ElementsMover &Diagram::elementsMover() {
@brief Diagram::elementTextsMover
@return
*/
-ElementTextsMover &Diagram::elementTextsMover() {
+ElementTextsMover &Diagram::elementTextsMover()
+{
return m_element_texts_mover;
}
@@ -2111,7 +2126,8 @@ void Diagram::freezeElements(bool freeze) {
@brief Diagram::unfreezeElements
Unfreeze every existent element label.
*/
-void Diagram::unfreezeElements() {
+void Diagram::unfreezeElements()
+{
foreach (Element *elmt, elements()) {
elmt->freezeLabel(false);
}
@@ -2129,7 +2145,8 @@ void Diagram::setFreezeNewElements(bool b) {
@brief Diagram::freezeNewElements
@return current freeze new element status .
*/
-bool Diagram::freezeNewElements() {
+bool Diagram::freezeNewElements()
+{
return m_freeze_new_elements;
}
@@ -2155,7 +2172,8 @@ void Diagram::setFreezeNewConductors(bool b) {
@brief Diagram::freezeNewConductors
@return current freeze new conductor status .
*/
-bool Diagram::freezeNewConductors() {
+bool Diagram::freezeNewConductors()
+{
return m_freeze_new_conductors_;
}
@@ -2294,7 +2312,8 @@ void Diagram::setDrawColoredConductors(bool dcc) {
@return the list of conductors selected on the diagram
\~French la liste des conducteurs selectionnes sur le schema
*/
-QSet Diagram::selectedConductors() const {
+QSet Diagram::selectedConductors() const
+{
QSet conductors_set;
foreach(QGraphicsItem *qgi, selectedItems()) {
if (Conductor *c = qgraphicsitem_cast(qgi)) {
@@ -2309,7 +2328,8 @@ QSet Diagram::selectedConductors() const {
@return true if the clipboard appears to contain a schema
\~French true si le presse-papier semble contenir un schema
*/
-bool Diagram::clipboardMayContainDiagram() {
+bool Diagram::clipboardMayContainDiagram()
+{
QString clipboard_text = QApplication::clipboard() -> text().trimmed();
bool may_be_diagram = clipboard_text.startsWith("");
@@ -2323,7 +2343,8 @@ bool Diagram::clipboardMayContainDiagram() {
\~French le projet auquel ce schema appartient
ou 0 s'il s'agit d'un schema independant.
*/
-QETProject *Diagram::project() const {
+QETProject *Diagram::project() const
+{
return(m_project);
}
@@ -2332,7 +2353,8 @@ QETProject *Diagram::project() const {
@return the folio number of this diagram within its parent project,
or -1 if it is has no parent project
*/
-int Diagram::folioIndex() const {
+int Diagram::folioIndex() const
+{
if (!m_project) return(-1);
return(m_project -> folioIndex(this));
}
@@ -2345,7 +2367,8 @@ int Diagram::folioIndex() const {
fallback_to_project is true.
@return the declared QElectroTech version of this diagram
*/
-qreal Diagram::declaredQElectroTechVersion(bool fallback_to_project) const {
+qreal Diagram::declaredQElectroTechVersion(bool fallback_to_project) const
+{
if (diagram_qet_version_ != -1) {
return diagram_qet_version_;
}
@@ -2372,7 +2395,8 @@ bool Diagram::isReadOnly() const
\~French Le contenu du schema. Les conducteurs sont tous places dans
conductorsToMove.
*/
-DiagramContent Diagram::content() const {
+DiagramContent Diagram::content() const
+{
DiagramContent dc;
foreach(QGraphicsItem *qgi, items()) {
if (Element *e = qgraphicsitem_cast(qgi)) {
diff --git a/sources/diagram.h b/sources/diagram.h
index 5044c80e7..3b2c299de 100644
--- a/sources/diagram.h
+++ b/sources/diagram.h
@@ -410,7 +410,8 @@ inline QGIManager &Diagram::qgiManager() {
@brief Diagram::drawTerminals
@return true if terminals are rendered, false otherwise
*/
-inline bool Diagram::drawTerminals() const {
+inline bool Diagram::drawTerminals() const
+{
return(draw_terminals_);
}
@@ -418,7 +419,8 @@ inline bool Diagram::drawTerminals() const {
@brief Diagram::drawColoredConductors
@return true if conductors colors are rendered, false otherwise.
*/
-inline bool Diagram::drawColoredConductors() const {
+inline bool Diagram::drawColoredConductors() const
+{
return(draw_colored_conductors_);
}
diff --git a/sources/diagramcommands.cpp b/sources/diagramcommands.cpp
index 12a48710c..3589c5b94 100644
--- a/sources/diagramcommands.cpp
+++ b/sources/diagramcommands.cpp
@@ -64,7 +64,8 @@ PasteDiagramCommand::PasteDiagramCommand( Diagram *dia, const DiagramContent &c,
@brief PasteDiagramCommand::~PasteDiagramCommand
Destructor
*/
-PasteDiagramCommand::~PasteDiagramCommand() {
+PasteDiagramCommand::~PasteDiagramCommand()
+{
diagram -> qgiManager().release(content.items(filter));
}
@@ -162,7 +163,8 @@ CutDiagramCommand::CutDiagramCommand(
@brief CutDiagramCommand::~CutDiagramCommand
Destructeur
*/
-CutDiagramCommand::~CutDiagramCommand() {
+CutDiagramCommand::~CutDiagramCommand()
+{
}
/**
@@ -210,14 +212,16 @@ MoveElementsCommand::MoveElementsCommand(
@brief MoveElementsCommand::~MoveElementsCommand
Destructor
*/
-MoveElementsCommand::~MoveElementsCommand() {
+MoveElementsCommand::~MoveElementsCommand()
+{
delete m_anim_group;
}
/**
@brief MoveElementsCommand::undo
*/
-void MoveElementsCommand::undo() {
+void MoveElementsCommand::undo()
+{
diagram -> showMe();
m_anim_group->setDirection(QAnimationGroup::Forward);
m_anim_group->start();
@@ -227,7 +231,8 @@ void MoveElementsCommand::undo() {
/**
@brief MoveElementsCommand::redo
*/
-void MoveElementsCommand::redo() {
+void MoveElementsCommand::redo()
+{
diagram -> showMe();
if (first_redo) {
first_redo = false;
@@ -329,14 +334,16 @@ MoveConductorsTextsCommand::MoveConductorsTextsCommand(
@brief MoveConductorsTextsCommand::~MoveConductorsTextsCommand
Destructeur
*/
-MoveConductorsTextsCommand::~MoveConductorsTextsCommand() {
+MoveConductorsTextsCommand::~MoveConductorsTextsCommand()
+{
}
/**
@brief MoveConductorsTextsCommand::undo
annule le deplacement
*/
-void MoveConductorsTextsCommand::undo() {
+void MoveConductorsTextsCommand::undo()
+{
diagram -> showMe();
foreach(ConductorTextItem *cti, texts_to_move_.keys()) {
QPointF movement = texts_to_move_[cti].first;
@@ -353,7 +360,8 @@ void MoveConductorsTextsCommand::undo() {
@brief MoveConductorsTextsCommand::redo
refait le deplacement
*/
-void MoveConductorsTextsCommand::redo() {
+void MoveConductorsTextsCommand::redo()
+{
diagram -> showMe();
if (first_redo) {
first_redo = false;
@@ -397,7 +405,8 @@ void MoveConductorsTextsCommand::addTextMovement(ConductorTextItem *text_item,
@brief MoveConductorsTextsCommand::regenerateTextLabel
Genere la description de l'objet d'annulation
*/
-void MoveConductorsTextsCommand::regenerateTextLabel() {
+void MoveConductorsTextsCommand::regenerateTextLabel()
+{
QString moved_content_sentence = QET::ElementsAndConductorsSentence(0, 0, texts_to_move_.count());
setText(
@@ -437,14 +446,16 @@ ChangeDiagramTextCommand::ChangeDiagramTextCommand(
@brief ChangeDiagramTextCommand::~ChangeDiagramTextCommand
destructeur
*/
-ChangeDiagramTextCommand::~ChangeDiagramTextCommand() {
+ChangeDiagramTextCommand::~ChangeDiagramTextCommand()
+{
}
/**
@brief ChangeDiagramTextCommand::undo
annule la modification de texte
*/
-void ChangeDiagramTextCommand::undo() {
+void ChangeDiagramTextCommand::undo()
+{
diagram -> showMe();
text_item -> setHtml(text_before);
}
@@ -488,14 +499,16 @@ ChangeConductorCommand::ChangeConductorCommand(
@brief ChangeConductorCommand::~ChangeConductorCommand
Destructeur
*/
-ChangeConductorCommand::~ChangeConductorCommand() {
+ChangeConductorCommand::~ChangeConductorCommand()
+{
}
/**
@brief ChangeConductorCommand::undo
Annule la modification du conducteur
*/
-void ChangeConductorCommand::undo() {
+void ChangeConductorCommand::undo()
+{
diagram -> showMe();
conductor -> setProfile(old_profile, path_type);
conductor -> textItem() -> setPos(text_pos_before_mov_);
@@ -505,7 +518,8 @@ void ChangeConductorCommand::undo() {
@brief ChangeConductorCommand::redo
Refait la modification du conducteur
*/
-void ChangeConductorCommand::redo() {
+void ChangeConductorCommand::redo()
+{
diagram -> showMe();
if (first_redo) {
first_redo = false;
@@ -551,13 +565,15 @@ ResetConductorCommand::ResetConductorCommand(
/**
@brief ResetConductorCommand::~ResetConductorCommand
*/
-ResetConductorCommand::~ResetConductorCommand() {
+ResetConductorCommand::~ResetConductorCommand()
+{
}
/**
@brief ResetConductorCommand::undo
*/
-void ResetConductorCommand::undo() {
+void ResetConductorCommand::undo()
+{
diagram -> showMe();
foreach(Conductor *c, conductors_profiles.keys()) {
c -> setProfiles(conductors_profiles[c]);
@@ -567,7 +583,8 @@ void ResetConductorCommand::undo() {
/**
@brief ResetConductorCommand::redo
*/
-void ResetConductorCommand::redo() {
+void ResetConductorCommand::redo()
+{
diagram -> showMe();
foreach(Conductor *c, conductors_profiles.keys()) {
c -> textItem() -> forceMovedByUser (false);
@@ -601,14 +618,16 @@ ChangeBorderCommand::ChangeBorderCommand(Diagram *dia,
@brief ChangeBorderCommand::~ChangeBorderCommand
Destructeur
*/
-ChangeBorderCommand::~ChangeBorderCommand() {
+ChangeBorderCommand::~ChangeBorderCommand()
+{
}
/**
@brief ChangeBorderCommand::undo
Annule les changements apportes au schema
*/
-void ChangeBorderCommand::undo() {
+void ChangeBorderCommand::undo()
+{
diagram -> showMe();
diagram -> border_and_titleblock.importBorder(old_properties);
}
@@ -617,7 +636,8 @@ void ChangeBorderCommand::undo() {
@brief ChangeBorderCommand::redo
Refait les changements apportes au schema
*/
-void ChangeBorderCommand::redo() {
+void ChangeBorderCommand::redo()
+{
diagram -> showMe();
diagram -> border_and_titleblock.importBorder(new_properties);
}
diff --git a/sources/diagramcontent.cpp b/sources/diagramcontent.cpp
index a4f05ea7d..ba858918e 100644
--- a/sources/diagramcontent.cpp
+++ b/sources/diagramcontent.cpp
@@ -32,7 +32,8 @@
/**
@brief DiagramContent::DiagramContent
*/
-DiagramContent::DiagramContent() {}
+DiagramContent::DiagramContent()
+{}
/**
@brief DiagramContent::DiagramContent
diff --git a/sources/diagramcontext.cpp b/sources/diagramcontext.cpp
index a18e7485d..2e0ddf8de 100644
--- a/sources/diagramcontext.cpp
+++ b/sources/diagramcontext.cpp
@@ -67,14 +67,16 @@ QList DiagramContext::keys(DiagramContext::KeyOrder order) const
@param key string key
@return true if that key is known to the diagram context, false otherwise
*/
-bool DiagramContext::contains(const QString &key) const {
+bool DiagramContext::contains(const QString &key) const
+{
return(m_content.contains(key));
}
/**
@param key
*/
-const QVariant DiagramContext::operator[](const QString &key) const {
+const QVariant DiagramContext::operator[](const QString &key) const
+{
return(m_content[key]);
}
@@ -97,14 +99,16 @@ bool DiagramContext::addValue(const QString &key, const QVariant &value, bool sh
return(false);
}
-QVariant DiagramContext::value(const QString &key) const {
+QVariant DiagramContext::value(const QString &key) const
+{
return m_content.value(key);
}
/**
Clear the content of this diagram context.
*/
-void DiagramContext::clear() {
+void DiagramContext::clear()
+{
m_content.clear();
m_content_show.clear();
}
@@ -112,7 +116,8 @@ void DiagramContext::clear() {
/**
@return the number of key/value pairs stored in this object.
*/
-int DiagramContext::count() {
+int DiagramContext::count()
+{
return(m_content.count());
}
@@ -120,18 +125,21 @@ int DiagramContext::count() {
@brief DiagramContext::keyMustShow
@return the value pairs with key, if key no found, return false
*/
-bool DiagramContext::keyMustShow(const QString &key) const {
+bool DiagramContext::keyMustShow(const QString &key) const
+{
if (m_content_show.contains(key))
return m_content_show[key];
return false;
}
-bool DiagramContext::operator==(const DiagramContext &dc) const {
+bool DiagramContext::operator==(const DiagramContext &dc) const
+{
return(m_content == dc.m_content &&
m_content_show == dc.m_content_show);
}
-bool DiagramContext::operator!=(const DiagramContext &dc) const {
+bool DiagramContext::operator!=(const DiagramContext &dc) const
+{
return(!(*this == dc));
}
@@ -139,7 +147,8 @@ bool DiagramContext::operator!=(const DiagramContext &dc) const {
Export this context properties under the \a e XML element, using tags
named \a tag_name (defaults to "property").
*/
-void DiagramContext::toXml(QDomElement &e, const QString &tag_name) const {
+void DiagramContext::toXml(QDomElement &e, const QString &tag_name) const
+{
foreach (QString key, keys()) {
QDomElement property = e.ownerDocument().createElement(tag_name);
property.setAttribute("name", key);
@@ -182,7 +191,8 @@ void DiagramContext::fromXml(const pugi::xml_node &dom_element, const QString &t
Export this context properties to \a settings by creating an array named \a
array_name.
*/
-void DiagramContext::toSettings(QSettings &settings, const QString &array_name) const {
+void DiagramContext::toSettings(QSettings &settings, const QString &array_name) const
+{
settings.beginWriteArray(array_name);
int i = 0;
foreach (QString key, m_content.keys()) {
@@ -213,7 +223,8 @@ void DiagramContext::fromSettings(QSettings &settings, const QString &array_name
@return the regular expression used to check whether a given key is acceptable.
@see keyIsAcceptable()
*/
-QString DiagramContext::validKeyRegExp() {
+QString DiagramContext::validKeyRegExp()
+{
return("^[a-z0-9-_]+$");
}
@@ -228,7 +239,8 @@ bool DiagramContext::stringLongerThan(const QString &a, const QString &b) {
@param key a key string
@return true if that key is acceptable, false otherwise
*/
-bool DiagramContext::keyIsAcceptable(const QString &key) const {
+bool DiagramContext::keyIsAcceptable(const QString &key) const
+{
QRegExp re(DiagramContext::validKeyRegExp());
return(re.exactMatch(key));
}
diff --git a/sources/diagramevent/diagrameventinterface.cpp b/sources/diagramevent/diagrameventinterface.cpp
index c8dcb4844..6f3ef1a29 100644
--- a/sources/diagramevent/diagrameventinterface.cpp
+++ b/sources/diagramevent/diagrameventinterface.cpp
@@ -29,7 +29,8 @@ DiagramEventInterface::DiagramEventInterface(Diagram *diagram) :
m_diagram -> clearSelection();
}
-DiagramEventInterface::~DiagramEventInterface() {};
+DiagramEventInterface::~DiagramEventInterface()
+{};
void DiagramEventInterface::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) {
Q_UNUSED (event);
@@ -71,7 +72,8 @@ void DiagramEventInterface::keyReleaseEvent(QKeyEvent *event){
Q_UNUSED (event);
}
-bool DiagramEventInterface::isRunning() const {
+bool DiagramEventInterface::isRunning() const
+{
return m_running;
}
diff --git a/sources/diagramposition.cpp b/sources/diagramposition.cpp
index cc6e1d107..df4632a2d 100644
--- a/sources/diagramposition.cpp
+++ b/sources/diagramposition.cpp
@@ -36,13 +36,15 @@ DiagramPosition::DiagramPosition(const QString &letter, unsigned int number) {
/**
Destructeur
*/
-DiagramPosition::~DiagramPosition() {
+DiagramPosition::~DiagramPosition()
+{
}
/**
@return les coordonnees stockees dans cet objet, ou un QPointF nul sinon.
*/
-QPointF DiagramPosition::position() const {
+QPointF DiagramPosition::position() const
+{
return(position_);
}
@@ -56,7 +58,8 @@ void DiagramPosition::setPosition(const QPointF &position) {
/**
@return une representation textuelle de la position
*/
-QString DiagramPosition::toString() {
+QString DiagramPosition::toString()
+{
if (isOutOfBounds()) {
return("-");
}
@@ -72,6 +75,7 @@ QString DiagramPosition::toString() {
/**
@return true si l'element est en dehors des bords du schema
*/
-bool DiagramPosition::isOutOfBounds() const {
+bool DiagramPosition::isOutOfBounds() const
+{
return(letter_.isEmpty() || !number_);
}
diff --git a/sources/diagramprintdialog.cpp b/sources/diagramprintdialog.cpp
index 0ab8612a4..36e6b6118 100644
--- a/sources/diagramprintdialog.cpp
+++ b/sources/diagramprintdialog.cpp
@@ -48,7 +48,8 @@ DiagramPrintDialog::DiagramPrintDialog(QETProject *project, QWidget *parent) :
/**
Destructeur
*/
-DiagramPrintDialog::~DiagramPrintDialog() {
+DiagramPrintDialog::~DiagramPrintDialog()
+{
delete dialog_;
delete printer_;
Diagram::background_color = backup_diagram_background_color;
@@ -64,7 +65,8 @@ void DiagramPrintDialog::setFileName(const QString &name) {
/**
@return le nom du PDF
*/
-QString DiagramPrintDialog::fileName() const {
+QString DiagramPrintDialog::fileName() const
+{
return(file_name_);
}
@@ -78,7 +80,8 @@ void DiagramPrintDialog::setDocName(const QString &name) {
/**
@return le nom du document
*/
-QString DiagramPrintDialog::docName() const {
+QString DiagramPrintDialog::docName() const
+{
return(doc_name_);
}
@@ -89,7 +92,8 @@ QString DiagramPrintDialog::docName() const {
@return the rectangle to be printed
*/
QRect DiagramPrintDialog::diagramRect(Diagram *diagram,
- const ExportProperties &options) const {
+ const ExportProperties &options) const
+{
if (!diagram) return(QRect());
QRectF diagram_rect = diagram -> border_and_titleblock.borderAndTitleBlockRect();
@@ -107,7 +111,8 @@ QRect DiagramPrintDialog::diagramRect(Diagram *diagram,
/**
Execute le dialogue d'impression
*/
-void DiagramPrintDialog::exec() {
+void DiagramPrintDialog::exec()
+{
// prise en compte du nom du document
if (!doc_name_.isEmpty()) printer_ -> setDocName(doc_name_);
@@ -172,7 +177,8 @@ void DiagramPrintDialog::exec() {
@return Le nombre de pages necessaires pour imprimer le schema
avec l'orientation et le format papier utilise dans l'imprimante en cours.
*/
-int DiagramPrintDialog::pagesCount(Diagram *diagram, const ExportProperties &options, bool fullpage) const {
+int DiagramPrintDialog::pagesCount(Diagram *diagram, const ExportProperties &options, bool fullpage) const
+{
return(horizontalPagesCount(diagram, options, fullpage) * verticalPagesCount(diagram, options, fullpage));
}
@@ -183,7 +189,8 @@ int DiagramPrintDialog::pagesCount(Diagram *diagram, const ExportProperties &opt
@return La largeur du "poster" en nombre de pages pour imprimer le schema
avec l'orientation et le format papier utilise dans l'imprimante en cours.
*/
-int DiagramPrintDialog::horizontalPagesCount(Diagram *diagram, const ExportProperties &options, bool fullpage) const {
+int DiagramPrintDialog::horizontalPagesCount(Diagram *diagram, const ExportProperties &options, bool fullpage) const
+{
// note : pageRect et Paper Rect tiennent compte de l'orientation du papier
QRect printable_area = fullpage ? printer_ -> paperRect() : printer_ -> pageRect();
QRect diagram_rect = diagramRect(diagram, options);
@@ -199,7 +206,8 @@ int DiagramPrintDialog::horizontalPagesCount(Diagram *diagram, const ExportPrope
@return La largeur du "poster" en nombre de pages pour imprimer le schema
avec l'orientation et le format papier utilise dans l'imprimante en cours.
*/
-int DiagramPrintDialog::verticalPagesCount(Diagram *diagram, const ExportProperties &options, bool fullpage) const {
+int DiagramPrintDialog::verticalPagesCount(Diagram *diagram, const ExportProperties &options, bool fullpage) const
+{
// note : pageRect et Paper Rect tiennent compte de l'orientation du papier
QRect printable_area = fullpage ? printer_ -> paperRect() : printer_ -> pageRect();
QRect diagram_rect = diagramRect(diagram, options);
@@ -212,7 +220,8 @@ int DiagramPrintDialog::verticalPagesCount(Diagram *diagram, const ExportPropert
Construit un dialogue non standard pour demander a l'utilisateur quelle type
d'impression il souhaite effectuer : PDF, PS ou imprimante physique
*/
-void DiagramPrintDialog::buildPrintTypeDialog() {
+void DiagramPrintDialog::buildPrintTypeDialog()
+{
// initialisation des widgets
dialog_ = new QDialog(parentWidget());
#ifdef Q_OS_MACOS
@@ -273,7 +282,8 @@ void DiagramPrintDialog::buildPrintTypeDialog() {
/**
Assure la coherence du dialogue permettant le choix du type d'impression
*/
-void DiagramPrintDialog::updatePrintTypeDialog() {
+void DiagramPrintDialog::updatePrintTypeDialog()
+{
// imprime-t-on vers un fichier ?
bool file_print = !(printer_choice_ -> isChecked());
@@ -301,7 +311,8 @@ void DiagramPrintDialog::updatePrintTypeDialog() {
Verifie l'etat du dialogue permettant le choix du type d'impression lorsque
l'utilisateur le valide.
*/
-void DiagramPrintDialog::acceptPrintTypeDialog() {
+void DiagramPrintDialog::acceptPrintTypeDialog()
+{
bool file_print = !(printer_choice_ -> isChecked());
if (file_print) {
// un fichier doit avoir ete entre
@@ -322,7 +333,8 @@ void DiagramPrintDialog::acceptPrintTypeDialog() {
/**
Permet a l'utilisateur de choisir un fichier
*/
-void DiagramPrintDialog::browseFilePrintTypeDialog() {
+void DiagramPrintDialog::browseFilePrintTypeDialog()
+{
QString extension;
QString filter;
if (printer_choice_ -> isChecked()) return;
diff --git a/sources/diagramschooser.cpp b/sources/diagramschooser.cpp
index 66701fe39..2203572de 100644
--- a/sources/diagramschooser.cpp
+++ b/sources/diagramschooser.cpp
@@ -47,20 +47,23 @@ DiagramsChooser::DiagramsChooser(QETProject *project, QWidget *parent) :
/**
Destructeur
*/
-DiagramsChooser::~DiagramsChooser() {
+DiagramsChooser::~DiagramsChooser()
+{
}
/**
@return le projet dont ce widget affiche les schemas
*/
-QETProject *DiagramsChooser::project() const {
+QETProject *DiagramsChooser::project() const
+{
return(project_);
}
/**
@return la liste des schemas selectionnes
*/
-QList DiagramsChooser::selectedDiagrams() const {
+QList DiagramsChooser::selectedDiagrams() const
+{
QList selected_diagrams;
foreach(Diagram *diagram, project_ -> diagrams()) {
QCheckBox *check_box = diagrams_[diagram];
@@ -74,7 +77,8 @@ QList DiagramsChooser::selectedDiagrams() const {
/**
@return la liste des schemas qui ne sont pas selectionnes
*/
-QList DiagramsChooser::nonSelectedDiagrams() const {
+QList DiagramsChooser::nonSelectedDiagrams() const
+{
QList selected_diagrams;
foreach(Diagram *diagram, diagrams_.keys()) {
if (!(diagrams_[diagram] -> isChecked())) {
@@ -87,7 +91,8 @@ QList DiagramsChooser::nonSelectedDiagrams() const {
/**
@param diagram Un schema cense etre present dans ce widget
*/
-bool DiagramsChooser::diagramIsSelected(Diagram *const diagram) const {
+bool DiagramsChooser::diagramIsSelected(Diagram *const diagram) const
+{
QCheckBox *checkbox = diagrams_.value(diagram);
if (!checkbox) return(false);
return(checkbox -> isChecked());
@@ -146,7 +151,8 @@ void DiagramsChooser::setSelectedAllDiagrams(bool select) {
/**
Met a jour la liste des schemas du projet
*/
-void DiagramsChooser::updateList() {
+void DiagramsChooser::updateList()
+{
if (!project_) return;
// retient la liste des schemas deja selectionnes
@@ -176,7 +182,8 @@ void DiagramsChooser::updateList() {
/**
Met en place la disposition du widget
*/
-void DiagramsChooser::buildLayout() {
+void DiagramsChooser::buildLayout()
+{
if (vlayout0_) return;
vlayout0_ = new QVBoxLayout();
widget0_ = new QWidget();
diff --git a/sources/diagramview.cpp b/sources/diagramview.cpp
index fcd9f3e7a..8522b6322 100644
--- a/sources/diagramview.cpp
+++ b/sources/diagramview.cpp
@@ -113,27 +113,31 @@ DiagramView::DiagramView(Diagram *diagram, QWidget *parent) :
/**
Destructeur
*/
-DiagramView::~DiagramView() {
+DiagramView::~DiagramView()
+{
}
/**
Selectionne tous les objets du schema
*/
-void DiagramView::selectAll() {
+void DiagramView::selectAll()
+{
m_diagram -> selectAll();
}
/**
Deslectionne tous les objets selectionnes
*/
-void DiagramView::selectNothing() {
+void DiagramView::selectNothing()
+{
m_diagram -> deselectAll();
}
/**
Inverse l'etat de selection de tous les objets du schema
*/
-void DiagramView::selectInvert() {
+void DiagramView::selectInvert()
+{
m_diagram -> invertSelection();
}
@@ -267,7 +271,8 @@ void DiagramView::handleTextDrop(QDropEvent *e) {
/**
Set the Diagram in visualisation mode
*/
-void DiagramView::setVisualisationMode() {
+void DiagramView::setVisualisationMode()
+{
setDragMode(ScrollHandDrag);
applyReadOnly();
setInteractive(false);
@@ -277,7 +282,8 @@ void DiagramView::setVisualisationMode() {
/**
Set the Diagram in Selection mode
*/
-void DiagramView::setSelectionMode() {
+void DiagramView::setSelectionMode()
+{
setDragMode(RubberBandDrag);
setInteractive(true);
applyReadOnly();
@@ -315,7 +321,8 @@ void DiagramView::zoom(const qreal zoom_factor)
schema soient visibles a l'ecran. S'il n'y a aucun element sur le schema,
le zoom est reinitialise
*/
-void DiagramView::zoomFit() {
+void DiagramView::zoomFit()
+{
adjustSceneRect();
fitInView(m_diagram->sceneRect(), Qt::KeepAspectRatio);
adjustGridToZoom();
@@ -324,7 +331,8 @@ void DiagramView::zoomFit() {
/**
Adjust zoom to fit all elements in the view, regardless of diagram borders.
*/
-void DiagramView::zoomContent() {
+void DiagramView::zoomContent()
+{
fitInView(m_diagram -> itemsBoundingRect(), Qt::KeepAspectRatio);
adjustGridToZoom();
}
@@ -332,7 +340,8 @@ void DiagramView::zoomContent() {
/**
Reinitialise le zoom
*/
-void DiagramView::zoomReset() {
+void DiagramView::zoomReset()
+{
resetTransform();
adjustGridToZoom();
}
@@ -340,7 +349,8 @@ void DiagramView::zoomReset() {
/**
Copie les elements selectionnes du schema dans le presse-papier puis les supprime
*/
-void DiagramView::cut() {
+void DiagramView::cut()
+{
copy();
DiagramContent cut_content(m_diagram);
m_diagram -> clearSelection();
@@ -350,7 +360,8 @@ void DiagramView::cut() {
/**
Copie les elements selectionnes du schema dans le presse-papier
*/
-void DiagramView::copy() {
+void DiagramView::copy()
+{
QClipboard *presse_papier = QApplication::clipboard();
QString contenu_presse_papier = m_diagram -> toXml(false).toString(4);
if (presse_papier -> supportsSelection()) presse_papier -> setText(contenu_presse_papier, QClipboard::Selection);
@@ -387,7 +398,8 @@ void DiagramView::paste(const QPointF &pos, QClipboard::Mode clipboard_mode) {
/**
Colle le contenu du presse-papier sur le schema a la position de la souris
*/
-void DiagramView::pasteHere() {
+void DiagramView::pasteHere()
+{
paste(mapToScene(m_paste_here_pos));
}
@@ -811,7 +823,8 @@ void DiagramView::scrollOnMovement(QKeyEvent *e)
la mention "Schema sans titre" est utilisee
@see Diagram::title()
*/
-QString DiagramView::title() const {
+QString DiagramView::title() const
+{
QString view_title;
QString diagram_title(m_diagram -> title());
if (diagram_title.isEmpty()) {
@@ -826,7 +839,8 @@ QString DiagramView::title() const {
@brief DiagramView::editDiagramProperties
Edit the properties of the viewed digram
*/
-void DiagramView::editDiagramProperties() {
+void DiagramView::editDiagramProperties()
+{
DiagramPropertiesDialog::diagramPropertiesDialog(m_diagram, diagramEditor());
}
@@ -854,14 +868,16 @@ void DiagramView::adjustSceneRect()
/**
Met a jour le titre du widget
*/
-void DiagramView::updateWindowTitle() {
+void DiagramView::updateWindowTitle()
+{
emit(titleChanged(this, title()));
}
/**
Enables or disables the drawing grid according to the amount of pixels display
*/
-void DiagramView::adjustGridToZoom() {
+void DiagramView::adjustGridToZoom()
+{
QRectF viewed_scene = viewedSceneRect();
if (diagramEditor()->drawGrid())
m_diagram->setDisplayGrid(viewed_scene.width() < 2000 || viewed_scene.height() < 2000);
@@ -872,7 +888,8 @@ void DiagramView::adjustGridToZoom() {
/**
@return le rectangle du schema (classe Diagram) visualise par ce DiagramView
*/
-QRectF DiagramView::viewedSceneRect() const {
+QRectF DiagramView::viewedSceneRect() const
+{
// recupere la taille du widget viewport
QSize viewport_size = viewport() -> size();
@@ -893,7 +910,8 @@ QRectF DiagramView::viewedSceneRect() const {
parent project before being applied to the current diagram, or false if it
can be directly applied
*/
-bool DiagramView::mustIntegrateTitleBlockTemplate(const TitleBlockTemplateLocation &tbt_loc) const {
+bool DiagramView::mustIntegrateTitleBlockTemplate(const TitleBlockTemplateLocation &tbt_loc) const
+{
// unlike elements, the integration of title block templates is mandatory, so we simply check whether the parent project of the template is also the parent project of the diagram
QETProject *tbt_parent_project = tbt_loc.parentProject();
if (!tbt_parent_project) return(true);
@@ -905,7 +923,8 @@ bool DiagramView::mustIntegrateTitleBlockTemplate(const TitleBlockTemplateLocati
Fait en sorte que le schema ne soit editable que s'il n'est pas en lecture
seule
*/
-void DiagramView::applyReadOnly() {
+void DiagramView::applyReadOnly()
+{
if (!m_diagram) return;
bool is_writable = !m_diagram -> isReadOnly();
@@ -970,7 +989,8 @@ void DiagramView::editConductorColor(Conductor *edited_conductor)
/**
Reinitialise le profil des conducteurs selectionnes
*/
-void DiagramView::resetConductors() {
+void DiagramView::resetConductors()
+{
if (m_diagram -> isReadOnly()) return;
// recupere les conducteurs selectionnes
QSet selected_conductors = m_diagram -> selectedConductors();
@@ -1103,7 +1123,8 @@ bool DiagramView::isCtrlShifting(QInputEvent *e) {
/**
@return true if there is a selected item and that item has the focus.
*/
-bool DiagramView::selectedItemHasFocus() {
+bool DiagramView::selectedItemHasFocus()
+{
return(
m_diagram -> hasFocus() &&
m_diagram -> focusItem() &&
@@ -1115,7 +1136,8 @@ bool DiagramView::selectedItemHasFocus() {
@brief DiagramView::editSelection
Edit the selected item if he can be edited and if only one item is selected
*/
-void DiagramView::editSelection() {
+void DiagramView::editSelection()
+{
if (m_diagram -> isReadOnly() || m_diagram -> selectedItems().size() != 1 ) return;
QGraphicsItem *item = m_diagram->selectedItems().first();
@@ -1225,7 +1247,8 @@ void DiagramView::contextMenuEvent(QContextMenuEvent *e)
/**
@return l'editeur de schemas parent ou 0
*/
-QETDiagramEditor *DiagramView::diagramEditor() const {
+QETDiagramEditor *DiagramView::diagramEditor() const
+{
// remonte la hierarchie des widgets
QWidget *w = const_cast(this);
while (w -> parentWidget() && !w -> isWindow()) {
diff --git a/sources/dvevent/dveventinterface.cpp b/sources/dvevent/dveventinterface.cpp
index d436db1f5..c6000da25 100644
--- a/sources/dvevent/dveventinterface.cpp
+++ b/sources/dvevent/dveventinterface.cpp
@@ -28,7 +28,8 @@ DVEventInterface::DVEventInterface(DiagramView *dv) :
{
}
-DVEventInterface::~DVEventInterface() {
+DVEventInterface::~DVEventInterface()
+{
}
bool DVEventInterface::mouseDoubleClickEvent(QMouseEvent *event) {
@@ -80,10 +81,12 @@ bool DVEventInterface::KeyReleaseEvent(QKeyEvent *event) {
return false;
}
-bool DVEventInterface::isRunning() const {
+bool DVEventInterface::isRunning() const
+{
return m_running;
}
-bool DVEventInterface::isFinish() const {
+bool DVEventInterface::isFinish() const
+{
return !m_running;
}
diff --git a/sources/editor/arceditor.cpp b/sources/editor/arceditor.cpp
index 87cbcb5dd..73968d653 100644
--- a/sources/editor/arceditor.cpp
+++ b/sources/editor/arceditor.cpp
@@ -75,7 +75,8 @@ ArcEditor::ArcEditor(QETElementEditor *editor, PartArc *arc, QWidget *parent) :
}
/// Destructeur
-ArcEditor::~ArcEditor() {}
+ArcEditor::~ArcEditor()
+{}
void ArcEditor::setUpChangeConnections()
{
@@ -140,11 +141,13 @@ bool ArcEditor::setParts(QList parts)
@brief ArcEditor::currentPart
@return the curent edited part, or 0 if there is no edited part
*/
-CustomElementPart *ArcEditor::currentPart() const {
+CustomElementPart *ArcEditor::currentPart() const
+{
return(part);
}
-QList ArcEditor::currentParts() const {
+QList ArcEditor::currentParts() const
+{
return style_->currentParts();
}
diff --git a/sources/editor/editorcommands.cpp b/sources/editor/editorcommands.cpp
index 5597b10b7..3d4531f7a 100644
--- a/sources/editor/editorcommands.cpp
+++ b/sources/editor/editorcommands.cpp
@@ -56,13 +56,15 @@ ElementEditionCommand::ElementEditionCommand(const QString &text,
/**
Destructor
*/
-ElementEditionCommand::~ElementEditionCommand() {
+ElementEditionCommand::~ElementEditionCommand()
+{
}
/**
@return the element editor/scene the command should take place on
*/
-ElementScene *ElementEditionCommand::elementScene() const {
+ElementScene *ElementEditionCommand::elementScene() const
+{
return(m_scene);
}
@@ -76,7 +78,8 @@ void ElementEditionCommand::setElementScene(ElementScene *scene) {
/**
@return the view the effect of the command should be rendered on
*/
-ElementView *ElementEditionCommand::elementView() const {
+ElementView *ElementEditionCommand::elementView() const
+{
return(m_view);
}
@@ -108,14 +111,16 @@ DeletePartsCommand::DeletePartsCommand(
}
/// Destructeur : detruit egalement les parties supprimees
-DeletePartsCommand::~DeletePartsCommand() {
+DeletePartsCommand::~DeletePartsCommand()
+{
foreach(QGraphicsItem *qgi, deleted_parts) {
m_scene -> qgiManager().release(qgi);
}
}
/// Restaure les parties supprimees
-void DeletePartsCommand::undo() {
+void DeletePartsCommand::undo()
+{
m_scene -> blockSignals(true);
foreach(QGraphicsItem *qgi, deleted_parts) {
m_scene -> addItem(qgi);
@@ -124,7 +129,8 @@ void DeletePartsCommand::undo() {
}
/// Supprime les parties
-void DeletePartsCommand::redo() {
+void DeletePartsCommand::redo()
+{
m_scene -> blockSignals(true);
foreach(QGraphicsItem *qgi, deleted_parts) {
m_scene -> removeItem(qgi);
@@ -150,7 +156,8 @@ CutPartsCommand::CutPartsCommand(
}
/// Destructeur
-CutPartsCommand::~CutPartsCommand() {
+CutPartsCommand::~CutPartsCommand()
+{
}
/*** MovePartsCommand ***/
@@ -175,16 +182,19 @@ MovePartsCommand::MovePartsCommand(
}
/// Destructeur
-MovePartsCommand::~MovePartsCommand() {
+MovePartsCommand::~MovePartsCommand()
+{
}
/// Annule le deplacement
-void MovePartsCommand::undo() {
+void MovePartsCommand::undo()
+{
foreach(QGraphicsItem *qgi, moved_parts) qgi -> moveBy(-movement.x(), -movement.y());
}
/// Refait le deplacement
-void MovePartsCommand::redo() {
+void MovePartsCommand::redo()
+{
// le premier appel a redo, lors de la construction de l'objet, ne doit pas se faire
if (first_redo) {
first_redo = false;
@@ -215,17 +225,20 @@ AddPartCommand::AddPartCommand(
}
/// Destructeur
-AddPartCommand::~AddPartCommand() {
+AddPartCommand::~AddPartCommand()
+{
m_scene -> qgiManager().release(part);
}
/// Annule l'ajout
-void AddPartCommand::undo() {
+void AddPartCommand::undo()
+{
m_scene -> removeItem(part);
}
/// Refait l'ajout
-void AddPartCommand::redo() {
+void AddPartCommand::redo()
+{
// le premier appel a redo, lors de la construction de l'objet, ne doit pas se faire
if (first_redo) {
if (!part -> zValue()) {
@@ -262,16 +275,19 @@ ChangeNamesCommand::ChangeNamesCommand(
}
/// Destructeur
-ChangeNamesCommand::~ChangeNamesCommand() {
+ChangeNamesCommand::~ChangeNamesCommand()
+{
}
/// Annule le changement
-void ChangeNamesCommand::undo() {
+void ChangeNamesCommand::undo()
+{
m_scene -> setNames(names_before);
}
/// Refait le changement
-void ChangeNamesCommand::redo() {
+void ChangeNamesCommand::redo()
+{
m_scene -> setNames(names_after);
}
@@ -312,16 +328,19 @@ ChangeZValueCommand::ChangeZValueCommand(
}
/// Destructeur
-ChangeZValueCommand::~ChangeZValueCommand() {
+ChangeZValueCommand::~ChangeZValueCommand()
+{
}
/// Annule les changements de zValue
-void ChangeZValueCommand::undo() {
+void ChangeZValueCommand::undo()
+{
foreach(QGraphicsItem *qgi, undo_hash.keys()) qgi -> setZValue(undo_hash[qgi]);
}
/// Refait les changements de zValue
-void ChangeZValueCommand::redo() {
+void ChangeZValueCommand::redo()
+{
foreach(QGraphicsItem *qgi, redo_hash.keys()) qgi -> setZValue(redo_hash[qgi]);
}
@@ -423,16 +442,19 @@ ChangeInformationsCommand::ChangeInformationsCommand(ElementScene *elmt, const Q
}
/// Destructeur
-ChangeInformationsCommand::~ChangeInformationsCommand() {
+ChangeInformationsCommand::~ChangeInformationsCommand()
+{
}
/// Annule le changement d'autorisation pour les connexions internes
-void ChangeInformationsCommand::undo() {
+void ChangeInformationsCommand::undo()
+{
m_scene -> setInformations(old_informations_);
}
/// Refait le changement d'autorisation pour les connexions internes
-void ChangeInformationsCommand::redo() {
+void ChangeInformationsCommand::redo()
+{
m_scene -> setInformations(new_informations_);
}
@@ -449,20 +471,23 @@ ScalePartsCommand::ScalePartsCommand(ElementScene *scene, QUndoCommand * parent)
/**
Destructor
*/
-ScalePartsCommand::~ScalePartsCommand() {
+ScalePartsCommand::~ScalePartsCommand()
+{
}
/**
Undo the scaling operation
*/
-void ScalePartsCommand::undo() {
+void ScalePartsCommand::undo()
+{
scale(new_rect_, original_rect_);
}
/**
Redo the scaling operation
*/
-void ScalePartsCommand::redo() {
+void ScalePartsCommand::redo()
+{
if (first_redo) {
first_redo = false;
return;
@@ -473,7 +498,8 @@ void ScalePartsCommand::redo() {
/**
@return the element editor/scene the command should take place on
*/
-ElementScene *ScalePartsCommand::elementScene() const {
+ElementScene *ScalePartsCommand::elementScene() const
+{
return(m_scene);
}
@@ -488,7 +514,8 @@ void ScalePartsCommand::setScaledPrimitives(const QList &pr
/**
@return the list of primitives to be scaled by this command
*/
-QList ScalePartsCommand::scaledPrimitives() const {
+QList ScalePartsCommand::scaledPrimitives() const
+{
return(scaled_primitives_);
}
@@ -511,7 +538,8 @@ void ScalePartsCommand::setTransformation(const QRectF &original_rect,
are the bounding rectangles for all scaled primitives respectively before
and after the operation.
*/
-QPair ScalePartsCommand::transformation() {
+QPair ScalePartsCommand::transformation()
+{
return(QPair(original_rect_, new_rect_));
}
@@ -532,7 +560,8 @@ void ScalePartsCommand::scale(const QRectF &before, const QRectF &after) {
/**
Generate the text describing what this command does exactly.
*/
-void ScalePartsCommand::adjustText() {
+void ScalePartsCommand::adjustText()
+{
if (scaled_primitives_.count() == 1) {
setText(QObject::tr("redimensionnement %1", "undo caption -- %1 is the resized primitive type name").arg(scaled_primitives_.first() -> name()));
} else {
@@ -562,7 +591,8 @@ ChangePropertiesCommand::ChangePropertiesCommand(
setText(QObject::tr("Modifier les propriétés"));
}
-ChangePropertiesCommand::~ChangePropertiesCommand() {}
+ChangePropertiesCommand::~ChangePropertiesCommand()
+{}
void ChangePropertiesCommand::undo()
{
diff --git a/sources/editor/elementitemeditor.cpp b/sources/editor/elementitemeditor.cpp
index da75df7b6..c87f15a03 100644
--- a/sources/editor/elementitemeditor.cpp
+++ b/sources/editor/elementitemeditor.cpp
@@ -31,22 +31,26 @@ ElementItemEditor::ElementItemEditor(QETElementEditor *editor, QWidget *parent)
}
/// @return le QETElementEditor auquel cet editeur appartient
-QETElementEditor *ElementItemEditor::elementEditor() const {
+QETElementEditor *ElementItemEditor::elementEditor() const
+{
return(element_editor);
}
/// @return l'ElementScene contenant les parties editees par cet editeur
-ElementScene *ElementItemEditor::elementScene() const {
+ElementScene *ElementItemEditor::elementScene() const
+{
return(element_editor -> elementScene());
}
/// @return la QUndoStack a utiliser pour les annulations
-QUndoStack &ElementItemEditor::undoStack() const {
+QUndoStack &ElementItemEditor::undoStack() const
+{
return(elementScene() -> undoStack());
}
/// @return Le nom du type d'element edite
-QString ElementItemEditor::elementTypeName() const {
+QString ElementItemEditor::elementTypeName() const
+{
return(element_type_name);
}
@@ -60,6 +64,7 @@ void ElementItemEditor::setElementTypeName(const QString &name) {
Equivaut a setPart(0)
@see setPart
*/
-void ElementItemEditor::detach() {
+void ElementItemEditor::detach()
+{
setPart(nullptr);
}
diff --git a/sources/editor/elementprimitivedecorator.cpp b/sources/editor/elementprimitivedecorator.cpp
index e9c56b7d1..69c84bcbe 100644
--- a/sources/editor/elementprimitivedecorator.cpp
+++ b/sources/editor/elementprimitivedecorator.cpp
@@ -48,7 +48,8 @@ ElementPrimitiveDecorator::~ElementPrimitiveDecorator()
@return the internal bouding rect, i.e. the smallest rectangle containing
the bounding rectangle of every selected item.
*/
-QRectF ElementPrimitiveDecorator::internalBoundingRect() const {
+QRectF ElementPrimitiveDecorator::internalBoundingRect() const
+{
if (!decorated_items_.count() || !scene()) return(QRectF());
//if @decorated_items_ contain one item and if this item is a vertical or horizontal partline, apply a specific methode
@@ -139,14 +140,16 @@ void ElementPrimitiveDecorator::setItems(const QList &items)
/**
@return the list of items this decorator is supposed to manipulate
*/
-QList ElementPrimitiveDecorator::items() const {
+QList ElementPrimitiveDecorator::items() const
+{
return(decorated_items_);
}
/**
@return the list of items this decorator is supposed to manipulate
*/
-QList ElementPrimitiveDecorator::graphicsItems() const {
+QList ElementPrimitiveDecorator::graphicsItems() const
+{
QList list;
foreach (CustomElementPart *part_item, decorated_items_) {
if (QGraphicsItem *item = dynamic_cast(part_item)) {
@@ -337,7 +340,8 @@ void ElementPrimitiveDecorator::init()
/**
Save the original bounding rectangle.
*/
-void ElementPrimitiveDecorator::saveOriginalBoundingRect() {
+void ElementPrimitiveDecorator::saveOriginalBoundingRect()
+{
original_bounding_rect_ = internalBoundingRect();
}
@@ -345,7 +349,8 @@ void ElementPrimitiveDecorator::saveOriginalBoundingRect() {
Adjust the effective bounding rect. This method should be called after the
modified_bouding_rect_ attribute was modified.
*/
-void ElementPrimitiveDecorator::adjustEffectiveBoundingRect() {
+void ElementPrimitiveDecorator::adjustEffectiveBoundingRect()
+{
prepareGeometryChange();
effective_bounding_rect_ = modified_bounding_rect_ | effective_bounding_rect_;
update();
@@ -355,7 +360,8 @@ void ElementPrimitiveDecorator::adjustEffectiveBoundingRect() {
/**
Start a movement (i.e. either a move or scaling operation)
*/
-void ElementPrimitiveDecorator::startMovement() {
+void ElementPrimitiveDecorator::startMovement()
+{
adjust();
foreach(CustomElementPart *item, decorated_items_) {
@@ -409,7 +415,8 @@ void ElementPrimitiveDecorator::applyMovementToRect(int movement_type, const QPo
}
}
-CustomElementPart *ElementPrimitiveDecorator::singleItem() const {
+CustomElementPart *ElementPrimitiveDecorator::singleItem() const
+{
if (decorated_items_.count() == 1) {
return(decorated_items_.first());
}
@@ -450,7 +457,8 @@ void ElementPrimitiveDecorator::scaleItems(const QRectF &original_rect, const QR
/**
@return the bounding rectangle of \a item, in scene coordinates
*/
-QRectF ElementPrimitiveDecorator::getSceneBoundingRect(QGraphicsItem *item) const {
+QRectF ElementPrimitiveDecorator::getSceneBoundingRect(QGraphicsItem *item) const
+{
if (!item) return(QRectF());
return(item -> mapRectToScene(item -> boundingRect()));
}
@@ -655,7 +663,8 @@ QPointF ElementPrimitiveDecorator::deltaForRoundScaling(const QRectF &original,
Round the coordinates of \a point so it is snapped to the grid defined by the
grid_step_x_ and grid_step_y_ attributes.
*/
-QPointF ElementPrimitiveDecorator::snapConstPointToGrid(const QPointF &point) const {
+QPointF ElementPrimitiveDecorator::snapConstPointToGrid(const QPointF &point) const
+{
return(
QPointF(
qRound(point.x() / grid_step_x_) * grid_step_x_,
@@ -668,7 +677,8 @@ QPointF ElementPrimitiveDecorator::snapConstPointToGrid(const QPointF &point) co
Round the coordinates of \a point so it is snapped to the grid defined by the
grid_step_x_ and grid_step_y_ attributes.
*/
-void ElementPrimitiveDecorator::snapPointToGrid(QPointF &point) const {
+void ElementPrimitiveDecorator::snapPointToGrid(QPointF &point) const
+{
point.rx() = qRound(point.x() / grid_step_x_) * grid_step_x_;
point.ry() = qRound(point.y() / grid_step_y_) * grid_step_y_;
}
diff --git a/sources/editor/elementscene.cpp b/sources/editor/elementscene.cpp
index 3b9f3b442..deaada775 100644
--- a/sources/editor/elementscene.cpp
+++ b/sources/editor/elementscene.cpp
@@ -347,7 +347,8 @@ void ElementScene::setBehavior(ElementScene::Behavior b) {
m_behavior = b;
}
-ElementScene::Behavior ElementScene::behavior() const {
+ElementScene::Behavior ElementScene::behavior() const
+{
return m_behavior;
}
@@ -356,7 +357,8 @@ ElementScene::Behavior ElementScene::behavior() const {
@return the horizontal size of the grid
\~French la taille horizontale de la grille
*/
-int ElementScene::xGrid() const {
+int ElementScene::xGrid() const
+{
return(m_x_grid);
}
@@ -365,7 +367,8 @@ int ElementScene::xGrid() const {
@return vertical grid size
\~French la taille verticale de la grille
*/
-int ElementScene::yGrid() const {
+int ElementScene::yGrid() const
+{
return(m_y_grid);
}
@@ -580,7 +583,8 @@ QRectF ElementScene::elementSceneGeometricRect() const{
\~French true si l'element comporte au moins une borne,
false s'il n'en a aucune.
*/
-bool ElementScene::containsTerminals() const {
+bool ElementScene::containsTerminals() const
+{
foreach(QGraphicsItem *qgi,items()) {
if (qgraphicsitem_cast(qgi)) {
return(true);
@@ -594,7 +598,8 @@ bool ElementScene::containsTerminals() const {
@return the undo stack of this element editor
\~French la pile d'annulations de cet editeur d'element
*/
-QUndoStack &ElementScene::undoStack() {
+QUndoStack &ElementScene::undoStack()
+{
return(m_undo_stack);
}
@@ -603,7 +608,8 @@ QUndoStack &ElementScene::undoStack() {
@return the QGraphicsItem manager of this item editor
\~French le gestionnaire de QGraphicsItem de cet editeur d'element
*/
-QGIManager &ElementScene::qgiManager() {
+QGIManager &ElementScene::qgiManager()
+{
return(m_qgi_manager);
}
@@ -612,7 +618,8 @@ QGIManager &ElementScene::qgiManager() {
@return true if the clipboard appears to contain an element
\~French true si le presse-papier semble contenir un element
*/
-bool ElementScene::clipboardMayContainElement() {
+bool ElementScene::clipboardMayContainElement()
+{
QString clipboard_text = QApplication::clipboard() -> text().trimmed();
bool may_be_element = clipboard_text.startsWith("");
@@ -639,7 +646,8 @@ bool ElementScene::wasCopiedFromThisElement(const QString &clipboard_content) {
\~French Gere le fait de couper la selection
= l'exporter en XML dans le presse-papier puis la supprimer.
*/
-void ElementScene::cut() {
+void ElementScene::cut()
+{
copy();
QList cut_content = selectedItems();
clearSelection();
@@ -653,7 +661,8 @@ void ElementScene::cut() {
\~French Gere le fait de copier la selection
= l'exporter en XML dans lepresse-papier.
*/
-void ElementScene::copy() {
+void ElementScene::copy()
+{
// accede au presse-papier
QClipboard *clipboard = QApplication::clipboard();
@@ -674,7 +683,8 @@ void ElementScene::copy() {
@brief ElementScene::editor
@return
*/
-QETElementEditor* ElementScene::editor() const {
+QETElementEditor* ElementScene::editor() const
+{
return m_element_editor;
}
@@ -727,7 +737,8 @@ void ElementScene::slot_select(const ElementContent &content)
@brief ElementScene::slot_selectAll
Select all items
*/
-void ElementScene::slot_selectAll() {
+void ElementScene::slot_selectAll()
+{
slot_select(items());
}
@@ -735,7 +746,8 @@ void ElementScene::slot_selectAll() {
@brief ElementScene::slot_deselectAll
deselect all item
*/
-void ElementScene::slot_deselectAll() {
+void ElementScene::slot_deselectAll()
+{
slot_select(ElementContent());
}
@@ -744,7 +756,8 @@ void ElementScene::slot_deselectAll() {
Inverse Selection
\~French Inverse la selection
*/
-void ElementScene::slot_invertSelection() {
+void ElementScene::slot_invertSelection()
+{
blockSignals(true);
foreach(QGraphicsItem *qgi,
items()) qgi -> setSelected(!qgi -> isSelected());
@@ -757,7 +770,8 @@ void ElementScene::slot_invertSelection() {
Delete selected items
\~French Supprime les elements selectionnes
*/
-void ElementScene::slot_delete() {
+void ElementScene::slot_delete()
+{
// check that there is something selected
// verifie qu'il y a qqc de selectionne
QList selected_items = selectedItems();
@@ -781,7 +795,8 @@ void ElementScene::slot_delete() {
de cet element. Concretement, ce champ libre est destine a accueillir
des informations sur l'auteur de l'element, sa licence, etc.
*/
-void ElementScene::slot_editAuthorInformations() {
+void ElementScene::slot_editAuthorInformations()
+{
bool is_read_only = m_element_editor && m_element_editor -> isReadOnly();
// create a dialogue
@@ -886,7 +901,8 @@ void ElementScene::slot_editNames()
@brief ElementScene::primitives
@return the list of primitives currently present on the scene.
*/
-QList ElementScene::primitives() const {
+QList ElementScene::primitives() const
+{
QList primitives_list;
foreach (QGraphicsItem *item, items()) {
if (CustomElementPart *primitive = dynamic_cast(item)) {
@@ -902,7 +918,8 @@ QList ElementScene::primitives() const {
@return the parts of the element ordered by increasing zValue
\~French les parties de l'element ordonnes par zValue croissante
*/
-QList ElementScene::zItems(ItemOptions options) const {
+QList ElementScene::zItems(ItemOptions options) const
+{
// handle dummy request, i.e. when neither Selected nor NonSelected are set
if (!(options & ElementScene::Selected)
&&
@@ -968,7 +985,8 @@ QList ElementScene::zItems(ItemOptions options) const {
@return the selected graphic parts
\~French les parties graphiques selectionnees
*/
-ElementContent ElementScene::selectedContent() const {
+ElementContent ElementScene::selectedContent() const
+{
ElementContent content;
foreach(QGraphicsItem *qgi, zItems()) {
if (qgi -> isSelected()) content << qgi;
@@ -1031,7 +1049,8 @@ void ElementScene::reset()
exprime dans les coordonnes de la scene
*/
QRectF ElementScene::elementContentBoundingRect(
- const ElementContent &content) const {
+ const ElementContent &content) const
+{
QRectF bounding_rect;
foreach(QGraphicsItem *qgi, content) {
// skip non-primitives QGraphicsItems (paste area, selection decorator)
@@ -1234,7 +1253,8 @@ void ElementScene::addPrimitive(QGraphicsItem *primitive) {
Initializes the paste area
\~French Initialise la zone de collage
*/
-void ElementScene::initPasteArea() {
+void ElementScene::initPasteArea()
+{
m_paste_area = new QGraphicsRectItem();
m_paste_area -> setZValue(1000000);
@@ -1282,7 +1302,8 @@ bool ElementScene::zValueLessThan(QGraphicsItem *item1, QGraphicsItem *item2) {
try to center better is possible the element to the scene
(the calcul isn't optimal but work good)
*/
-void ElementScene::centerElementToOrigine() {
+void ElementScene::centerElementToOrigine()
+{
QRectF size= elementSceneGeometricRect();
int center_x = qRound(size.center().x());
int center_y = qRound(size.center().y());
diff --git a/sources/editor/elementscene.h b/sources/editor/elementscene.h
index 873267008..5199c9d5d 100644
--- a/sources/editor/elementscene.h
+++ b/sources/editor/elementscene.h
@@ -192,7 +192,8 @@ inline void ElementScene::setNames(const NamesList &nameslist) {
@brief ElementScene::names
@return the list of names of the currently edited element
*/
-inline NamesList ElementScene::names() const {
+inline NamesList ElementScene::names() const
+{
return(m_names_list);
}
@@ -200,7 +201,8 @@ inline NamesList ElementScene::names() const {
@brief ElementScene::informations
@return extra informations of the currently edited element
*/
-inline QString ElementScene::informations() const {
+inline QString ElementScene::informations() const
+{
return(m_informations);
}
diff --git a/sources/editor/elementview.cpp b/sources/editor/elementview.cpp
index ef04c4dc9..8eb65c465 100644
--- a/sources/editor/elementview.cpp
+++ b/sources/editor/elementview.cpp
@@ -41,18 +41,21 @@ ElementView::ElementView(ElementScene *scene, QWidget *parent) :
}
/// Destructeur
-ElementView::~ElementView() {
+ElementView::~ElementView()
+{
}
/// @return l'ElementScene visualisee par cette ElementView
-ElementScene *ElementView::scene() const {
+ElementScene *ElementView::scene() const
+{
return(m_scene);
}
/**
@return le rectangle de l'element visualise par cet ElementView
*/
-QRectF ElementView::viewedSceneRect() const {
+QRectF ElementView::viewedSceneRect() const
+{
// recupere la taille du widget viewport
QSize viewport_size = viewport() -> size();
@@ -79,7 +82,8 @@ void ElementView::setScene(ElementScene *s) {
/**
Set the Diagram in visualisation mode
*/
-void ElementView::setVisualisationMode() {
+void ElementView::setVisualisationMode()
+{
setDragMode(ScrollHandDrag);
setInteractive(false);
emit(modeChanged());
@@ -88,7 +92,8 @@ void ElementView::setVisualisationMode() {
/**
Set the Diagram in Selection mode
*/
-void ElementView::setSelectionMode() {
+void ElementView::setSelectionMode()
+{
setDragMode(RubberBandDrag);
setInteractive(true);
emit(modeChanged());
@@ -97,7 +102,8 @@ void ElementView::setSelectionMode() {
/**
Agrandit le schema (+33% = inverse des -25 % de zoomMoins())
*/
-void ElementView::zoomIn() {
+void ElementView::zoomIn()
+{
adjustSceneRect();
scale(4.0/3.0, 4.0/3.0);
}
@@ -105,7 +111,8 @@ void ElementView::zoomIn() {
/**
Retrecit le schema (-25% = inverse des +33 % de zoomPlus())
*/
-void ElementView::zoomOut() {
+void ElementView::zoomOut()
+{
adjustSceneRect();
scale(0.75, 0.75);
}
@@ -113,14 +120,16 @@ void ElementView::zoomOut() {
/**
Agrandit le schema avec le trackpad
*/
-void ElementView::zoomInSlowly() {
+void ElementView::zoomInSlowly()
+{
scale(1.02, 1.02);
}
/**
Retrecit le schema avec le trackpad
*/
-void ElementView::zoomOutSlowly() {
+void ElementView::zoomOutSlowly()
+{
scale(0.98, 0.98);
}
@@ -129,7 +138,8 @@ void ElementView::zoomOutSlowly() {
schema soient visibles a l'ecran. S'il n'y a aucun element sur le schema,
le zoom est reinitialise
*/
-void ElementView::zoomFit() {
+void ElementView::zoomFit()
+{
resetSceneRect();
fitInView(sceneRect(), Qt::KeepAspectRatio);
}
@@ -137,7 +147,8 @@ void ElementView::zoomFit() {
/**
Reinitialise le zoom
*/
-void ElementView::zoomReset() {
+void ElementView::zoomReset()
+{
resetSceneRect();
resetTransform();
scale(4.0, 4.0);
@@ -148,7 +159,8 @@ void ElementView::zoomReset() {
Adjust the scenRect, so that he include all primitives of element
plus the viewport of the scene with a margin of 1/3 of herself
*/
-void ElementView::adjustSceneRect() {
+void ElementView::adjustSceneRect()
+{
QRectF esgr = m_scene -> elementSceneGeometricRect();
QRectF vpbr = mapToScene(this -> viewport()->rect()).boundingRect();
QRectF new_scene_rect = vpbr.adjusted(-vpbr.width()/3, -vpbr.height()/3, vpbr.width()/3, vpbr.height()/3);
@@ -160,7 +172,8 @@ void ElementView::adjustSceneRect() {
reset le sceneRect (zone du schéma visualisée par l'ElementView) afin que
celui-ci inclut uniquement les primitives de l'élément dessiné.
*/
-void ElementView::resetSceneRect() {
+void ElementView::resetSceneRect()
+{
setSceneRect(m_scene -> elementSceneGeometricRect());
}
@@ -168,7 +181,8 @@ void ElementView::resetSceneRect() {
Gere le fait de couper la selection = l'exporter en XML dans le
presse-papier puis la supprimer.
*/
-void ElementView::cut() {
+void ElementView::cut()
+{
// delegue cette action a la scene
m_scene -> cut();
offset_paste_count_ = -1;
@@ -178,7 +192,8 @@ void ElementView::cut() {
Gere le fait de copier la selection = l'exporter en XML dans le
presse-papier.
*/
-void ElementView::copy() {
+void ElementView::copy()
+{
// delegue cette action a la scene
m_scene -> copy();
offset_paste_count_ = 0;
@@ -194,7 +209,8 @@ void ElementView::copy() {
collage devra s'effectuer.
@see pasteAreaDefined(const QRectF &)
*/
-void ElementView::paste() {
+void ElementView::paste()
+{
QString clipboard_text = QApplication::clipboard() -> text();
if (clipboard_text.isEmpty()) return;
@@ -218,7 +234,8 @@ void ElementView::paste() {
Colle le contenu du presse-papier en demandant systematiquement a
l'utilisateur de choisir une zone de collage
*/
-void ElementView::pasteInArea() {
+void ElementView::pasteInArea()
+{
QString clipboard_text = QApplication::clipboard() -> text();
if (clipboard_text.isEmpty()) return;
diff --git a/sources/editor/ellipseeditor.cpp b/sources/editor/ellipseeditor.cpp
index b414bdfc6..02c6d7a01 100644
--- a/sources/editor/ellipseeditor.cpp
+++ b/sources/editor/ellipseeditor.cpp
@@ -67,7 +67,8 @@ EllipseEditor::EllipseEditor(QETElementEditor *editor, PartEllipse *ellipse, QWi
}
/// Destructeur
-EllipseEditor::~EllipseEditor() {
+EllipseEditor::~EllipseEditor()
+{
}
void EllipseEditor::setUpChangeConnections()
@@ -126,11 +127,13 @@ bool EllipseEditor::setParts(QList parts)
/**
@return la primitive actuellement editee, ou 0 si ce widget n'en edite pas
*/
-CustomElementPart *EllipseEditor::currentPart() const {
+CustomElementPart *EllipseEditor::currentPart() const
+{
return(part);
}
-QList EllipseEditor::currentParts() const {
+QList EllipseEditor::currentParts() const
+{
return style_->currentParts();
}
diff --git a/sources/editor/esevent/eseventaddarc.cpp b/sources/editor/esevent/eseventaddarc.cpp
index 5f37f4981..2fc758287 100644
--- a/sources/editor/esevent/eseventaddarc.cpp
+++ b/sources/editor/esevent/eseventaddarc.cpp
@@ -35,7 +35,8 @@ ESEventAddArc::ESEventAddArc(ElementScene *scene) :
/**
@brief ESEventAddArc::~ESEventAddArc
*/
-ESEventAddArc::~ESEventAddArc() {
+ESEventAddArc::~ESEventAddArc()
+{
if (m_running || m_abort)
delete m_arc;
}
diff --git a/sources/editor/esevent/eseventadddynamictextfield.cpp b/sources/editor/esevent/eseventadddynamictextfield.cpp
index 9933ce513..32e14989d 100644
--- a/sources/editor/esevent/eseventadddynamictextfield.cpp
+++ b/sources/editor/esevent/eseventadddynamictextfield.cpp
@@ -37,7 +37,8 @@ ESEventAddDynamicTextField::ESEventAddDynamicTextField(ElementScene *scene) :
/**
@brief ESEventAddDynamicTextField::~ESEventAddDynamicTextField
*/
-ESEventAddDynamicTextField::~ESEventAddDynamicTextField() {
+ESEventAddDynamicTextField::~ESEventAddDynamicTextField()
+{
delete m_text;
}
diff --git a/sources/editor/esevent/eseventaddellipse.cpp b/sources/editor/esevent/eseventaddellipse.cpp
index 4fa910ab0..485228fbf 100644
--- a/sources/editor/esevent/eseventaddellipse.cpp
+++ b/sources/editor/esevent/eseventaddellipse.cpp
@@ -34,7 +34,8 @@ ESEventAddEllipse::ESEventAddEllipse(ElementScene *scene) :
/**
@brief ESEventAddEllipse::~ESEventAddEllipse
*/
-ESEventAddEllipse::~ESEventAddEllipse() {
+ESEventAddEllipse::~ESEventAddEllipse()
+{
if (m_running || m_abort){
delete m_ellipse;
}
diff --git a/sources/editor/esevent/eseventaddline.cpp b/sources/editor/esevent/eseventaddline.cpp
index 7c7373775..bca0880f9 100644
--- a/sources/editor/esevent/eseventaddline.cpp
+++ b/sources/editor/esevent/eseventaddline.cpp
@@ -38,7 +38,8 @@ ESEventAddLine::ESEventAddLine(ElementScene *scene) :
@brief ESEventAddLine::~ESEventAddLine
destructor
*/
-ESEventAddLine::~ESEventAddLine() {
+ESEventAddLine::~ESEventAddLine()
+{
if (m_running || m_abort)
delete m_line;
}
diff --git a/sources/editor/esevent/eseventaddpolygon.cpp b/sources/editor/esevent/eseventaddpolygon.cpp
index 07dc78789..75f7cd6aa 100644
--- a/sources/editor/esevent/eseventaddpolygon.cpp
+++ b/sources/editor/esevent/eseventaddpolygon.cpp
@@ -34,7 +34,8 @@ ESEventAddPolygon::ESEventAddPolygon(ElementScene *scene) :
/**
@brief ESEventAddPolygon::~ESEventAddPolygon
*/
-ESEventAddPolygon::~ESEventAddPolygon() {
+ESEventAddPolygon::~ESEventAddPolygon()
+{
if (m_running || m_abort)
delete m_polygon;
}
diff --git a/sources/editor/esevent/eseventaddrect.cpp b/sources/editor/esevent/eseventaddrect.cpp
index 0e3386701..4a85fe1a4 100644
--- a/sources/editor/esevent/eseventaddrect.cpp
+++ b/sources/editor/esevent/eseventaddrect.cpp
@@ -34,7 +34,8 @@ ESEventAddRect::ESEventAddRect(ElementScene *scene) :
/**
@brief ESEventAddRect::~ESEventAddRect
*/
-ESEventAddRect::~ESEventAddRect() {
+ESEventAddRect::~ESEventAddRect()
+{
if (m_running || m_abort)
delete m_rect;
}
diff --git a/sources/editor/esevent/eseventaddterminal.cpp b/sources/editor/esevent/eseventaddterminal.cpp
index beac60416..3e34a5072 100644
--- a/sources/editor/esevent/eseventaddterminal.cpp
+++ b/sources/editor/esevent/eseventaddterminal.cpp
@@ -37,7 +37,8 @@ ESEventAddTerminal::ESEventAddTerminal(ElementScene *scene) :
/**
@brief ESEventAddTerminal::~ESEventAddTerminal
*/
-ESEventAddTerminal::~ESEventAddTerminal() {
+ESEventAddTerminal::~ESEventAddTerminal()
+{
delete m_terminal;
}
diff --git a/sources/editor/esevent/eseventaddtext.cpp b/sources/editor/esevent/eseventaddtext.cpp
index 041747a1f..6ddcfbbc0 100644
--- a/sources/editor/esevent/eseventaddtext.cpp
+++ b/sources/editor/esevent/eseventaddtext.cpp
@@ -37,7 +37,8 @@ ESEventAddText::ESEventAddText(ElementScene *scene) :
/**
@brief ESEventAddText::~ESEventAddText
*/
-ESEventAddText::~ESEventAddText() {
+ESEventAddText::~ESEventAddText()
+{
delete m_text;
}
diff --git a/sources/editor/esevent/eseventinterface.cpp b/sources/editor/esevent/eseventinterface.cpp
index d44fa0811..0cc2825dc 100644
--- a/sources/editor/esevent/eseventinterface.cpp
+++ b/sources/editor/esevent/eseventinterface.cpp
@@ -99,11 +99,13 @@ bool ESEventInterface::KeyReleaseEvent(QKeyEvent *event) {
return false;
}
-bool ESEventInterface::isRunning() const {
+bool ESEventInterface::isRunning() const
+{
return m_running;
}
-bool ESEventInterface::isFinish() const {
+bool ESEventInterface::isFinish() const
+{
return !m_running;
}
diff --git a/sources/editor/graphicspart/abstractpartellipse.cpp b/sources/editor/graphicspart/abstractpartellipse.cpp
index 32a1920fd..68d3e5c59 100644
--- a/sources/editor/graphicspart/abstractpartellipse.cpp
+++ b/sources/editor/graphicspart/abstractpartellipse.cpp
@@ -87,7 +87,8 @@ QRectF AbstractPartEllipse::boundingRect() const
and it is different from shape because it is a regular
rectangle, not a complex shape.
*/
-QRectF AbstractPartEllipse::sceneGeometricRect() const {
+QRectF AbstractPartEllipse::sceneGeometricRect() const
+{
return(mapToScene(rect()).boundingRect());
}
@@ -95,7 +96,8 @@ QRectF AbstractPartEllipse::sceneGeometricRect() const {
@brief AbstractPartEllipse::sceneTopLeft
@return return the top left of rectangle, in scene coordinate
*/
-QPointF AbstractPartEllipse::sceneTopLeft() const {
+QPointF AbstractPartEllipse::sceneTopLeft() const
+{
return(mapToScene(rect().topLeft()));
}
@@ -103,7 +105,8 @@ QPointF AbstractPartEllipse::sceneTopLeft() const {
@brief AbstractPartEllipse::rect
Returns the item's ellipse geometry as a QRectF.
*/
-QRectF AbstractPartEllipse::rect() const {
+QRectF AbstractPartEllipse::rect() const
+{
return m_rect;
}
@@ -131,7 +134,8 @@ void AbstractPartEllipse::setRect(const QRectF &rect)
and does not deserve to be Retained / registered.
An ellipse is relevant when is rect is not null.
*/
-bool AbstractPartEllipse::isUseless() const {
+bool AbstractPartEllipse::isUseless() const
+{
return(rect().isNull());
}
diff --git a/sources/editor/graphicspart/customelementpart.cpp b/sources/editor/graphicspart/customelementpart.cpp
index f04dca94d..979267b76 100644
--- a/sources/editor/graphicspart/customelementpart.cpp
+++ b/sources/editor/graphicspart/customelementpart.cpp
@@ -19,7 +19,8 @@
#include "qetelementeditor.h"
/// @return le QETElementEditor auquel cet editeur appartient
-QETElementEditor *CustomElementPart::elementEditor() const {
+QETElementEditor *CustomElementPart::elementEditor() const
+{
return(element_editor);
}
@@ -27,24 +28,28 @@ QETElementEditor *CustomElementPart::elementEditor() const {
Appelle le slot updateCurrentPartEditor de l'editeur
@see QETElementEditor::updateCurrentPartEditor()
*/
-void CustomElementPart::updateCurrentPartEditor() const {
+void CustomElementPart::updateCurrentPartEditor() const
+{
if (element_editor) {
element_editor -> updateCurrentPartEditor();
}
}
/// @return l'ElementScene contenant les parties editees par cet editeur
-ElementScene *CustomElementPart::elementScene() const {
+ElementScene *CustomElementPart::elementScene() const
+{
return(element_editor -> elementScene());
}
/// @return la QUndoStack a utiliser pour les annulations
-QUndoStack &CustomElementPart::undoStack() const {
+QUndoStack &CustomElementPart::undoStack() const
+{
return(elementScene() -> undoStack());
}
/// @return this primitive as a QGraphicsItem
-QGraphicsItem *CustomElementPart::toItem() {
+QGraphicsItem *CustomElementPart::toItem()
+{
return(dynamic_cast(this));
}
@@ -55,7 +60,8 @@ QGraphicsItem *CustomElementPart::toItem() {
The default implementation systematically returns
QET::SnapScalingPointToGrid
*/
-QET::ScalingMethod CustomElementPart::preferredScalingMethod() const {
+QET::ScalingMethod CustomElementPart::preferredScalingMethod() const
+{
return(QET::SnapScalingPointToGrid);
}
diff --git a/sources/editor/graphicspart/partarc.cpp b/sources/editor/graphicspart/partarc.cpp
index 344f6a8e0..0129ff920 100644
--- a/sources/editor/graphicspart/partarc.cpp
+++ b/sources/editor/graphicspart/partarc.cpp
@@ -95,7 +95,8 @@ void PartArc::paint(QPainter *painter, const QStyleOptionGraphicsItem *options,
@param xml_document : Xml document to use for create the xml element.
@return : an xml element that describe this arc
*/
-const QDomElement PartArc::toXml(QDomDocument &xml_document) const {
+const QDomElement PartArc::toXml(QDomDocument &xml_document) const
+{
QDomElement xml_element = xml_document.createElement("arc");
QPointF top_left(sceneTopLeft());
xml_element.setAttribute("x", QString("%1").arg(top_left.x()));
diff --git a/sources/editor/graphicspart/partdynamictextfield.cpp b/sources/editor/graphicspart/partdynamictextfield.cpp
index 03f3033cb..30693d7c8 100644
--- a/sources/editor/graphicspart/partdynamictextfield.cpp
+++ b/sources/editor/graphicspart/partdynamictextfield.cpp
@@ -49,11 +49,13 @@ PartDynamicTextField::PartDynamicTextField(QETElementEditor *editor, QGraphicsIt
document() -> setDefaultTextOption(option);
}
-QString PartDynamicTextField::name() const {
+QString PartDynamicTextField::name() const
+{
return tr("Champ de texte dynamique", "element part name");
}
-QString PartDynamicTextField::xmlName() const {
+QString PartDynamicTextField::xmlName() const
+{
return QString("dynamic_text");
}
@@ -90,7 +92,8 @@ void PartDynamicTextField::handleUserTransformation(
@param dom_doc
@return
*/
-const QDomElement PartDynamicTextField::toXml(QDomDocument &dom_doc) const {
+const QDomElement PartDynamicTextField::toXml(QDomDocument &dom_doc) const
+{
QDomElement root_element = dom_doc.createElement(xmlName());
root_element.setAttribute("x", QString::number(pos().x()));
@@ -260,7 +263,8 @@ void PartDynamicTextField::fromTextFieldXml(const QDomElement &dom_element)
@brief PartDynamicTextField::textFrom
@return what the final text is created from.
*/
-DynamicElementTextItem::TextFrom PartDynamicTextField::textFrom() const {
+DynamicElementTextItem::TextFrom PartDynamicTextField::textFrom() const
+{
return m_text_from;
}
@@ -291,7 +295,8 @@ void PartDynamicTextField::setTextFrom(DynamicElementTextItem::TextFrom text_fro
@brief PartDynamicTextField::text
@return the text of this text
*/
-QString PartDynamicTextField::text() const {
+QString PartDynamicTextField::text() const
+{
return m_text;
}
@@ -337,7 +342,8 @@ void PartDynamicTextField::setCompositeText(const QString &text) {
@brief PartDynamicTextField::compositeText
@return the composite text of this text
*/
-QString PartDynamicTextField::compositeText() const {
+QString PartDynamicTextField::compositeText() const
+{
return m_composite_text;
}
@@ -354,7 +360,8 @@ void PartDynamicTextField::setColor(const QColor& color) {
@brief PartDynamicTextField::color
@return The color of this text
*/
-QColor PartDynamicTextField::color() const {
+QColor PartDynamicTextField::color() const
+{
return defaultTextColor();
}
@@ -364,7 +371,8 @@ void PartDynamicTextField::setFrame(bool frame) {
emit frameChanged(m_frame);
}
-bool PartDynamicTextField::frame() const {
+bool PartDynamicTextField::frame() const
+{
return m_frame;
}
@@ -403,7 +411,8 @@ void PartDynamicTextField::setAlignment(Qt::Alignment alignment) {
emit alignmentChanged(m_alignment);
}
-Qt::Alignment PartDynamicTextField::alignment() const {
+Qt::Alignment PartDynamicTextField::alignment() const
+{
return m_alignment;
}
@@ -532,7 +541,8 @@ void PartDynamicTextField::paint(QPainter *painter, const QStyleOptionGraphicsIt
Used to up to date this text field,
when the element information (see elementScene) changed
*/
-void PartDynamicTextField::elementInfoChanged() {
+void PartDynamicTextField::elementInfoChanged()
+{
if(!elementScene())
return;
@@ -543,11 +553,13 @@ void PartDynamicTextField::elementInfoChanged() {
m_composite_text, elementScene() -> elementInformation()));
}
-void PartDynamicTextField::prepareAlignment() {
+void PartDynamicTextField::prepareAlignment()
+{
m_alignment_rect = boundingRect();
}
-void PartDynamicTextField::finishAlignment() {
+void PartDynamicTextField::finishAlignment()
+{
if(m_block_alignment)
return;
diff --git a/sources/editor/graphicspart/partline.cpp b/sources/editor/graphicspart/partline.cpp
index c6cd22339..7992bffdd 100644
--- a/sources/editor/graphicspart/partline.cpp
+++ b/sources/editor/graphicspart/partline.cpp
@@ -346,7 +346,8 @@ void PartLine::removeHandler()
@brief PartLine::sceneP1
@return the point p1 in scene coordinate
*/
-QPointF PartLine::sceneP1() const {
+QPointF PartLine::sceneP1() const
+{
return(mapToScene(m_line.p1()));
}
@@ -354,7 +355,8 @@ QPointF PartLine::sceneP1() const {
@brief PartLine::sceneP2
@return the point p2 in scen coordinate
*/
-QPointF PartLine::sceneP2() const {
+QPointF PartLine::sceneP2() const
+{
return(mapToScene(m_line.p2()));
}
@@ -473,7 +475,8 @@ QRectF PartLine::firstEndCircleRect() const
@brief PartLine::secondEndCircleRect
@return the rectangle bordering the entirety of the second extremity
*/
-QRectF PartLine::secondEndCircleRect() const {
+QRectF PartLine::secondEndCircleRect() const
+{
QList interesting_points = fourEndPoints(m_line.p2(),
m_line.p1(),
second_length);
@@ -543,7 +546,8 @@ QRectF PartLine::boundingRect() const
@return true if this part is irrelevant and does not deserve to be Retained / registered.
A line is relevant when is two point is different
*/
-bool PartLine::isUseless() const {
+bool PartLine::isUseless() const
+{
return(m_line.p1() == m_line.p2());
}
@@ -554,7 +558,8 @@ bool PartLine::isUseless() const {
to imply any margin, and it is different from shape because it is a regular
rectangle, not a complex shape.
*/
-QRectF PartLine::sceneGeometricRect() const {
+QRectF PartLine::sceneGeometricRect() const
+{
return(QRectF(sceneP1(), sceneP2()));
}
@@ -617,7 +622,8 @@ QList PartLine::fourEndPoints(const QPointF &end_point, const QPointF &
return(QList() << o << a << b << c);
}
-QLineF PartLine::line() const {
+QLineF PartLine::line() const
+{
return m_line;
}
diff --git a/sources/editor/graphicspart/partpolygon.cpp b/sources/editor/graphicspart/partpolygon.cpp
index 794b2fbd9..e859ef8b4 100644
--- a/sources/editor/graphicspart/partpolygon.cpp
+++ b/sources/editor/graphicspart/partpolygon.cpp
@@ -150,7 +150,8 @@ bool PartPolygon::isUseless() const
to imply any margin, and it is different from shape because it is a regular
rectangle, not a complex shape.
*/
-QRectF PartPolygon::sceneGeometricRect() const {
+QRectF PartPolygon::sceneGeometricRect() const
+{
return(mapToScene(m_polygon.boundingRect()).boundingRect());
}
@@ -185,7 +186,8 @@ void PartPolygon::handleUserTransformation(const QRectF &initial_selection_rect,
single primitive is being scaled.
@return : This reimplementation systematically returns QET::RoundScaleRatios.
*/
-QET::ScalingMethod PartPolygon::preferredScalingMethod() const {
+QET::ScalingMethod PartPolygon::preferredScalingMethod() const
+{
return(QET::RoundScaleRatios);
}
@@ -193,7 +195,8 @@ QET::ScalingMethod PartPolygon::preferredScalingMethod() const {
@brief PartPolygon::polygon
@return the item's polygon, or an empty polygon if no polygon has been set.
*/
-QPolygonF PartPolygon::polygon() const {
+QPolygonF PartPolygon::polygon() const
+{
return m_polygon;
}
diff --git a/sources/editor/graphicspart/partrectangle.cpp b/sources/editor/graphicspart/partrectangle.cpp
index 152bf659f..1ad7d7685 100644
--- a/sources/editor/graphicspart/partrectangle.cpp
+++ b/sources/editor/graphicspart/partrectangle.cpp
@@ -34,7 +34,8 @@ PartRectangle::PartRectangle(QETElementEditor *editor, QGraphicsItem *parent) :
/**
@brief PartRectangle::~PartRectangle
*/
-PartRectangle::~PartRectangle() {
+PartRectangle::~PartRectangle()
+{
removeHandler();
}
@@ -126,7 +127,8 @@ void PartRectangle::fromXml(const QDomElement &qde)
@brief PartRectangle::rect
@return : Returns the item's rectangle.
*/
-QRectF PartRectangle::rect() const {
+QRectF PartRectangle::rect() const
+{
return m_rect;
}
@@ -167,7 +169,8 @@ void PartRectangle::setYRadius(qreal Y)
to imply any margin, and it is different from shape because it is a regular
rectangle, not a complex shape.
*/
-QRectF PartRectangle::sceneGeometricRect() const {
+QRectF PartRectangle::sceneGeometricRect() const
+{
return(mapToScene(rect()).boundingRect());
}
@@ -175,7 +178,8 @@ QRectF PartRectangle::sceneGeometricRect() const {
@brief PartRectangle::sceneTopLeft
@return the top left of rectangle, in scene coordinate
*/
-QPointF PartRectangle::sceneTopLeft() const {
+QPointF PartRectangle::sceneTopLeft() const
+{
return(mapToScene(rect().topLeft()));
}
@@ -228,7 +232,8 @@ QRectF PartRectangle::boundingRect() const
@return true if this part is irrelevant and does not deserve to be Retained / registered.
An rectangle is relevant when he's not null.
*/
-bool PartRectangle::isUseless() const {
+bool PartRectangle::isUseless() const
+{
return(rect().isNull());
}
diff --git a/sources/editor/graphicspart/partterminal.cpp b/sources/editor/graphicspart/partterminal.cpp
index ed256e4fb..0f8621f19 100644
--- a/sources/editor/graphicspart/partterminal.cpp
+++ b/sources/editor/graphicspart/partterminal.cpp
@@ -36,7 +36,8 @@ PartTerminal::PartTerminal(QETElementEditor *editor, QGraphicsItem *parent) :
}
/// Destructeur
-PartTerminal::~PartTerminal() {
+PartTerminal::~PartTerminal()
+{
}
/**
@@ -54,7 +55,8 @@ void PartTerminal::fromXml(const QDomElement &xml_elmt) {
@param xml_document Document XML a utiliser pour creer l'element XML
@return un element XML decrivant la borne
*/
-const QDomElement PartTerminal::toXml(QDomDocument &xml_document) const {
+const QDomElement PartTerminal::toXml(QDomDocument &xml_document) const
+{
return d -> toXml(xml_document);
}
@@ -97,7 +99,8 @@ void PartTerminal::paint(QPainter *p, const QStyleOptionGraphicsItem *options, Q
@brief PartTerminal::shape
@return the shape of this item
*/
-QPainterPath PartTerminal::shape() const {
+QPainterPath PartTerminal::shape() const
+{
QPainterPath shape;
shape.lineTo(d -> second_point);
@@ -111,7 +114,8 @@ QPainterPath PartTerminal::shape() const {
@brief PartTerminal::boundingRect
@return the bounding rect of this item
*/
-QRectF PartTerminal::boundingRect() const {
+QRectF PartTerminal::boundingRect() const
+{
QRectF br(QPointF(0, 0), d -> second_point);
br = br.normalized();
@@ -141,7 +145,8 @@ void PartTerminal::setName(QString& name) {
emit nameChanged();
}
-void PartTerminal::setNewUuid() {
+void PartTerminal::setNewUuid()
+{
d -> m_uuid = QUuid::createUuid();
}
@@ -149,7 +154,8 @@ void PartTerminal::setNewUuid() {
Met a jour la position du second point en fonction de la position et de
l'orientation de la borne.
*/
-void PartTerminal::updateSecondPoint() {
+void PartTerminal::updateSecondPoint()
+{
qreal ts = 4.0; // terminal size
switch(d -> m_orientation) {
case Qet::North: d -> second_point = QPointF(0.0, ts); break;
@@ -165,7 +171,8 @@ void PartTerminal::updateSecondPoint() {
Une borne est toujours pertinente ; cette fonction renvoie donc
toujours false
*/
-bool PartTerminal::isUseless() const {
+bool PartTerminal::isUseless() const
+{
return(false);
}
@@ -175,7 +182,8 @@ bool PartTerminal::isUseless() const {
to imply any margin, and it is different from shape because it is a regular
rectangle, not a complex shape.
*/
-QRectF PartTerminal::sceneGeometricRect() const {
+QRectF PartTerminal::sceneGeometricRect() const
+{
return(sceneBoundingRect());
}
diff --git a/sources/editor/graphicspart/parttext.cpp b/sources/editor/graphicspart/parttext.cpp
index bae1ab802..497d66b31 100644
--- a/sources/editor/graphicspart/parttext.cpp
+++ b/sources/editor/graphicspart/parttext.cpp
@@ -58,7 +58,8 @@ PartText::PartText(QETElementEditor *editor, QGraphicsItem *parent) :
}
/// Destructeur
-PartText::~PartText() {
+PartText::~PartText()
+{
}
/**
@@ -95,7 +96,8 @@ void PartText::fromXml(const QDomElement &xml_element) {
@param xml_document Document XML a utiliser pour creer l'element XML
@return un element XML decrivant le texte statique
*/
-const QDomElement PartText::toXml(QDomDocument &xml_document) const {
+const QDomElement PartText::toXml(QDomDocument &xml_document) const
+{
QDomElement xml_element = xml_document.createElement(xmlName());
xml_element.setAttribute("x", QString::number(pos().x()));
@@ -111,7 +113,8 @@ const QDomElement PartText::toXml(QDomDocument &xml_document) const {
/**
@return Les coordonnees du point situe en bas a gauche du texte.
*/
-QPointF PartText::margin() const {
+QPointF PartText::margin() const
+{
QFont used_font = font();
QFontMetrics qfm(used_font);
qreal document_margin = document() -> documentMargin();
@@ -191,7 +194,8 @@ QVariant PartText::itemChange(GraphicsItemChange change, const QVariant &value)
/**
@return le rectangle delimitant cette partie.
*/
-QRectF PartText::boundingRect() const {
+QRectF PartText::boundingRect() const
+{
QRectF r = QGraphicsTextItem::boundingRect();
r.adjust(0.0, -1.1, 0.0, 0.0);
return(r);
@@ -202,7 +206,8 @@ QRectF PartText::boundingRect() const {
conservee / enregistree.
Un texte statique n'est pas pertinent lorsque son texte est vide.
*/
-bool PartText::isUseless() const {
+bool PartText::isUseless() const
+{
return(toPlainText().isEmpty());
}
@@ -212,7 +217,8 @@ bool PartText::isUseless() const {
to imply any margin, and it is different from shape because it is a regular
rectangle, not a complex shape.
*/
-QRectF PartText::sceneGeometricRect() const {
+QRectF PartText::sceneGeometricRect() const
+{
return(sceneBoundingRect());
}
@@ -327,7 +333,8 @@ void PartText::setEditable(bool editable) {
/**
Start text edition by storing the former value of the text.
*/
-void PartText::startEdition() {
+void PartText::startEdition()
+{
// !previous_text.isNull() means the text is being edited
previous_text = toPlainText();
}
@@ -336,7 +343,8 @@ void PartText::startEdition() {
End text edition, potentially generating a ChangePartCommand if the text
has changed.
*/
-void PartText::endEdition() {
+void PartText::endEdition()
+{
if (!previous_text.isNull()) {
// the text was being edited
QString new_text = toPlainText();
diff --git a/sources/editor/lineeditor.cpp b/sources/editor/lineeditor.cpp
index ecb9ae939..d2942dcb8 100644
--- a/sources/editor/lineeditor.cpp
+++ b/sources/editor/lineeditor.cpp
@@ -89,7 +89,8 @@ LineEditor::LineEditor(QETElementEditor *editor, PartLine *line, QWidget *parent
}
/// Destructeur
-LineEditor::~LineEditor() {
+LineEditor::~LineEditor()
+{
}
void LineEditor::setUpChangeConnections()
@@ -155,11 +156,13 @@ bool LineEditor::setParts(QList parts)
/**
@return la primitive actuellement editee, ou 0 si ce widget n'en edite pas
*/
-CustomElementPart *LineEditor::currentPart() const {
+CustomElementPart *LineEditor::currentPart() const
+{
return(part);
}
-QList LineEditor::currentParts() const {
+QList LineEditor::currentParts() const
+{
return style_->currentParts();
}
@@ -167,7 +170,8 @@ QList LineEditor::currentParts() const {
@brief LineEditor::editedP1
@return The edited P1 in item coordinate
*/
-QPointF LineEditor::editedP1() const {
+QPointF LineEditor::editedP1() const
+{
return part -> mapFromScene(x1->value(), y1->value());
}
@@ -175,7 +179,8 @@ QPointF LineEditor::editedP1() const {
@brief LineEditor::editedP2
@return The edited P2 in item coordinate
*/
-QPointF LineEditor::editedP2() const {
+QPointF LineEditor::editedP2() const
+{
return part -> mapFromScene(x2->value(), y2->value());
}
diff --git a/sources/editor/qetelementeditor.cpp b/sources/editor/qetelementeditor.cpp
index c29b7ed17..58ca30be7 100644
--- a/sources/editor/qetelementeditor.cpp
+++ b/sources/editor/qetelementeditor.cpp
@@ -93,7 +93,8 @@ QETElementEditor::QETElementEditor(QWidget *parent) :
}
/// Destructeur
-QETElementEditor::~QETElementEditor() {
+QETElementEditor::~QETElementEditor()
+{
/*
retire le widget d'edition de primitives affiche par le dock
cela evite qu'il ne soit supprime par son widget parent
@@ -135,7 +136,8 @@ void QETElementEditor::setFileName(const QString &fn) {
@brief QETElementEditor::setupActions
Create action used in Element editor
*/
-void QETElementEditor::setupActions() {
+void QETElementEditor::setupActions()
+{
new_element = new QAction(QET::Icons::DocumentNew, tr("&Nouveau"), this);
open = new QAction(QET::Icons::FolderOpen, tr("&Ouvrir"), this);
open_file = new QAction(QET::Icons::FolderOpen, tr("&Ouvrir depuis un fichier"), this);
@@ -361,7 +363,8 @@ void QETElementEditor::setupActions() {
/**
@brief QETElementEditor::setupMenus
*/
-void QETElementEditor::setupMenus() {
+void QETElementEditor::setupMenus()
+{
file_menu = new QMenu(tr("&Fichier"), this);
edit_menu = new QMenu(tr("&Édition"), this);
display_menu = new QMenu(tr("Afficha&ge"), this);
@@ -461,7 +464,8 @@ void QETElementEditor::contextMenu(QPoint p, QList actions) {
/**
Met a jour les menus
*/
-void QETElementEditor::slot_updateMenus() {
+void QETElementEditor::slot_updateMenus()
+{
bool selected_items = !read_only && !m_elmt_scene -> selectedItems().isEmpty();
bool clipboard_elmt = !read_only && ElementScene::clipboardMayContainElement();
@@ -497,7 +501,8 @@ void QETElementEditor::slot_updateMenus() {
/**
Met a jour le titre de la fenetre
*/
-void QETElementEditor::slot_updateTitle() {
+void QETElementEditor::slot_updateTitle()
+{
QString title = min_title;
title += " - " + m_elmt_scene -> names().name() + " ";
if (!filename_.isEmpty() || !location_.isNull()) {
@@ -514,7 +519,8 @@ void QETElementEditor::slot_updateTitle() {
/**
@brief QETElementEditor::setupInterface
*/
-void QETElementEditor::setupInterface() {
+void QETElementEditor::setupInterface()
+{
// editeur
m_elmt_scene = new ElementScene(this, this);
m_view = new ElementView(m_elmt_scene, this);
@@ -592,14 +598,16 @@ void QETElementEditor::setupInterface() {
Passe l'editeur d'element en mode selection : le pointeur deplace les
elements selectionnes et il est possible d'utiliser un rectangle de selection.
*/
-void QETElementEditor::slot_setRubberBandToView() {
+void QETElementEditor::slot_setRubberBandToView()
+{
m_view -> setDragMode(QGraphicsView::RubberBandDrag);
}
/**
Passe l'editeur d'element en mode immobile (utilise pour la lecture seule)
*/
-void QETElementEditor::slot_setNoDragToView() {
+void QETElementEditor::slot_setNoDragToView()
+{
m_view -> setDragMode(QGraphicsView::NoDrag);
}
@@ -608,7 +616,8 @@ void QETElementEditor::slot_setNoDragToView() {
Si plusieurs primitives sont selectionnees, seule leur quantite est
affichee. Sinon, un widget d'edition approprie est mis en place.
*/
-void QETElementEditor::slot_updateInformations() {
+void QETElementEditor::slot_updateInformations()
+{
QList selected_qgis = m_elmt_scene -> selectedItems();
if (selected_qgis.isEmpty()) {
clearToolsDock();
@@ -752,7 +761,8 @@ void QETElementEditor::slot_updateInformations() {
Do several check about element.
If error is occurred return false
*/
-bool QETElementEditor::checkElement() {
+bool QETElementEditor::checkElement()
+{
//List of warning and error
typedef QPair QETWarning;
QList warnings;
@@ -998,7 +1008,8 @@ void QETElementEditor::setReadOnly(bool ro) {
/**
@return true si l'editeur d'element est en mode lecture seule
*/
-bool QETElementEditor::isReadOnly() const {
+bool QETElementEditor::isReadOnly() const
+{
return(read_only);
}
@@ -1006,7 +1017,8 @@ bool QETElementEditor::isReadOnly() const {
@brief QETElementEditor::addLine
Set line creation interface to scene
*/
-void QETElementEditor::addLine() {
+void QETElementEditor::addLine()
+{
m_elmt_scene -> setEventInterface(new ESEventAddLine(m_elmt_scene));
}
@@ -1014,7 +1026,8 @@ void QETElementEditor::addLine() {
@brief QETElementEditor::addRect
Set rectangle creation interface to scene
*/
-void QETElementEditor::addRect() {
+void QETElementEditor::addRect()
+{
m_elmt_scene -> setEventInterface(new ESEventAddRect(m_elmt_scene));
}
@@ -1022,7 +1035,8 @@ void QETElementEditor::addRect() {
@brief QETElementEditor::addEllipse
Set ellipse creation interface to scene
*/
-void QETElementEditor::addEllipse() {
+void QETElementEditor::addEllipse()
+{
m_elmt_scene -> setEventInterface(new ESEventAddEllipse(m_elmt_scene));
}
@@ -1030,7 +1044,8 @@ void QETElementEditor::addEllipse() {
@brief QETElementEditor::addPolygon
Set polygon creation interface to scene
*/
-void QETElementEditor::addPolygon() {
+void QETElementEditor::addPolygon()
+{
m_elmt_scene -> setEventInterface(new ESEventAddPolygon(m_elmt_scene));
}
@@ -1038,7 +1053,8 @@ void QETElementEditor::addPolygon() {
@brief QETElementEditor::addArc
Set arc creation interface to scene
*/
-void QETElementEditor::addArc() {
+void QETElementEditor::addArc()
+{
m_elmt_scene -> setEventInterface(new ESEventAddArc(m_elmt_scene));
}
@@ -1046,7 +1062,8 @@ void QETElementEditor::addArc() {
@brief QETElementEditor::addText
Set text creation interface to scene
*/
-void QETElementEditor::addText() {
+void QETElementEditor::addText()
+{
m_elmt_scene -> setEventInterface(new ESEventAddText(m_elmt_scene));
}
@@ -1054,7 +1071,8 @@ void QETElementEditor::addText() {
@brief QETElementEditor::addTerminal
Set terminal creation interface to scene
*/
-void QETElementEditor::addTerminal() {
+void QETElementEditor::addTerminal()
+{
m_elmt_scene -> setEventInterface(new ESEventAddTerminal(m_elmt_scene));
}
@@ -1062,7 +1080,8 @@ void QETElementEditor::addTerminal() {
@brief QETElementEditor::addDynamicTextField
Set dynamic text field creation interface to scene
*/
-void QETElementEditor::addDynamicTextField() {
+void QETElementEditor::addDynamicTextField()
+{
m_elmt_scene -> setEventInterface(new ESEventAddDynamicTextField(m_elmt_scene));
}
@@ -1070,7 +1089,8 @@ void QETElementEditor::addDynamicTextField() {
@brief QETElementEditor::UncheckAddPrimitive
Uncheck all action related to primitive
*/
-void QETElementEditor::UncheckAddPrimitive() {
+void QETElementEditor::UncheckAddPrimitive()
+{
foreach(QAction *action, parts -> actions()) {
action -> setChecked(false);
}
@@ -1079,7 +1099,8 @@ void QETElementEditor::UncheckAddPrimitive() {
/**
Lance l'assistant de creation d'un nouvel element.
*/
-void QETElementEditor::slot_new() {
+void QETElementEditor::slot_new()
+{
NewElementWizard new_element_wizard(this);
new_element_wizard.exec();
}
@@ -1087,7 +1108,8 @@ void QETElementEditor::slot_new() {
/**
Ouvre un element
*/
-void QETElementEditor::slot_open() {
+void QETElementEditor::slot_open()
+{
// demande le chemin virtuel de l'element a ouvrir a l'utilisateur
ElementsLocation location = ElementDialog::getOpenElementLocation(this);
if (location.isNull()) {
@@ -1100,7 +1122,8 @@ void QETElementEditor::slot_open() {
Ouvre un fichier
Demande un fichier a l'utilisateur et ouvre ce fichier
*/
-void QETElementEditor::slot_openFile() {
+void QETElementEditor::slot_openFile()
+{
// repertoire a afficher initialement dans le dialogue
QString open_dir = filename_.isEmpty() ? QETApp::customElementsDir() : QDir(filename_).absolutePath();
@@ -1129,7 +1152,8 @@ void QETElementEditor::openRecentFile(const QString &filepath) {
/**
@brief QETElementEditor::slot_openDxf
*/
-void QETElementEditor::slot_openDxf (){
+void QETElementEditor::slot_openDxf ()
+{
#if defined(Q_OS_WIN32) || defined(Q_OS_WIN64)
QString program = (QDir::homePath() + "/Application Data/qet/DXFtoQET.exe");
@@ -1174,7 +1198,8 @@ void QETElementEditor::openElement(const QString &filepath) {
@brief QETElementEditor::slot_reload
Reload the element from the file or location
*/
-void QETElementEditor::slot_reload() {
+void QETElementEditor::slot_reload()
+{
//If user already edit the element, ask confirmation to reload
if (!m_elmt_scene -> undoStack().isClean()) {
QMessageBox::StandardButton answer = QET::QetMessageBox::question(this,
@@ -1203,7 +1228,8 @@ void QETElementEditor::slot_reload() {
If the filepath or location is unknown, use save_as instead
@return true if save with success
*/
-bool QETElementEditor::slot_save() {
+bool QETElementEditor::slot_save()
+{
// Check element befor writing
if (checkElement()) {
//If we don't know the name of the current file, use save as instead
@@ -1242,7 +1268,8 @@ bool QETElementEditor::slot_save() {
to this location
@return true if save with success
*/
-bool QETElementEditor::slot_saveAs() {
+bool QETElementEditor::slot_saveAs()
+{
// Check element befor writing
if (checkElement()) {
//Ask a location to user
@@ -1269,7 +1296,8 @@ bool QETElementEditor::slot_saveAs() {
Ask a file to user and save the current edited element to this file
@return true if save with success
*/
-bool QETElementEditor::slot_saveAsFile() {
+bool QETElementEditor::slot_saveAsFile()
+{
// Check element befor writing
if (checkElement()) {
//Ask a filename to user, for save the element
@@ -1312,7 +1340,8 @@ bool QETElementEditor::slot_saveAsFile() {
Si l'element comporte des modifications, la question est posee a
l'utilisateur.
*/
-bool QETElementEditor::canClose() {
+bool QETElementEditor::canClose()
+{
if (m_elmt_scene -> undoStack().isClean()) {
return(true);
}
@@ -1351,7 +1380,8 @@ bool QETElementEditor::canClose() {
parties.
@return le widget enleve, ou 0 s'il n'y avait pas de widget a enlever
*/
-QWidget *QETElementEditor::clearToolsDock() {
+QWidget *QETElementEditor::clearToolsDock()
+{
if (QWidget *previous_widget = m_tools_dock_stack -> widget(1)) {
m_tools_dock_stack -> removeWidget(previous_widget);
previous_widget -> setParent(nullptr);
@@ -1410,7 +1440,8 @@ void QETElementEditor::firstActivation(QEvent *event) {
/**
Remplit la liste des parties
*/
-void QETElementEditor::slot_createPartsList() {
+void QETElementEditor::slot_createPartsList()
+{
m_parts_list -> blockSignals(true);
m_parts_list -> clear();
QList qgis = m_elmt_scene -> zItems();
@@ -1441,7 +1472,8 @@ void QETElementEditor::slot_createPartsList() {
/**
Met a jour la selection dans la liste des parties
*/
-void QETElementEditor::slot_updatePartsList() {
+void QETElementEditor::slot_updatePartsList()
+{
int items_count = m_elmt_scene -> items().count();
if (m_parts_list -> count() != items_count) {
slot_createPartsList();
@@ -1464,7 +1496,8 @@ void QETElementEditor::slot_updatePartsList() {
Met a jour la selection des parties de l'element a partir de la liste des
parties
*/
-void QETElementEditor::slot_updateSelectionFromPartsList() {
+void QETElementEditor::slot_updateSelectionFromPartsList()
+{
m_elmt_scene -> blockSignals(true);
m_parts_list -> blockSignals(true);
for (int i = 0 ; i < m_parts_list -> count() ; ++ i) {
@@ -1484,7 +1517,8 @@ void QETElementEditor::slot_updateSelectionFromPartsList() {
@brief QETElementEditor::readSettings
Read settings
*/
-void QETElementEditor::readSettings() {
+void QETElementEditor::readSettings()
+{
QSettings settings;
// dimensions et position de la fenetre
@@ -1507,7 +1541,8 @@ void QETElementEditor::readSettings() {
@brief QETElementEditor::writeSettings
Write the settings
*/
-void QETElementEditor::writeSettings() {
+void QETElementEditor::writeSettings()
+{
QSettings settings;
settings.setValue("elementeditor/geometry", saveGeometry());
settings.setValue("elementeditor/state", saveState());
@@ -1517,7 +1552,8 @@ void QETElementEditor::writeSettings() {
@return les decalages horizontaux et verticaux (sous la forme d'un point) a
utiliser lors d'un copier/coller avec decalage.
*/
-QPointF QETElementEditor::pasteOffset() {
+QPointF QETElementEditor::pasteOffset()
+{
QPointF paste_offset(5.0, 0.0);
return(paste_offset);
}
@@ -1594,7 +1630,8 @@ void QETElementEditor::fromLocation(const ElementsLocation &location) {
Demande un fichier a l'utilisateur, l'ouvre en tant que fichier element,
met son contenu dans le presse-papiers, et appelle ElementView::PasteInArea
*/
-void QETElementEditor::pasteFromFile() {
+void QETElementEditor::pasteFromFile()
+{
// demande le chemin du fichier a ouvrir a l'utilisateur
QString element_file_path = getOpenElementFileName(this);
if (element_file_path.isEmpty()) {
@@ -1627,7 +1664,8 @@ void QETElementEditor::pasteFromFile() {
Ask an element to user, copy the xml definition of the element
to the clipboard and call ElementView::PasteInArea
*/
-void QETElementEditor::pasteFromElement() {
+void QETElementEditor::pasteFromElement()
+{
//Ask for a location
ElementsLocation location = ElementDialog::getOpenElementLocation(this);
if (location.isNull()) {
@@ -1659,7 +1697,8 @@ void QETElementEditor::pasteFromElement() {
Met a jour l'editeur de primitive actuellement visible.
Si aucun editeur de primitive n'est visible, ce slot ne fait rien.
*/
-void QETElementEditor::updateCurrentPartEditor() {
+void QETElementEditor::updateCurrentPartEditor()
+{
// si aucun widget d'edition n'est affiche, on ne fait rien
if (!m_tools_dock_stack -> currentIndex()) {
return;
diff --git a/sources/editor/qetelementeditor.h b/sources/editor/qetelementeditor.h
index 7ae72066a..ea4d7bbd6 100644
--- a/sources/editor/qetelementeditor.h
+++ b/sources/editor/qetelementeditor.h
@@ -166,21 +166,24 @@ inline void QETElementEditor::setNames(const NamesList &nameslist) {
/**
@return the location of the currently edited element
*/
-inline ElementsLocation QETElementEditor::location() const {
+inline ElementsLocation QETElementEditor::location() const
+{
return(location_);
}
/**
@return the filename of the currently edited element
*/
-inline QString QETElementEditor::fileName() const {
+inline QString QETElementEditor::fileName() const
+{
return(filename_);
}
/**
@return the editing scene
*/
-inline ElementScene *QETElementEditor::elementScene() const {
+inline ElementScene *QETElementEditor::elementScene() const
+{
return(m_elmt_scene);
}
diff --git a/sources/editor/styleeditor.cpp b/sources/editor/styleeditor.cpp
index 631179fa6..3103eb46e 100644
--- a/sources/editor/styleeditor.cpp
+++ b/sources/editor/styleeditor.cpp
@@ -403,31 +403,37 @@ StyleEditor::StyleEditor(QETElementEditor *editor, CustomElementGraphicPart *p,
}
/// Destructeur
-StyleEditor::~StyleEditor() {
+StyleEditor::~StyleEditor()
+{
}
/// Update antialiasing with undo command
-void StyleEditor::updatePartAntialiasing() {
+void StyleEditor::updatePartAntialiasing()
+{
makeUndo(tr("style antialiasing"), "antialias", antialiasing -> isChecked());
}
/// Update color with undo command
-void StyleEditor::updatePartColor() {
+void StyleEditor::updatePartColor()
+{
makeUndo(tr("style couleur"),"color", outline_color->itemData(outline_color -> currentIndex()));
}
/// Update style with undo command
-void StyleEditor::updatePartLineStyle() {
+void StyleEditor::updatePartLineStyle()
+{
makeUndo(tr("style ligne"), "line_style", line_style->itemData(line_style -> currentIndex()));
}
/// Update weight with undo command
-void StyleEditor::updatePartLineWeight() {
+void StyleEditor::updatePartLineWeight()
+{
makeUndo(tr("style epaisseur"), "line_weight", size_weight->itemData(size_weight -> currentIndex()));
}
/// Update color filling with undo command
-void StyleEditor::updatePartFilling() {
+void StyleEditor::updatePartFilling()
+{
makeUndo(tr("style remplissage"), "filling", filling_color->itemData(filling_color -> currentIndex()));
}
@@ -536,11 +542,13 @@ bool StyleEditor::setParts(QList part_list)
/**
@return la primitive actuellement editee, ou 0 si ce widget n'en edite pas
*/
-CustomElementPart *StyleEditor::currentPart() const {
+CustomElementPart *StyleEditor::currentPart() const
+{
return(part);
}
-QList StyleEditor::currentParts() const {
+QList StyleEditor::currentParts() const
+{
return m_cep_list;
}
diff --git a/sources/editor/terminaleditor.cpp b/sources/editor/terminaleditor.cpp
index 81181d9d8..d0857853d 100644
--- a/sources/editor/terminaleditor.cpp
+++ b/sources/editor/terminaleditor.cpp
@@ -47,9 +47,10 @@ TerminalEditor::TerminalEditor(QETElementEditor* editor, QWidget* parent):
@param parent :
QWidget parent de ce widget
*/
-TerminalEditor::TerminalEditor(QETElementEditor *editor,
- QList &terms,
- QWidget *parent) :
+TerminalEditor::TerminalEditor(
+ QETElementEditor *editor,
+ QList &terms,
+ QWidget *parent) :
ElementItemEditor(editor, parent),
m_terminals(terms),
m_part(terms.first()) {
@@ -59,9 +60,11 @@ TerminalEditor::TerminalEditor(QETElementEditor *editor,
/**
@brief TerminalEditor::init
*/
-void TerminalEditor::init() {
+void TerminalEditor::init()
+{
qle_x = new QDoubleSpinBox();
qle_y = new QDoubleSpinBox();
+ name = new QLineEdit();
qle_x -> setRange(-5000, 5000);
qle_y -> setRange(-5000, 5000);
@@ -87,6 +90,11 @@ void TerminalEditor::init() {
ori -> addWidget(orientation );
main_layout -> addLayout(ori);
+ QHBoxLayout *lay_name = new QHBoxLayout();
+ lay_name -> addWidget(new QLabel(tr("Name : ")));
+ lay_name -> addWidget(name);
+ main_layout -> addLayout(lay_name);
+
main_layout -> addStretch();
setLayout(main_layout);
@@ -98,7 +106,8 @@ void TerminalEditor::init() {
@brief TerminalEditor::~TerminalEditor
Destructeur
*/
-TerminalEditor::~TerminalEditor() {
+TerminalEditor::~TerminalEditor()
+{
}
/**
@@ -161,11 +170,13 @@ bool TerminalEditor::setParts(QList parts) {
/**
@return la primitive actuellement editee, ou 0 si ce widget n'en edite pas
*/
-CustomElementPart *TerminalEditor::currentPart() const {
+CustomElementPart *TerminalEditor::currentPart() const
+{
return(m_part);
}
-QList TerminalEditor::currentParts() const {
+QList TerminalEditor::currentParts() const
+{
QList parts;
for (auto term: m_terminals) {
parts.append(static_cast(term));
@@ -174,7 +185,8 @@ QList TerminalEditor::currentParts() const {
}
/// Met a jour l'orientation de la borne et cree un objet d'annulation
-void TerminalEditor::updateTerminalO() {
+void TerminalEditor::updateTerminalO()
+{
if (m_locked) return;
m_locked = true;
QVariant var(orientation -> itemData(orientation -> currentIndex()));
@@ -194,7 +206,8 @@ void TerminalEditor::updateTerminalO() {
/**
@brief TerminalEditor::updateXPos
*/
-void TerminalEditor::updateXPos() {
+void TerminalEditor::updateXPos()
+{
if (m_locked) return;
m_locked = true;
QPointF new_pos(qle_x->value(), 0);
@@ -215,7 +228,8 @@ void TerminalEditor::updateXPos() {
/**
@brief TerminalEditor::updateYPos
*/
-void TerminalEditor::updateYPos() {
+void TerminalEditor::updateYPos()
+{
if (m_locked) return;
m_locked = true;
QPointF new_pos(0, qle_y->value()); // change only y value
@@ -232,17 +246,46 @@ void TerminalEditor::updateYPos() {
}
m_locked=false;
}
+
+/**
+ @brief TerminalEditor::updateName
+ SLOT set name to Terminal
+*/
+void TerminalEditor::updateName() {
+ if (m_locked) return;
+ m_locked = true;
+ QVariant var(name->text());
+
+ for (int i=0; i < m_terminals.length(); i++) {
+ PartTerminal* term = m_terminals[i];
+ if (var != term->property("name"))
+ {
+ QPropertyUndoCommand *undo;
+ undo = new QPropertyUndoCommand(term,
+ "name",
+ term->property("name"),
+ var);
+ undo->setText(tr("Modify name of the terminal"));
+ undoStack().push(undo);
+ }
+ }
+ m_locked=false;
+
+}
+
/// update Number and name, create cancel object
/**
Met a jour le formulaire d'edition
*/
-void TerminalEditor::updateForm() {
+void TerminalEditor::updateForm()
+{
if (!m_part) return;
activeConnections(false);
qle_x -> setValue(m_part->property("x").toReal());
qle_y -> setValue(m_part->property("y").toReal());
orientation -> setCurrentIndex(orientation->findData(m_part->property("orientation")));
+ name -> setText(m_part->name());
activeConnections(true);
}
@@ -252,13 +295,26 @@ void TerminalEditor::updateForm() {
*/
void TerminalEditor::activeConnections(bool active) {
if (active) {
- connect(qle_x, &QDoubleSpinBox::editingFinished, this, &TerminalEditor::updateXPos);
- connect(qle_y, &QDoubleSpinBox::editingFinished, this, &TerminalEditor::updateYPos);
- connect(orientation, QOverload::of(&QComboBox::activated), this, &TerminalEditor::updateTerminalO);
+ connect(qle_x,
+ &QDoubleSpinBox::editingFinished,
+ this, &TerminalEditor::updateXPos);
+ connect(qle_y,
+ &QDoubleSpinBox::editingFinished,
+ this, &TerminalEditor::updateYPos);
+ connect(orientation,
+ QOverload::of(&QComboBox::activated),
+ this, &TerminalEditor::updateTerminalO);
+ connect(name, &QLineEdit::editingFinished,
+ this, &TerminalEditor::updateName);
}
else {
- disconnect(qle_x, &QDoubleSpinBox::editingFinished, this, &TerminalEditor::updateXPos);
- disconnect(qle_y, &QDoubleSpinBox::editingFinished, this, &TerminalEditor::updateYPos);
- disconnect(orientation, QOverload::of(&QComboBox::activated), this, &TerminalEditor::updateTerminalO);
+ disconnect(qle_x, &QDoubleSpinBox::editingFinished,
+ this, &TerminalEditor::updateXPos);
+ disconnect(qle_y, &QDoubleSpinBox::editingFinished,
+ this, &TerminalEditor::updateYPos);
+ disconnect(orientation, QOverload::of(&QComboBox::activated),
+ this, &TerminalEditor::updateTerminalO);
+ disconnect(name, &QLineEdit::editingFinished,
+ this, &TerminalEditor::updateName);
}
}
diff --git a/sources/editor/terminaleditor.h b/sources/editor/terminaleditor.h
index 0f9d8d7a6..6bbb482dd 100644
--- a/sources/editor/terminaleditor.h
+++ b/sources/editor/terminaleditor.h
@@ -20,6 +20,8 @@
#include "elementitemeditor.h"
+#include
+
class PartTerminal;
class QDoubleSpinBox;
class QComboBox;
@@ -35,9 +37,10 @@ class TerminalEditor : public ElementItemEditor {
// Constructors, destructor
public:
- TerminalEditor(QETElementEditor *,
- QList& terms,
- QWidget * = nullptr);
+ TerminalEditor(
+ QETElementEditor *,
+ QList& terms,
+ QWidget * = nullptr);
TerminalEditor(QETElementEditor *, QWidget * = nullptr);
~TerminalEditor() override;
private:
@@ -50,6 +53,7 @@ class TerminalEditor : public ElementItemEditor {
PartTerminal *m_part{nullptr};
QDoubleSpinBox *qle_x, *qle_y;
QComboBox *orientation;
+ QLineEdit *name;
bool m_locked{false};
// methods
@@ -63,6 +67,7 @@ class TerminalEditor : public ElementItemEditor {
void updateTerminalO();
void updateXPos();
void updateYPos();
+ void updateName();
void updateForm() override;
private:
diff --git a/sources/editor/ui/dynamictextfieldeditor.cpp b/sources/editor/ui/dynamictextfieldeditor.cpp
index ac7314280..f9936e484 100644
--- a/sources/editor/ui/dynamictextfieldeditor.cpp
+++ b/sources/editor/ui/dynamictextfieldeditor.cpp
@@ -43,7 +43,8 @@ DynamicTextFieldEditor::DynamicTextFieldEditor(
fillInfoComboBox();
}
-DynamicTextFieldEditor::~DynamicTextFieldEditor() {
+DynamicTextFieldEditor::~DynamicTextFieldEditor()
+{
delete ui;
if(!m_connection_list.isEmpty()) {
for(const QMetaObject::Connection& con : m_connection_list) {
@@ -108,11 +109,13 @@ bool DynamicTextFieldEditor::setParts(QList parts) {
@return The current edited part, note they can return nullptr if
there is not a currently edited part.
*/
-CustomElementPart *DynamicTextFieldEditor::currentPart() const {
+CustomElementPart *DynamicTextFieldEditor::currentPart() const
+{
return m_text_field.data();
}
-QList DynamicTextFieldEditor::currentParts() const {
+QList DynamicTextFieldEditor::currentParts() const
+{
QList parts;
for (auto part: m_parts) {
parts.append(static_cast(part));
@@ -120,7 +123,8 @@ QList DynamicTextFieldEditor::currentParts() const {
return parts;
}
-void DynamicTextFieldEditor::updateForm() {
+void DynamicTextFieldEditor::updateForm()
+{
if(m_text_field) {
ui -> m_x_sb -> setValue(m_text_field.data() -> x());
ui -> m_y_sb -> setValue(m_text_field.data() ->y ());
@@ -152,7 +156,8 @@ void DynamicTextFieldEditor::updateForm() {
}
}
-void DynamicTextFieldEditor::setUpConnections() {
+void DynamicTextFieldEditor::setUpConnections()
+{
assert(m_connection_list.isEmpty());
//Setup the connection
m_connection_list << connect(m_text_field.data(), &PartDynamicTextField::colorChanged,
@@ -177,7 +182,8 @@ void DynamicTextFieldEditor::setUpConnections() {
[this](){this -> updateForm();});
}
-void DynamicTextFieldEditor::disconnectConnections() {
+void DynamicTextFieldEditor::disconnectConnections()
+{
//Remove previous connection
if(!m_connection_list.isEmpty())
for(const QMetaObject::Connection& con : m_connection_list) {
@@ -190,7 +196,8 @@ void DynamicTextFieldEditor::disconnectConnections() {
@brief DynamicTextFieldEditor::fillInfoComboBox
Fill the combo box "element information"
*/
-void DynamicTextFieldEditor::fillInfoComboBox() {
+void DynamicTextFieldEditor::fillInfoComboBox()
+{
ui -> m_elmt_info_cb -> clear();
QStringList strl;
@@ -212,7 +219,8 @@ void DynamicTextFieldEditor::fillInfoComboBox() {
ui -> m_elmt_info_cb -> addItem(key, info_map.value(key));
}
-void DynamicTextFieldEditor::on_m_x_sb_editingFinished() {
+void DynamicTextFieldEditor::on_m_x_sb_editingFinished()
+{
double value = ui -> m_x_sb -> value();
for (int i = 0; i < m_parts.length(); i++) {
QPropertyUndoCommand *undo = new QPropertyUndoCommand(m_parts[i], "x", m_parts[i] -> x(), value);
@@ -222,7 +230,8 @@ void DynamicTextFieldEditor::on_m_x_sb_editingFinished() {
}
}
-void DynamicTextFieldEditor::on_m_y_sb_editingFinished() {
+void DynamicTextFieldEditor::on_m_y_sb_editingFinished()
+{
double value = ui -> m_y_sb -> value();
for (int i = 0; i < m_parts.length(); i++) {
QPropertyUndoCommand *undo = new QPropertyUndoCommand(m_parts[i], "y", m_parts[i] -> y(), value);
@@ -232,7 +241,8 @@ void DynamicTextFieldEditor::on_m_y_sb_editingFinished() {
}
}
-void DynamicTextFieldEditor::on_m_rotation_sb_editingFinished() {
+void DynamicTextFieldEditor::on_m_rotation_sb_editingFinished()
+{
int value = ui -> m_rotation_sb -> value();
for (int i = 0; i < m_parts.length(); i++) {
QPropertyUndoCommand *undo = new QPropertyUndoCommand(m_parts[i], "rotation", m_parts[i] -> rotation(), value);
@@ -242,7 +252,8 @@ void DynamicTextFieldEditor::on_m_rotation_sb_editingFinished() {
}
}
-void DynamicTextFieldEditor::on_m_user_text_le_editingFinished() {
+void DynamicTextFieldEditor::on_m_user_text_le_editingFinished()
+{
QString text = ui -> m_user_text_le -> text();
for (int i = 0; i < m_parts.length(); i++) {
QPropertyUndoCommand *undo = new QPropertyUndoCommand(m_parts[i], "text", m_parts[i] -> text(), text);
@@ -251,7 +262,8 @@ void DynamicTextFieldEditor::on_m_user_text_le_editingFinished() {
}
}
-void DynamicTextFieldEditor::on_m_size_sb_editingFinished() {
+void DynamicTextFieldEditor::on_m_size_sb_editingFinished()
+{
QFont font_ = m_text_field -> font();
font_.setPointSize(ui -> m_size_sb -> value());
for (int i = 0; i < m_parts.length(); i++) {
@@ -261,7 +273,8 @@ void DynamicTextFieldEditor::on_m_size_sb_editingFinished() {
}
}
-void DynamicTextFieldEditor::on_m_frame_cb_clicked() {
+void DynamicTextFieldEditor::on_m_frame_cb_clicked()
+{
bool frame = ui -> m_frame_cb -> isChecked();
for (int i = 0; i < m_parts.length(); i++) {
@@ -273,7 +286,8 @@ void DynamicTextFieldEditor::on_m_frame_cb_clicked() {
}
}
-void DynamicTextFieldEditor::on_m_width_sb_editingFinished() {
+void DynamicTextFieldEditor::on_m_width_sb_editingFinished()
+{
qreal width = (qreal)ui -> m_width_sb -> value();
for (int i = 0; i < m_parts.length(); i++) {
@@ -335,7 +349,8 @@ void DynamicTextFieldEditor::on_m_text_from_cb_activated(int index) {
}
}
-void DynamicTextFieldEditor::on_m_composite_text_pb_clicked() {
+void DynamicTextFieldEditor::on_m_composite_text_pb_clicked()
+{
CompositeTextEditDialog ctd(m_text_field.data() -> compositeText(), this);
if(ctd.exec()) {
QString ct = ctd.plainText();
@@ -349,7 +364,8 @@ void DynamicTextFieldEditor::on_m_composite_text_pb_clicked() {
}
}
-void DynamicTextFieldEditor::on_m_alignment_pb_clicked() {
+void DynamicTextFieldEditor::on_m_alignment_pb_clicked()
+{
AlignmentTextDialog atd(m_text_field.data() -> alignment(), this);
atd.exec();
@@ -364,7 +380,8 @@ void DynamicTextFieldEditor::on_m_alignment_pb_clicked() {
}
}
-void DynamicTextFieldEditor::on_m_font_pb_clicked() {
+void DynamicTextFieldEditor::on_m_font_pb_clicked()
+{
bool ok;
QFont font_ = QFontDialog::getFont(&ok, m_text_field -> font(), this);
if (ok && font_ != this -> font()) {
diff --git a/sources/editor/ui/polygoneditor.cpp b/sources/editor/ui/polygoneditor.cpp
index ed60e5c14..ed008fb04 100644
--- a/sources/editor/ui/polygoneditor.cpp
+++ b/sources/editor/ui/polygoneditor.cpp
@@ -48,7 +48,8 @@ PolygonEditor::PolygonEditor(QETElementEditor *editor,
/**
@brief PolygonEditor::~PolygonEditor
*/
-PolygonEditor::~PolygonEditor() {
+PolygonEditor::~PolygonEditor()
+{
delete ui;
}
@@ -115,11 +116,13 @@ bool PolygonEditor::setPart(CustomElementPart *new_part)
@brief PolygonEditor::currentPart
@return the curent edited part
*/
-CustomElementPart *PolygonEditor::currentPart() const {
+CustomElementPart *PolygonEditor::currentPart() const
+{
return m_part;
}
-QList PolygonEditor::currentParts() const {
+QList PolygonEditor::currentParts() const
+{
return m_style->currentParts();
}
diff --git a/sources/editor/ui/rectangleeditor.cpp b/sources/editor/ui/rectangleeditor.cpp
index 913b1976c..1bbc500c5 100644
--- a/sources/editor/ui/rectangleeditor.cpp
+++ b/sources/editor/ui/rectangleeditor.cpp
@@ -42,7 +42,8 @@ RectangleEditor::RectangleEditor(QETElementEditor *editor, PartRectangle *rect,
/**
@brief RectangleEditor::~RectangleEditor
*/
-RectangleEditor::~RectangleEditor() {
+RectangleEditor::~RectangleEditor()
+{
delete ui;
}
@@ -112,11 +113,13 @@ bool RectangleEditor::setParts(QList parts)
@brief RectangleEditor::currentPart
@return
*/
-CustomElementPart *RectangleEditor::currentPart() const {
+CustomElementPart *RectangleEditor::currentPart() const
+{
return m_part;
}
-QList RectangleEditor::currentParts() const {
+QList RectangleEditor::currentParts() const
+{
return m_style->currentParts();
}
@@ -124,7 +127,8 @@ QList RectangleEditor::currentParts() const {
@brief RectangleEditor::topLeft
@return The edited topLeft already mapped to part coordinate
*/
-QPointF RectangleEditor::editedTopLeft() const {
+QPointF RectangleEditor::editedTopLeft() const
+{
return m_part->mapFromScene(ui->m_x_sb->value(), ui->m_y_sb->value());
}
diff --git a/sources/editor/ui/texteditor.cpp b/sources/editor/ui/texteditor.cpp
index 7cc49dbd6..626cff20a 100644
--- a/sources/editor/ui/texteditor.cpp
+++ b/sources/editor/ui/texteditor.cpp
@@ -42,7 +42,8 @@ TextEditor::TextEditor(QETElementEditor *editor, PartText *text, QWidget *paren
/**
@brief TextEditor::~TextEditor
*/
-TextEditor::~TextEditor() {
+TextEditor::~TextEditor()
+{
delete ui;
}
@@ -79,14 +80,16 @@ void TextEditor::setUpChangeConnection(QPointer part) {
m_change_connection << connect(part, &PartText::colorChanged, this, &TextEditor::updateForm);
}
-void TextEditor::disconnectChangeConnection() {
+void TextEditor::disconnectChangeConnection()
+{
for (QMetaObject::Connection c : m_change_connection) {
disconnect(c);
}
m_change_connection.clear();
}
-void TextEditor::disconnectEditConnection() {
+void TextEditor::disconnectEditConnection()
+{
for (QMetaObject::Connection c : m_edit_connection) {
disconnect(c);
}
@@ -150,11 +153,13 @@ bool TextEditor::setParts(QList parts) {
@brief TextEditor::currentPart
@return The current part
*/
-CustomElementPart *TextEditor::currentPart() const {
+CustomElementPart *TextEditor::currentPart() const
+{
return m_text;
}
-QList TextEditor::currentParts() const {
+QList TextEditor::currentParts() const
+{
QList parts;
for (auto part: m_parts) {
parts.append(static_cast(part));
@@ -167,7 +172,8 @@ QList TextEditor::currentParts() const {
Setup the connection between the widgets of this editor and the undo command
use to apply the change to the edited text.
*/
-void TextEditor::setUpEditConnection() {
+void TextEditor::setUpEditConnection()
+{
disconnectEditConnection();
m_edit_connection << connect(ui -> m_line_edit, &QLineEdit::editingFinished, [this]() {
@@ -236,7 +242,8 @@ void TextEditor::setUpEditConnection() {
/**
@brief TextEditor::on_m_font_pb_clicked
*/
-void TextEditor::on_m_font_pb_clicked() {
+void TextEditor::on_m_font_pb_clicked()
+{
bool ok;
QFont font_ = QFontDialog::getFont(&ok, m_text -> font(), this);
diff --git a/sources/elementprovider.cpp b/sources/elementprovider.cpp
index 005fc2890..186aef0a0 100644
--- a/sources/elementprovider.cpp
+++ b/sources/elementprovider.cpp
@@ -72,7 +72,8 @@ QList ElementProvider::freeElement(const int filter) const{
@param uuid_list list of uuid must be found
@return all elements with uuid corresponding to uuid in uuid_list
*/
-QList ElementProvider::fromUuids(QList uuid_list) const {
+QList ElementProvider::fromUuids(QList uuid_list) const
+{
QList found_element;
foreach (Diagram *d, m_diagram_list) {
@@ -93,7 +94,8 @@ QList ElementProvider::fromUuids(QList uuid_list) const {
the filter for search element
(You can find all filter with the define in Element.h)
*/
-QList ElementProvider::find(const int filter) const {
+QList ElementProvider::find(const int filter) const
+{
QList elmt_;
//serch in all diagram
diff --git a/sources/elementscategoryeditor.cpp b/sources/elementscategoryeditor.cpp
index 6eceedc65..5848b6206 100644
--- a/sources/elementscategoryeditor.cpp
+++ b/sources/elementscategoryeditor.cpp
@@ -87,7 +87,8 @@ ElementsCategoryEditor::ElementsCategoryEditor(const ElementsLocation &location,
@brief ElementsCategoryEditor::~ElementsCategoryEditor
Destructor
*/
-ElementsCategoryEditor::~ElementsCategoryEditor() {
+ElementsCategoryEditor::~ElementsCategoryEditor()
+{
}
/**
diff --git a/sources/elementscollectioncache.cpp b/sources/elementscollectioncache.cpp
index 4bc5bfe47..f5d856aa2 100644
--- a/sources/elementscollectioncache.cpp
+++ b/sources/elementscollectioncache.cpp
@@ -104,7 +104,8 @@ ElementsCollectionCache::ElementsCollectionCache(const QString &database_path, Q
/**
Destructor
*/
-ElementsCollectionCache::~ElementsCollectionCache() {
+ElementsCollectionCache::~ElementsCollectionCache()
+{
delete select_name_;
delete select_pixmap_;
delete insert_name_;
@@ -123,7 +124,8 @@ void ElementsCollectionCache::setLocale(const QString &locale) {
/**
@return The locale to be used when dealing with names.
*/
-QString ElementsCollectionCache::locale() const {
+QString ElementsCollectionCache::locale() const
+{
return(locale_);
}
@@ -145,7 +147,8 @@ bool ElementsCollectionCache::setPixmapStorageFormat(const QString &format) {
@return the pixmap storage format. Default is "PNG"
@see setPixmapStorageFormat()
*/
-QString ElementsCollectionCache::pixmapStorageFormat() const {
+QString ElementsCollectionCache::pixmapStorageFormat() const
+{
return(pixmap_storage_format_);
}
@@ -190,14 +193,16 @@ bool ElementsCollectionCache::fetchElement(ElementsLocation &location)
/**
@return The last name fetched through fetchElement().
*/
-QString ElementsCollectionCache::name() const {
+QString ElementsCollectionCache::name() const
+{
return(current_name_);
}
/**
@return The last pixmap fetched through fetchElement().
*/
-QPixmap ElementsCollectionCache::pixmap() const {
+QPixmap ElementsCollectionCache::pixmap() const
+{
return(current_pixmap_);
}
diff --git a/sources/elementsmover.cpp b/sources/elementsmover.cpp
index a1a144e06..f147510e2 100644
--- a/sources/elementsmover.cpp
+++ b/sources/elementsmover.cpp
@@ -43,7 +43,8 @@ ElementsMover::ElementsMover() :
/**
@brief ElementsMover::~ElementsMover Destructor
*/
-ElementsMover::~ElementsMover() {
+ElementsMover::~ElementsMover()
+{
}
/**
@@ -51,7 +52,8 @@ ElementsMover::~ElementsMover() {
@return True if this element mover is ready to be used.
A element mover is ready when the previous managed movement is finish.
*/
-bool ElementsMover::isReady() const {
+bool ElementsMover::isReady() const
+{
return(!movement_running_);
}
diff --git a/sources/elementspanel.cpp b/sources/elementspanel.cpp
index 253e0f214..cbc93e4a9 100644
--- a/sources/elementspanel.cpp
+++ b/sources/elementspanel.cpp
@@ -74,7 +74,8 @@ ElementsPanel::ElementsPanel(QWidget *parent) :
/**
Destructeur
*/
-ElementsPanel::~ElementsPanel() {
+ElementsPanel::~ElementsPanel()
+{
}
/**
@@ -111,7 +112,8 @@ void ElementsPanel::startTitleBlockTemplateDrag(const TitleBlockTemplateLocation
/**
Ensure the filter is applied again after the panel content has changed.
*/
-void ElementsPanel::panelContentChange() {
+void ElementsPanel::panelContentChange()
+{
if (!filter_.isEmpty()) {
filter(filter_);
}
@@ -373,7 +375,8 @@ void ElementsPanel::projectWasClosed(QETProject *project) {
/**
Build filter list for multiple filter
*/
-void ElementsPanel::buildFilterList() {
+void ElementsPanel::buildFilterList()
+{
if (filter_.isEmpty()) return;
filter_list_ = filter_.split( '+' );
/*
diff --git a/sources/elementspanelwidget.cpp b/sources/elementspanelwidget.cpp
index 3ac356a84..0c97f92c7 100644
--- a/sources/elementspanelwidget.cpp
+++ b/sources/elementspanelwidget.cpp
@@ -124,14 +124,16 @@ ElementsPanelWidget::ElementsPanelWidget(QWidget *parent) : QWidget(parent) {
/**
Destructeur
*/
-ElementsPanelWidget::~ElementsPanelWidget() {
+ElementsPanelWidget::~ElementsPanelWidget()
+{
}
/**
Require the desktop environment to open the directory containing the file
represented by the selected item, if any.
*/
-void ElementsPanelWidget::openDirectoryForSelectedItem() {
+void ElementsPanelWidget::openDirectoryForSelectedItem()
+{
if (QTreeWidgetItem *qtwi = elements_panel -> currentItem()) {
QString dir_path = elements_panel -> dirPathForItem(qtwi);
if (!dir_path.isEmpty()) {
@@ -144,7 +146,8 @@ void ElementsPanelWidget::openDirectoryForSelectedItem() {
Copy the full path to the file represented by the selected item to the
clipboard.
*/
-void ElementsPanelWidget::copyPathForSelectedItem() {
+void ElementsPanelWidget::copyPathForSelectedItem()
+{
if (QTreeWidgetItem *qtwi = elements_panel -> currentItem()) {
QString file_path = elements_panel -> filePathForItem(qtwi);
file_path = QDir::toNativeSeparators(file_path);
@@ -157,7 +160,8 @@ void ElementsPanelWidget::copyPathForSelectedItem() {
/**
Recharge le panel d'elements
*/
-void ElementsPanelWidget::reloadAndFilter() {
+void ElementsPanelWidget::reloadAndFilter()
+{
// recharge tous les elements
elements_panel -> reload();
// reapplique le filtre
@@ -169,7 +173,8 @@ void ElementsPanelWidget::reloadAndFilter() {
/**
* Emit the requestForProject signal with te selected project
*/
-void ElementsPanelWidget::activateProject() {
+void ElementsPanelWidget::activateProject()
+{
if (QETProject *selected_project = elements_panel -> selectedProject()) {
emit(requestForProject(selected_project));
}
@@ -178,7 +183,8 @@ void ElementsPanelWidget::activateProject() {
/**
Emet le signal requestForProjectClosing avec le projet selectionne
*/
-void ElementsPanelWidget::closeProject() {
+void ElementsPanelWidget::closeProject()
+{
if (QETProject *selected_project = elements_panel -> selectedProject()) {
emit(requestForProjectClosing(selected_project));
}
@@ -187,7 +193,8 @@ void ElementsPanelWidget::closeProject() {
/**
Emet le signal requestForProjectPropertiesEdition avec le projet selectionne
*/
-void ElementsPanelWidget::editProjectProperties() {
+void ElementsPanelWidget::editProjectProperties()
+{
if (QETProject *selected_project = elements_panel -> selectedProject()) {
emit(requestForProjectPropertiesEdition(selected_project));
}
@@ -196,7 +203,8 @@ void ElementsPanelWidget::editProjectProperties() {
/**
Emet le signal requestForDiagramPropertiesEdition avec le schema selectionne
*/
-void ElementsPanelWidget::editDiagramProperties() {
+void ElementsPanelWidget::editDiagramProperties()
+{
if (Diagram *selected_diagram = elements_panel -> selectedDiagram()) {
emit(requestForDiagramPropertiesEdition(selected_diagram));
}
@@ -205,7 +213,8 @@ void ElementsPanelWidget::editDiagramProperties() {
/**
Emet le signal requestForNewDiagram avec le projet selectionne
*/
-void ElementsPanelWidget::newDiagram() {
+void ElementsPanelWidget::newDiagram()
+{
if (QETProject *selected_project = elements_panel -> selectedProject()) {
emit(requestForNewDiagram(selected_project));
}
@@ -214,7 +223,8 @@ void ElementsPanelWidget::newDiagram() {
/**
Emet le signal requestForDiagramDeletion avec le schema selectionne
*/
-void ElementsPanelWidget::deleteDiagram() {
+void ElementsPanelWidget::deleteDiagram()
+{
if (Diagram *selected_diagram = elements_panel -> selectedDiagram()) {
emit(requestForDiagramDeletion(selected_diagram));
}
@@ -223,7 +233,8 @@ void ElementsPanelWidget::deleteDiagram() {
/**
Emet le signal requestForDiagramMoveUpTop avec le schema selectionne
+*/
-void ElementsPanelWidget::moveDiagramUpTop() {
+void ElementsPanelWidget::moveDiagramUpTop()
+{
if (Diagram *selected_diagram = elements_panel -> selectedDiagram()) {
emit(requestForDiagramMoveUpTop(selected_diagram));
}
@@ -234,7 +245,8 @@ void ElementsPanelWidget::moveDiagramUpTop() {
/**
Emet le signal requestForDiagramMoveUp avec le schema selectionne
*/
-void ElementsPanelWidget::moveDiagramUp() {
+void ElementsPanelWidget::moveDiagramUp()
+{
if (Diagram *selected_diagram = elements_panel -> selectedDiagram()) {
emit(requestForDiagramMoveUp(selected_diagram));
}
@@ -243,7 +255,8 @@ void ElementsPanelWidget::moveDiagramUp() {
/**
Emet le signal requestForDiagramMoveDown avec le schema selectionne
*/
-void ElementsPanelWidget::moveDiagramDown() {
+void ElementsPanelWidget::moveDiagramDown()
+{
if (Diagram *selected_diagram = elements_panel -> selectedDiagram()) {
emit(requestForDiagramMoveDown(selected_diagram));
}
@@ -252,7 +265,8 @@ void ElementsPanelWidget::moveDiagramDown() {
/**
Emet le signal requestForDiagramMoveUpx10 avec le schema selectionne
*/
-void ElementsPanelWidget::moveDiagramUpx10() {
+void ElementsPanelWidget::moveDiagramUpx10()
+{
if (Diagram *selected_diagram = elements_panel -> selectedDiagram()) {
emit(requestForDiagramMoveUpx10(selected_diagram));
}
@@ -261,7 +275,8 @@ void ElementsPanelWidget::moveDiagramUpx10() {
/**
Emet le signal requestForDiagramMoveDownx10 avec le schema selectionne
*/
-void ElementsPanelWidget::moveDiagramDownx10() {
+void ElementsPanelWidget::moveDiagramDownx10()
+{
if (Diagram *selected_diagram = elements_panel -> selectedDiagram()) {
emit(requestForDiagramMoveDownx10(selected_diagram));
}
@@ -271,7 +286,8 @@ void ElementsPanelWidget::moveDiagramDownx10() {
/**
Opens a template editor to create a new title block template.
*/
-void ElementsPanelWidget::addTitleBlockTemplate() {
+void ElementsPanelWidget::addTitleBlockTemplate()
+{
QTreeWidgetItem *current_item = elements_panel -> currentItem();
if (!current_item) return;
@@ -285,7 +301,8 @@ void ElementsPanelWidget::addTitleBlockTemplate() {
/**
Opens an editor to edit the currently selected title block template, if any.
*/
-void ElementsPanelWidget::editTitleBlockTemplate() {
+void ElementsPanelWidget::editTitleBlockTemplate()
+{
QTreeWidgetItem *current_item = elements_panel -> currentItem();
if (current_item && current_item -> type() == QET::TitleBlockTemplate) {
QETApp::instance() -> openTitleBlockTemplate(
@@ -297,7 +314,8 @@ void ElementsPanelWidget::editTitleBlockTemplate() {
/**
Delete the currently selected title block template, if any.
*/
-void ElementsPanelWidget::removeTitleBlockTemplate() {
+void ElementsPanelWidget::removeTitleBlockTemplate()
+{
QTreeWidgetItem *current_item = elements_panel -> currentItem();
if (current_item && current_item -> type() == QET::TitleBlockTemplate) {
TitleBlockTemplateDeleter(
@@ -310,7 +328,8 @@ void ElementsPanelWidget::removeTitleBlockTemplate() {
/**
Met a jour les boutons afin d'assurer la coherence de l'interface
*/
-void ElementsPanelWidget::updateButtons() {
+void ElementsPanelWidget::updateButtons()
+{
QTreeWidgetItem *current_item = elements_panel -> currentItem();
int current_type = elements_panel -> currentItemType();
diff --git a/sources/elementspanelwidget.h b/sources/elementspanelwidget.h
index e1905621a..3d85f3e2a 100644
--- a/sources/elementspanelwidget.h
+++ b/sources/elementspanelwidget.h
@@ -107,7 +107,8 @@ class ElementsPanelWidget : public QWidget {
@brief ElementsPanelWidget::elementsPanel
@return The elements panel embedded within this widget.
*/
-inline ElementsPanel &ElementsPanelWidget::elementsPanel() const {
+inline ElementsPanel &ElementsPanelWidget::elementsPanel() const
+{
return(*elements_panel);
}
diff --git a/sources/elementtextsmover.cpp b/sources/elementtextsmover.cpp
index cb3cca76f..d7a5ed66d 100644
--- a/sources/elementtextsmover.cpp
+++ b/sources/elementtextsmover.cpp
@@ -25,14 +25,16 @@
/**
@brief ElementTextsMover::ElementTextsMover
*/
-ElementTextsMover::ElementTextsMover() {}
+ElementTextsMover::ElementTextsMover()
+{}
/**
@brief ElementTextsMover::isReady
@return true if this ElementTextsMover is ready to process a new movement.
False if this ElementTextsMover is actually process a movement
*/
-bool ElementTextsMover::isReady() const {
+bool ElementTextsMover::isReady() const
+{
return(!m_movement_running);
}
diff --git a/sources/exportdialog.cpp b/sources/exportdialog.cpp
index d00c4248d..4ecdefde6 100644
--- a/sources/exportdialog.cpp
+++ b/sources/exportdialog.cpp
@@ -43,7 +43,10 @@
@param project Le projet a exporter
@param parent Le Widget parent de ce dialogue
*/
-ExportDialog::ExportDialog(QETProject *project, QWidget *parent) : QDialog(parent) {
+ExportDialog::ExportDialog(
+ QETProject *project,
+ QWidget *parent) : QDialog(parent)
+{
if (!project) return;
// recupere le projet a exporter
@@ -105,13 +108,15 @@ ExportDialog::ExportDialog(QETProject *project, QWidget *parent) : QDialog(paren
/**
Destructeur - ne fait rien
*/
-ExportDialog::~ExportDialog() {
+ExportDialog::~ExportDialog()
+{
}
/**
@return le nombre de schemas coches (donc a exporter)
*/
-int ExportDialog::diagramsToExportCount() const {
+int ExportDialog::diagramsToExportCount() const
+{
int checked_diagrams_count = 0;
foreach(ExportDiagramLine *diagram_line, diagram_lines_.values()) {
if (diagram_line -> must_export -> isChecked()) ++ checked_diagrams_count;
@@ -123,7 +128,8 @@ int ExportDialog::diagramsToExportCount() const {
Met en place la liste des schemas
@return Le widget representant la liste des schemas
*/
-QWidget *ExportDialog::initDiagramsListPart() {
+QWidget *ExportDialog::initDiagramsListPart()
+{
preview_mapper_ = new QSignalMapper(this);
width_mapper_ = new QSignalMapper(this);
height_mapper_ = new QSignalMapper(this);
@@ -186,13 +192,15 @@ QWidget *ExportDialog::initDiagramsListPart() {
return(scroll_diagrams_list);
}
-void ExportDialog::slot_selectAllClicked() {
+void ExportDialog::slot_selectAllClicked()
+{
foreach (ExportDiagramLine *diagramLine, diagram_lines_) {
diagramLine -> must_export -> setChecked(true);
}
}
-void ExportDialog::slot_deSelectAllClicked() {
+void ExportDialog::slot_deSelectAllClicked()
+{
foreach (ExportDiagramLine *diagramLine, diagram_lines_) {
diagramLine -> must_export -> setChecked(false);
}
@@ -204,7 +212,8 @@ void ExportDialog::slot_deSelectAllClicked() {
@param diagram Un schema
@return le rapport largeur / hauteur du schema
*/
-qreal ExportDialog::diagramRatio(Diagram *diagram) {
+qreal ExportDialog::diagramRatio(Diagram *diagram)
+{
QSize diagram_size = diagramSize(diagram);
qreal diagram_ratio = (qreal)diagram_size.width() / (qreal)diagram_size.height();
return(diagram_ratio);
@@ -215,7 +224,8 @@ qreal ExportDialog::diagramRatio(Diagram *diagram) {
@return les dimensions du schema, en tenant compte du type d'export : cadre
ou elements
*/
-QSize ExportDialog::diagramSize(Diagram *diagram) {
+QSize ExportDialog::diagramSize(Diagram *diagram)
+{
// sauvegarde le parametre useBorder du schema
bool state_useBorder = diagram -> useBorder();
@@ -235,7 +245,8 @@ QSize ExportDialog::diagramSize(Diagram *diagram) {
activee pour ce schema.
@param diagram_id numero du schema concerne
*/
-void ExportDialog::slot_correctWidth(int diagram_id) {
+void ExportDialog::slot_correctWidth(int diagram_id)
+{
// recupere l'ExportDiagramLine concernee
ExportDialog::ExportDiagramLine *current_diagram = diagram_lines_[diagram_id];
if (!current_diagram) return;
@@ -258,7 +269,8 @@ void ExportDialog::slot_correctWidth(int diagram_id) {
activee pour ce schema.
@param diagram_id numero du schema concerne
*/
-void ExportDialog::slot_correctHeight(int diagram_id) {
+void ExportDialog::slot_correctHeight(int diagram_id)
+{
// recupere l'ExportDiagramLine concernee
ExportDialog::ExportDiagramLine *current_diagram = diagram_lines_[diagram_id];
if (!current_diagram) return;
@@ -280,7 +292,8 @@ void ExportDialog::slot_correctHeight(int diagram_id) {
proportions d'un des schemas
@param diagram_id numero du schema concerne
*/
-void ExportDialog::slot_keepRatioChanged(int diagram_id) {
+void ExportDialog::slot_keepRatioChanged(int diagram_id)
+{
// recupere l'ExportDiagramLine concernee
ExportDialog::ExportDiagramLine *current_diagram = diagram_lines_[diagram_id];
if (!current_diagram) return;
@@ -303,7 +316,8 @@ void ExportDialog::slot_keepRatioChanged(int diagram_id) {
Reinitialise les dimensions d'un des schemas
@param diagram_id numero du schema concerne
*/
-void ExportDialog::slot_resetSize(int diagram_id) {
+void ExportDialog::slot_resetSize(int diagram_id)
+{
// recupere l'ExportDiagramLine concernee
ExportDialog::ExportDiagramLine *current_diagram = diagram_lines_[diagram_id];
if (!current_diagram) return;
@@ -328,7 +342,12 @@ void ExportDialog::slot_resetSize(int diagram_id) {
@param keep_aspect_ratio True pour conserver le ratio, false sinon
@return l'image a exporter
*/
-QImage ExportDialog::generateImage(Diagram *diagram, int width, int height, bool keep_aspect_ratio) {
+QImage ExportDialog::generateImage(
+ Diagram *diagram,
+ int width,
+ int height,
+ bool keep_aspect_ratio)
+{
saveReloadDiagramParameters(diagram, true);
QImage image(width, height, QImage::Format_RGB32);
@@ -370,7 +389,13 @@ void ExportDialog::saveReloadDiagramParameters(Diagram *diagram, bool save) {
@param keep_aspect_ratio True pour conserver le ratio, false sinon
@param io_device Peripherique de sortie pour le code SVG (souvent : un fichier)
*/
-void ExportDialog::generateSvg(Diagram *diagram, int width, int height, bool keep_aspect_ratio, QIODevice &io_device) {
+void ExportDialog::generateSvg(
+ Diagram *diagram,
+ int width,
+ int height,
+ bool keep_aspect_ratio,
+ QIODevice &io_device)
+{
saveReloadDiagramParameters(diagram, true);
// genere une QPicture a partir du schema
@@ -399,10 +424,12 @@ void ExportDialog::generateSvg(Diagram *diagram, int width, int height, bool kee
@param height Hauteur de l'export DXF
@param file_path
*/
-void ExportDialog::generateDxf(Diagram *diagram,
+void ExportDialog::generateDxf(
+ Diagram *diagram,
int width,
int height,
- QString &file_path) {
+ QString &file_path)
+{
saveReloadDiagramParameters(diagram, true);
width -= 2*Diagram::margin;
@@ -691,7 +718,8 @@ QPointF ExportDialog::rotation_transformed(qreal px,
/**
Slot effectuant les exports apres la validation du dialogue.
*/
-void ExportDialog::slot_export() {
+void ExportDialog::slot_export()
+{
// recupere la liste des schemas a exporter
QList diagrams_to_export;
foreach(ExportDiagramLine *diagram_line, diagram_lines_.values()) {
@@ -817,7 +845,8 @@ void ExportDialog::exportDiagram(ExportDiagramLine *diagram_line) {
Slot appele lorsque l'utilisateur change la zone du schema qui doit etre
exportee. Il faut alors ajuster les dimensions des schemas.
*/
-void ExportDialog::slot_changeUseBorder() {
+void ExportDialog::slot_changeUseBorder()
+{
// parcourt les schemas a exporter
foreach(int diagram_id, diagram_lines_.keys()) {
ExportDiagramLine *diagram_line = diagram_lines_[diagram_id];
@@ -835,7 +864,8 @@ void ExportDialog::slot_changeUseBorder() {
schemas coches, et il garde au plus un schema coche si on exporte vers
le presse-papier.
*/
-void ExportDialog::slot_checkDiagramsCount() {
+void ExportDialog::slot_checkDiagramsCount()
+{
QPushButton *export_button = buttons -> button(QDialogButtonBox::Save);
export_button -> setEnabled(diagramsToExportCount());
}
@@ -1022,14 +1052,16 @@ ExportDialog::ExportDiagramLine::ExportDiagramLine(Diagram *dia, QSize diagram_s
/**
Destructeur
*/
-ExportDialog::ExportDiagramLine::~ExportDiagramLine() {
+ExportDialog::ExportDiagramLine::~ExportDiagramLine()
+{
}
/**
@return un layout contenant les widgets necessaires a la gestion de la
taille d'un schema avant son export.
*/
-QBoxLayout *ExportDialog::ExportDiagramLine::sizeLayout() {
+QBoxLayout *ExportDialog::ExportDiagramLine::sizeLayout()
+{
QHBoxLayout *layout = new QHBoxLayout();
layout -> addWidget(width);
layout -> addWidget(x_label);
diff --git a/sources/exportdialog.h b/sources/exportdialog.h
index 15782c299..368970779 100644
--- a/sources/exportdialog.h
+++ b/sources/exportdialog.h
@@ -29,21 +29,19 @@ class ExportPropertiesWidget;
*/
class ExportDialog : public QDialog {
Q_OBJECT
-
- // constructors, destructor
+
public:
+ // constructors, destructor
ExportDialog(QETProject *, QWidget * = nullptr);
~ExportDialog() override;
-
- private:
- ExportDialog(const ExportDialog &);
-
+
// methods
- public:
int diagramsToExportCount() const;
static QPointF rotation_transformed(qreal, qreal, qreal, qreal, qreal);
-
+
private:
+ ExportDialog(const ExportDialog &);
+
class ExportDiagramLine {
public:
ExportDiagramLine(Diagram *, QSize);
@@ -85,7 +83,6 @@ class ExportDialog : public QDialog {
QETProject *project_;
// methods
- private:
QWidget *initDiagramsListPart();
void saveReloadDiagramParameters(Diagram *, bool = true);
void generateSvg(Diagram *, int, int, bool, QIODevice &);
diff --git a/sources/exportproperties.cpp b/sources/exportproperties.cpp
index e3cf4f0c4..791efe0c8 100644
--- a/sources/exportproperties.cpp
+++ b/sources/exportproperties.cpp
@@ -44,7 +44,8 @@ ExportProperties::ExportProperties() :
/**
Destructeur
*/
-ExportProperties::~ExportProperties() {
+ExportProperties::~ExportProperties()
+{
}
/**
@@ -53,7 +54,8 @@ ExportProperties::~ExportProperties() {
@param prefix prefixe a ajouter devant les noms des parametres
*/
void ExportProperties::toSettings(QSettings &settings,
- const QString &prefix) const {
+ const QString &prefix) const
+{
settings.setValue(prefix + "path",
QDir::toNativeSeparators(
destination_directory.absolutePath()));
diff --git a/sources/exportpropertieswidget.cpp b/sources/exportpropertieswidget.cpp
index ec483fab2..902eb7347 100644
--- a/sources/exportpropertieswidget.cpp
+++ b/sources/exportpropertieswidget.cpp
@@ -45,14 +45,16 @@ ExportPropertiesWidget::ExportPropertiesWidget(const ExportProperties &export_pr
@brief ExportPropertiesWidget::~ExportPropertiesWidget
Destructeur
*/
-ExportPropertiesWidget::~ExportPropertiesWidget() {
+ExportPropertiesWidget::~ExportPropertiesWidget()
+{
}
/**
@brief ExportPropertiesWidget::exportProperties
@return les parametres d'export definis via le widget
*/
-ExportProperties ExportPropertiesWidget::exportProperties() const {
+ExportProperties ExportPropertiesWidget::exportProperties() const
+{
ExportProperties export_properties;
export_properties.destination_directory = QDir(dirpath -> text());
@@ -120,7 +122,8 @@ void ExportPropertiesWidget::setPrintingMode(bool mode) {
Slot asking the user to choose a folder
/ Slot demandant a l'utilisateur de choisir un dossier
*/
-void ExportPropertiesWidget::slot_chooseADirectory() {
+void ExportPropertiesWidget::slot_chooseADirectory()
+{
QString user_dir = QFileDialog::getExistingDirectory(
this,
tr("Exporter dans le dossier", "dialog title"),
@@ -136,7 +139,8 @@ void ExportPropertiesWidget::slot_chooseADirectory() {
Generated the ExportPropertiesWidget ui
/ Cette methode construit le widget en lui-meme
*/
-void ExportPropertiesWidget::build() {
+void ExportPropertiesWidget::build()
+{
// le dialogue est un empilement vertical d'elements
QVBoxLayout *vboxLayout = new QVBoxLayout();
vboxLayout -> setContentsMargins(0, 0, 0, 0);
diff --git a/sources/factory/elementpicturefactory.cpp b/sources/factory/elementpicturefactory.cpp
index 34021c030..d21b237ae 100644
--- a/sources/factory/elementpicturefactory.cpp
+++ b/sources/factory/elementpicturefactory.cpp
@@ -126,7 +126,8 @@ ElementPictureFactory::primitives ElementPictureFactory::getPrimitives(
return m_primitives_H.value(location.uuid());
}
-ElementPictureFactory::~ElementPictureFactory() {
+ElementPictureFactory::~ElementPictureFactory()
+{
for (primitives p : m_primitives_H.values()) {
qDeleteAll(p.m_texts);
}
diff --git a/sources/factory/ui/addtabledialog.cpp b/sources/factory/ui/addtabledialog.cpp
index 4023add76..b547813ee 100644
--- a/sources/factory/ui/addtabledialog.cpp
+++ b/sources/factory/ui/addtabledialog.cpp
@@ -48,7 +48,8 @@ AddTableDialog::AddTableDialog(QWidget *content_widget, QWidget *parent) :
/**
@brief AddTableDialog::~AddNomenclatureDialog
*/
-AddTableDialog::~AddTableDialog() {
+AddTableDialog::~AddTableDialog()
+{
delete ui;
}
@@ -65,7 +66,8 @@ void AddTableDialog::setQueryWidget(QWidget *widget) {
@brief AddTableDialog::adjustTableToFolio
@return
*/
-bool AddTableDialog::adjustTableToFolio() const {
+bool AddTableDialog::adjustTableToFolio() const
+{
return ui->m_adjust_table_size_cb->isChecked();
}
@@ -73,7 +75,8 @@ bool AddTableDialog::adjustTableToFolio() const {
@brief AddTableDialog::addNewTableToNewDiagram
@return
*/
-bool AddTableDialog::addNewTableToNewDiagram() const {
+bool AddTableDialog::addNewTableToNewDiagram() const
+{
return ui->m_add_table_and_folio->isChecked();
}
@@ -81,7 +84,8 @@ bool AddTableDialog::addNewTableToNewDiagram() const {
@brief AddTableDialog::tableName
@return
*/
-QString AddTableDialog::tableName() const {
+QString AddTableDialog::tableName() const
+{
return ui->m_table_name_le->text();
}
@@ -89,7 +93,8 @@ QString AddTableDialog::tableName() const {
@brief AddTableDialog::headerMargins
@return
*/
-QMargins AddTableDialog::headerMargins() const {
+QMargins AddTableDialog::headerMargins() const
+{
return m_header_margins;
}
@@ -113,7 +118,8 @@ Qt::Alignment AddTableDialog::headerAlignment() const
@brief AddTableDialog::headerFont
@return
*/
-QFont AddTableDialog::headerFont() const {
+QFont AddTableDialog::headerFont() const
+{
return m_header_font;
}
@@ -121,7 +127,8 @@ QFont AddTableDialog::headerFont() const {
@brief AddTableDialog::tableMargins
@return
*/
-QMargins AddTableDialog::tableMargins() const {
+QMargins AddTableDialog::tableMargins() const
+{
return m_table_margins;
}
@@ -145,11 +152,13 @@ Qt::Alignment AddTableDialog::tableAlignment() const
@brief AddTableDialog::tableFont
@return
*/
-QFont AddTableDialog::tableFont() const {
+QFont AddTableDialog::tableFont() const
+{
return m_table_font;
}
-QWidget *AddTableDialog::contentWidget() const {
+QWidget *AddTableDialog::contentWidget() const
+{
return m_content_widget;
}
diff --git a/sources/genericpanel.cpp b/sources/genericpanel.cpp
index d054fb309..e125616bb 100644
--- a/sources/genericpanel.cpp
+++ b/sources/genericpanel.cpp
@@ -39,13 +39,15 @@ GenericPanel::GenericPanel(QWidget *parent) :
/**
Destructor
*/
-GenericPanel::~GenericPanel() {
+GenericPanel::~GenericPanel()
+{
}
/**
@return the type of the current item
*/
-int GenericPanel::currentItemType() {
+int GenericPanel::currentItemType()
+{
QTreeWidgetItem *current_qtwi = currentItem();
if (!current_qtwi) return(0);
return(current_qtwi -> type());
@@ -56,7 +58,8 @@ int GenericPanel::currentItemType() {
@param item
@return nullptr
*/
-QETProject *GenericPanel::projectForItem(QTreeWidgetItem *item) const {
+QETProject *GenericPanel::projectForItem(QTreeWidgetItem *item) const
+{
if (item && item -> type() == QET::Project) {
return(valueForItem(item));
}
@@ -69,7 +72,8 @@ QETProject *GenericPanel::projectForItem(QTreeWidgetItem *item) const {
@param item
@return nullptr
*/
-Diagram *GenericPanel::diagramForItem(QTreeWidgetItem *item) const {
+Diagram *GenericPanel::diagramForItem(QTreeWidgetItem *item) const
+{
if (item && item -> type() == QET::Diagram) {
return(valueForItem(item));
}
@@ -82,7 +86,8 @@ Diagram *GenericPanel::diagramForItem(QTreeWidgetItem *item) const {
@return TitleBlockTemplateLocation()
*/
TitleBlockTemplateLocation GenericPanel::templateLocationForItem(
- QTreeWidgetItem *item) const {
+ QTreeWidgetItem *item) const
+{
if (item && item -> type() & QET::TitleBlockTemplatesCollectionItem) {
return(valueForItem(item));
}
@@ -93,7 +98,8 @@ TitleBlockTemplateLocation GenericPanel::templateLocationForItem(
@brief GenericPanel::selectedProject
@return projectForItem(currentItem())
*/
-QETProject *GenericPanel::selectedProject() const {
+QETProject *GenericPanel::selectedProject() const
+{
return(projectForItem(currentItem()));
}
@@ -101,7 +107,8 @@ QETProject *GenericPanel::selectedProject() const {
@brief GenericPanel::selectedDiagram
@return diagramForItem(currentItem())
*/
-Diagram *GenericPanel::selectedDiagram() const {
+Diagram *GenericPanel::selectedDiagram() const
+{
return(diagramForItem(currentItem()));
}
@@ -109,7 +116,8 @@ Diagram *GenericPanel::selectedDiagram() const {
@brief GenericPanel::selectedTemplateLocation
@return templateLocationForItem(currentItem())
*/
-TitleBlockTemplateLocation GenericPanel::selectedTemplateLocation() const {
+TitleBlockTemplateLocation GenericPanel::selectedTemplateLocation() const
+{
return(templateLocationForItem(currentItem()));
}
@@ -931,7 +939,8 @@ void GenericPanel::reparent(QTreeWidgetItem *item, QTreeWidgetItem *parent) {
QList GenericPanel::childItems(
QTreeWidgetItem *item,
QET::ItemType type,
- bool recursive) const {
+ bool recursive) const
+{
QList items;
if (!item) return(items);
for (int i = 0 ; i < item -> childCount() ; ++ i) {
@@ -976,7 +985,8 @@ void GenericPanel::removeObsoleteItems(
@return the value stored in \a item
*/
template
-T GenericPanel::valueForItem(QTreeWidgetItem *item) const {
+T GenericPanel::valueForItem(QTreeWidgetItem *item) const
+{
return item -> data(0, GenericPanel::Item).value();
}
template TitleBlockTemplateLocation
@@ -1027,6 +1037,7 @@ bool GenericPanel::event(QEvent *event) {
@brief GenericPanel::emitFirstActivated
Emit the signal firstActivated().
*/
-void GenericPanel::emitFirstActivated() {
+void GenericPanel::emitFirstActivated()
+{
emit(firstActivated());
}
diff --git a/sources/newelementwizard.cpp b/sources/newelementwizard.cpp
index 65113e8a5..2ed23594e 100644
--- a/sources/newelementwizard.cpp
+++ b/sources/newelementwizard.cpp
@@ -51,7 +51,8 @@ NewElementWizard::NewElementWizard(QWidget *parent, Qt::WindowFlags f) :
/**
Destructeur
*/
-NewElementWizard::~NewElementWizard() {
+NewElementWizard::~NewElementWizard()
+{
}
/**
@@ -99,7 +100,8 @@ QWizardPage *NewElementWizard::buildStep1()
@brief NewElementWizard::buildStep2
@return
*/
-QWizardPage *NewElementWizard::buildStep2() {
+QWizardPage *NewElementWizard::buildStep2()
+{
QWizardPage *page = new QWizardPage();
page -> setProperty("WizardState", Filename);
page -> setTitle(tr("Étape 2/3 : Nom du fichier", "wizard page title"));
@@ -123,7 +125,8 @@ QWizardPage *NewElementWizard::buildStep2() {
@brief NewElementWizard::buildStep3
@return
*/
-QWizardPage *NewElementWizard::buildStep3() {
+QWizardPage *NewElementWizard::buildStep3()
+{
QWizardPage *page = new QWizardPage();
page -> setProperty("WizardState", Names);
page -> setTitle(tr("Étape 3/3 : Noms de l'élément", "wizard page title"));
@@ -202,7 +205,8 @@ bool NewElementWizard::validStep1()
Valid the step 2
@return true if step is valid
*/
-bool NewElementWizard::validStep2() {
+bool NewElementWizard::validStep2()
+{
QString file_name = m_qle_filename -> text();
if (file_name.isEmpty()) {
@@ -233,7 +237,8 @@ bool NewElementWizard::validStep2() {
@brief NewElementWizard::createNewElement
Lauch an element editor for create the new element
*/
-void NewElementWizard::createNewElement() {
+void NewElementWizard::createNewElement()
+{
QETElementEditor *edit_new_element = new QETElementEditor(parentWidget());
edit_new_element -> setNames(m_names_list -> names());
diff --git a/sources/projectconfigpages.cpp b/sources/projectconfigpages.cpp
index 92505d649..a26b4d547 100644
--- a/sources/projectconfigpages.cpp
+++ b/sources/projectconfigpages.cpp
@@ -46,13 +46,15 @@ ProjectConfigPage::ProjectConfigPage(QETProject *project, QWidget *parent) :
/**
Destructor
*/
-ProjectConfigPage::~ProjectConfigPage() {
+ProjectConfigPage::~ProjectConfigPage()
+{
}
/**
@return the project being edited by this page
*/
-QETProject *ProjectConfigPage::project() const {
+QETProject *ProjectConfigPage::project() const
+{
return(m_project);
}
@@ -81,7 +83,8 @@ QETProject *ProjectConfigPage::setProject(QETProject *new_project,
/**
Apply the configuration after user input
*/
-void ProjectConfigPage::applyConf() {
+void ProjectConfigPage::applyConf()
+{
if (!m_project || m_project -> isReadOnly()) return;
applyProjectConf();
}
@@ -91,7 +94,8 @@ void ProjectConfigPage::applyConf() {
readValuesFromProject() and adjustReadOnly() if a non-zero project has been
set. Typically, you should call this function in your subclass constructor.
*/
-void ProjectConfigPage::init() {
+void ProjectConfigPage::init()
+{
initWidgets();
initLayout();
if (m_project) {
@@ -116,27 +120,31 @@ ProjectMainConfigPage::ProjectMainConfigPage(QETProject *project, QWidget *paren
/**
Destructor
*/
-ProjectMainConfigPage::~ProjectMainConfigPage() {
+ProjectMainConfigPage::~ProjectMainConfigPage()
+{
}
/**
@return the title for this page
*/
-QString ProjectMainConfigPage::title() const {
+QString ProjectMainConfigPage::title() const
+{
return(tr("Général", "configuration page title"));
}
/**
@return the icon for this page
*/
-QIcon ProjectMainConfigPage::icon() const {
+QIcon ProjectMainConfigPage::icon() const
+{
return(QET::Icons::Settings);
}
/**
Apply the configuration after user input
*/
-void ProjectMainConfigPage::applyProjectConf() {
+void ProjectMainConfigPage::applyProjectConf()
+{
bool modified_project = false;
QString new_title = title_value_ -> text();
@@ -158,14 +166,16 @@ void ProjectMainConfigPage::applyProjectConf() {
/**
@return the project title entered by the user
*/
-QString ProjectMainConfigPage::projectTitle() const {
+QString ProjectMainConfigPage::projectTitle() const
+{
return(title_value_ -> text());
}
/**
Initialize widgets displayed by the page.
*/
-void ProjectMainConfigPage::initWidgets() {
+void ProjectMainConfigPage::initWidgets()
+{
title_label_ = new QLabel(tr("Titre du projet :", "label when configuring"));
title_value_ = new QLineEdit();
title_information_ = new QLabel(tr("Ce titre sera disponible pour tous les folios de ce projet en tant que %projecttitle.", "informative label"));
@@ -183,7 +193,8 @@ void ProjectMainConfigPage::initWidgets() {
/**
Initialize the layout of this page.
*/
-void ProjectMainConfigPage::initLayout() {
+void ProjectMainConfigPage::initLayout()
+{
QVBoxLayout *main_layout0 = new QVBoxLayout();
QHBoxLayout *title_layout0 = new QHBoxLayout();
title_layout0 -> addWidget(title_label_);
@@ -201,7 +212,8 @@ void ProjectMainConfigPage::initLayout() {
/**
Read properties from the edited project then fill widgets with them.
*/
-void ProjectMainConfigPage::readValuesFromProject() {
+void ProjectMainConfigPage::readValuesFromProject()
+{
title_value_ -> setText(m_project -> title());
project_variables_ -> setContext(m_project -> projectProperties());
}
@@ -210,7 +222,8 @@ void ProjectMainConfigPage::readValuesFromProject() {
Set the content of this page read only if the project is read only,
editable if the project is editable.
*/
-void ProjectMainConfigPage::adjustReadOnly() {
+void ProjectMainConfigPage::adjustReadOnly()
+{
bool is_read_only = m_project -> isReadOnly();
title_value_ -> setReadOnly(is_read_only);
}
@@ -237,7 +250,8 @@ ProjectAutoNumConfigPage::ProjectAutoNumConfigPage (QETProject *project,
Title of this config page
@return
*/
-QString ProjectAutoNumConfigPage::title() const {
+QString ProjectAutoNumConfigPage::title() const
+{
return tr("Numérotation auto");
}
@@ -246,14 +260,16 @@ QString ProjectAutoNumConfigPage::title() const {
Icon of this config pafe
@return
*/
-QIcon ProjectAutoNumConfigPage::icon() const {
+QIcon ProjectAutoNumConfigPage::icon() const
+{
return QIcon (QET::Icons::AutoNum);
}
/**
@brief ProjectAutoNumConfigPage::applyProjectConf
*/
-void ProjectAutoNumConfigPage::applyProjectConf() {}
+void ProjectAutoNumConfigPage::applyProjectConf()
+{}
/**
@brief ProjectAutoNumConfigPage::initWidgets
@@ -314,7 +330,8 @@ void ProjectAutoNumConfigPage::readValuesFromProject()
@brief ProjectAutoNumConfigPage::adjustReadOnly
set this config page disable if project is read only
*/
-void ProjectAutoNumConfigPage::adjustReadOnly() {
+void ProjectAutoNumConfigPage::adjustReadOnly()
+{
}
/**
@@ -460,7 +477,8 @@ void ProjectAutoNumConfigPage::saveContextConductor()
@brief ProjectAutoNumConfigPage::saveContext_folio
Save the current displayed folio context in project
*/
-void ProjectAutoNumConfigPage::saveContextFolio() {
+void ProjectAutoNumConfigPage::saveContextFolio()
+{
// If the text is the default text "Name of new numerotation" save the edited context
// With the the name "No name"
if (m_saw_folio->contextComboBox() -> currentText() == tr("Nom de la nouvelle numérotation")) {
@@ -483,7 +501,8 @@ void ProjectAutoNumConfigPage::saveContextFolio() {
@brief ProjectAutoNumConfigPage::applyAutoNum
Apply auto folio numbering, New Folios or Selected Folios
*/
-void ProjectAutoNumConfigPage::applyAutoNum() {
+void ProjectAutoNumConfigPage::applyAutoNum()
+{
if (m_faw->newFolios){
int foliosRemaining = m_faw->newFoliosNumber();
@@ -507,7 +526,8 @@ void ProjectAutoNumConfigPage::applyAutoNum() {
@brief ProjectAutoNumConfigPage::applyAutoManagement
Apply Management Options in Selected Folios
*/
-void ProjectAutoNumConfigPage::applyManagement() {
+void ProjectAutoNumConfigPage::applyManagement()
+{
int from;
int to;
//Apply to Entire Project
@@ -601,7 +621,8 @@ void ProjectAutoNumConfigPage::applyManagement() {
@brief ProjectAutoNumConfigPage::removeContext
Remove from project the current conductor numerotation context
*/
-void ProjectAutoNumConfigPage::removeContextConductor() {
+void ProjectAutoNumConfigPage::removeContextConductor()
+{
//if default text, return
if ( m_saw_conductor->contextComboBox()-> currentText() == tr("Nom de la nouvelle numérotation") ) return;
m_project -> removeConductorAutoNum (m_saw_conductor->contextComboBox()-> currentText() );
@@ -613,7 +634,8 @@ void ProjectAutoNumConfigPage::removeContextConductor() {
@brief ProjectAutoNumConfigPage::removeContext_folio
Remove from project the current folio numerotation context
*/
-void ProjectAutoNumConfigPage::removeContextFolio() {
+void ProjectAutoNumConfigPage::removeContextFolio()
+{
//if default text, return
if ( m_saw_folio->contextComboBox() -> currentText() == tr("Nom de la nouvelle numérotation") ) return;
m_project -> removeFolioAutoNum (m_saw_folio->contextComboBox() -> currentText() );
diff --git a/sources/projectview.cpp b/sources/projectview.cpp
index 73966d1c9..95b99b4ee 100644
--- a/sources/projectview.cpp
+++ b/sources/projectview.cpp
@@ -54,7 +54,8 @@ ProjectView::ProjectView(QETProject *project, QWidget *parent) :
Destructeur
Supprime les DiagramView embarquees
*/
-ProjectView::~ProjectView() {
+ProjectView::~ProjectView()
+{
for (auto dv_ : m_diagram_ids.values())
dv_->deleteLater();
}
@@ -62,7 +63,8 @@ ProjectView::~ProjectView() {
/**
@return le projet actuellement visualise par le ProjectView
*/
-QETProject *ProjectView::project() {
+QETProject *ProjectView::project()
+{
return(m_project);
}
@@ -94,7 +96,8 @@ void ProjectView::setProject(QETProject *project)
/**
@return la liste des schemas ouverts dans le projet
*/
-QList ProjectView::diagram_views() const {
+QList ProjectView::diagram_views() const
+{
return(m_diagram_view_list);
}
@@ -102,7 +105,8 @@ QList ProjectView::diagram_views() const {
@brief ProjectView::currentDiagram
@return The current active diagram view or nullptr if there isn't diagramView in this project view.
*/
-DiagramView *ProjectView::currentDiagram() const {
+DiagramView *ProjectView::currentDiagram() const
+{
int current_tab_index = m_tab -> currentIndex();
if (current_tab_index == -1)
return nullptr;
@@ -126,7 +130,8 @@ void ProjectView::closeEvent(QCloseEvent *qce) {
/**
@brief change current diagramview to next folio
*/
-void ProjectView::changeTabDown(){
+void ProjectView::changeTabDown()
+{
DiagramView *nextDiagramView = this->nextDiagram();
if (nextDiagramView!=nullptr){
rebuildDiagramsMap();
@@ -137,7 +142,8 @@ void ProjectView::changeTabDown(){
/**
@return next folio of current diagramview
*/
-DiagramView *ProjectView::nextDiagram() {
+DiagramView *ProjectView::nextDiagram()
+{
int current_tab_index = m_tab -> currentIndex();
int next_tab_index = current_tab_index + 1; //get next tab index
if (next_tab_index= greatest tab the last tab is activated so no need to change tab.
@@ -149,7 +155,8 @@ DiagramView *ProjectView::nextDiagram() {
/**
@brief change current diagramview to previous tab
*/
-void ProjectView::changeTabUp(){
+void ProjectView::changeTabUp()
+{
DiagramView *previousDiagramView = this->previousDiagram();
if (previousDiagramView!=nullptr){
rebuildDiagramsMap();
@@ -160,7 +167,8 @@ void ProjectView::changeTabUp(){
/**
@return previous folio of current diagramview
*/
-DiagramView *ProjectView::previousDiagram() {
+DiagramView *ProjectView::previousDiagram()
+{
int current_tab_index = m_tab -> currentIndex();
int previous_tab_index = current_tab_index - 1; //get previous tab index
if (previous_tab_index>=0) //if previous tab index = 0 then the first tab is activated so no need to change tab.
@@ -172,7 +180,8 @@ DiagramView *ProjectView::previousDiagram() {
/**
@brief change current diagramview to last tab
*/
-void ProjectView::changeLastTab(){
+void ProjectView::changeLastTab()
+{
DiagramView *lastDiagramView = this->lastDiagram();
m_tab->setCurrentWidget(lastDiagramView);
}
@@ -180,14 +189,16 @@ void ProjectView::changeLastTab(){
/**
@return last folio of current project
*/
-DiagramView *ProjectView::lastDiagram(){
+DiagramView *ProjectView::lastDiagram()
+{
return(m_diagram_ids.last());
}
/**
@brief change current diagramview to first tab
*/
-void ProjectView::changeFirstTab(){
+void ProjectView::changeFirstTab()
+{
DiagramView *firstDiagramView = this->firstDiagram();
m_tab->setCurrentWidget(firstDiagramView);
}
@@ -195,7 +206,8 @@ void ProjectView::changeFirstTab(){
/**
@return first folio of current project
*/
-DiagramView *ProjectView::firstDiagram(){
+DiagramView *ProjectView::firstDiagram()
+{
return(m_diagram_ids.first());
}
@@ -208,7 +220,8 @@ DiagramView *ProjectView::firstDiagram(){
@see tryClosingElementEditors()
@see tryClosingDiagrams()
*/
-bool ProjectView::tryClosing() {
+bool ProjectView::tryClosing()
+{
if (!m_project) return(true);
// First step: require external editors closing -- users may either cancel
@@ -257,7 +270,8 @@ bool ProjectView::tryClosing() {
d'un editeur d'element.
@return true si tous les editeurs d'element ont pu etre fermes, false sinon
*/
-bool ProjectView::tryClosingElementEditors() {
+bool ProjectView::tryClosingElementEditors()
+{
if (!m_project) return(true);
/*
La QETApp permet d'acceder rapidement aux editeurs d'element
@@ -281,7 +295,8 @@ bool ProjectView::tryClosingElementEditors() {
a dialog ask if user want to save the modification.
@return the answer of dialog or discard if no change.
*/
-int ProjectView::tryClosingDiagrams() {
+int ProjectView::tryClosingDiagrams()
+{
if (!m_project) return(QMessageBox::Discard);
if (!project()->projectOptionsWereModified() &&
@@ -339,7 +354,8 @@ QString ProjectView::askUserForFilePath(bool assign) {
@return the QETResult object to be returned when it appears this project
view is not associated to any project.
*/
-QETResult ProjectView::noProjectResult() const {
+QETResult ProjectView::noProjectResult() const
+{
QETResult no_project(tr("aucun projet affiché", "error message"), false);
return(no_project);
}
@@ -421,7 +437,8 @@ void ProjectView::showDiagram(Diagram *diagram) {
Enable the user to edit properties of the current project through a
configuration dialog.
*/
-void ProjectView::editProjectProperties() {
+void ProjectView::editProjectProperties()
+{
if (!m_project) return;
ProjectPropertiesDialog dialog(m_project, parentWidget());
dialog.exec();
@@ -430,7 +447,8 @@ void ProjectView::editProjectProperties() {
/**
Edite les proprietes du schema courant
*/
-void ProjectView::editCurrentDiagramProperties() {
+void ProjectView::editCurrentDiagramProperties()
+{
editDiagramProperties(currentDiagram());
}
@@ -561,7 +579,8 @@ void ProjectView::moveDiagramDownx10(Diagram *diagram) {
Ce slot demarre un dialogue permettant a l'utilisateur de parametrer et de
lancer l'impression de toute ou partie du projet.
*/
-void ProjectView::printProject() {
+void ProjectView::printProject()
+{
if (!m_project) return;
// transforme le titre du projet en nom utilisable pour le document
@@ -591,7 +610,8 @@ void ProjectView::printProject() {
/**
Exporte le schema.
*/
-void ProjectView::exportProject() {
+void ProjectView::exportProject()
+{
if (!m_project) return;
ExportDialog ed(m_project, parentWidget());
@@ -607,7 +627,8 @@ void ProjectView::exportProject() {
@see setFilePath()
@return a QETResult object reflecting the situation
*/
-QETResult ProjectView::save() {
+QETResult ProjectView::save()
+{
return(doSave());
}
@@ -658,7 +679,8 @@ QETResult ProjectView::doSave()
@return an integer value above zero if elements and/or categories were
cleaned.
*/
-int ProjectView::cleanProject() {
+int ProjectView::cleanProject()
+{
if (!m_project) return(0);
// s'assure que le schema n'est pas en lecture seule
@@ -733,7 +755,8 @@ void ProjectView::initActions()
/**
Initialize child widgets for this widget.
*/
-void ProjectView::initWidgets() {
+void ProjectView::initWidgets()
+{
setObjectName("ProjectView");
setWindowIcon(QET::Icons::ProjectFileGP);
@@ -790,7 +813,8 @@ void ProjectView::initWidgets() {
/**
Initialize layout for this widget.
*/
-void ProjectView::initLayout() {
+void ProjectView::initLayout()
+{
QVBoxLayout *fallback_widget_layout_ = new QVBoxLayout(fallback_widget_);
fallback_widget_layout_ -> addWidget(fallback_label_);
@@ -849,7 +873,8 @@ void ProjectView::loadDiagrams()
@brief ProjectView::updateWindowTitle
Update the project view title
*/
-void ProjectView::updateWindowTitle() {
+void ProjectView::updateWindowTitle()
+{
QString title;
if (m_project) {
title = m_project -> pathNameTitle();
@@ -863,7 +888,8 @@ void ProjectView::updateWindowTitle() {
Effectue les actions necessaires lorsque le projet visualise entre ou sort
du mode lecture seule.
*/
-void ProjectView::adjustReadOnlyState() {
+void ProjectView::adjustReadOnlyState()
+{
bool editable = !(m_project -> isReadOnly());
// prevent users from moving existing diagrams
@@ -984,7 +1010,8 @@ DiagramView *ProjectView::findDiagram(Diagram *diagram) {
/**
Reconstruit la map associant les index des onglets avec les DiagramView
*/
-void ProjectView::rebuildDiagramsMap() {
+void ProjectView::rebuildDiagramsMap()
+{
// vide la map
m_diagram_ids.clear();
diff --git a/sources/properties/terminaldata.cpp b/sources/properties/terminaldata.cpp
index 57ac35609..5fc00d72e 100644
--- a/sources/properties/terminaldata.cpp
+++ b/sources/properties/terminaldata.cpp
@@ -15,7 +15,8 @@ TerminalData::TerminalData(QGraphicsObject *parent):
init();
}
-void TerminalData::init() {
+void TerminalData::init()
+{
}
TerminalData::~TerminalData()
diff --git a/sources/properties/xrefproperties.cpp b/sources/properties/xrefproperties.cpp
index 2a239d069..c89077ec8 100644
--- a/sources/properties/xrefproperties.cpp
+++ b/sources/properties/xrefproperties.cpp
@@ -42,7 +42,8 @@ XRefProperties::XRefProperties()
@param prefix: prefix before properties name
*/
void XRefProperties::toSettings(QSettings &settings,
- const QString prefix) const {
+ const QString prefix) const
+{
settings.setValue(prefix + "showpowerctc", m_show_power_ctc);
QString display = m_display == Cross? "cross" : "contacts";
settings.setValue(prefix + "displayhas", display);
@@ -96,7 +97,8 @@ void XRefProperties::fromSettings(const QSettings &settings,
@param xml_document : QDomElement to use for saving
@return QDomElement
*/
-QDomElement XRefProperties::toXml(QDomDocument &xml_document) const {
+QDomElement XRefProperties::toXml(QDomDocument &xml_document) const
+{
QDomElement xml_element = xml_document.createElement("xref");
xml_element.setAttribute("type", m_key);
@@ -191,7 +193,8 @@ bool XRefProperties::operator ==(const XRefProperties &xrp) const{
m_xref_pos == xrp.m_xref_pos );
}
-bool XRefProperties::operator !=(const XRefProperties &xrp) const {
+bool XRefProperties::operator !=(const XRefProperties &xrp) const
+{
return (! (*this == xrp));
}
diff --git a/sources/qet.cpp b/sources/qet.cpp
index 110bce76c..dac87f5f3 100644
--- a/sources/qet.cpp
+++ b/sources/qet.cpp
@@ -371,7 +371,8 @@ QList QET::findInDomElement(const QDomElement &e,
}
/// @return le texte de la licence de QElectroTech (GNU/GPL)
-QString QET::license() {
+QString QET::license()
+{
// Recuperation du texte de la GNU/GPL dans un fichier integre a l'application
QFile *file_license = new QFile(":/LICENSE");
QString txt_license;
@@ -399,7 +400,8 @@ QString QET::license() {
@return la liste des caracteres interdits dans les noms de fichiers sous
Windows
*/
-QList QET::forbiddenCharacters() {
+QList QET::forbiddenCharacters()
+{
return(QList() << '\\' << '/' << ':' << '*' << '?' << '"'
<< '<' << '>' << '|');
}
diff --git a/sources/qetapp.cpp b/sources/qetapp.cpp
index 7878cd614..fff72edc4 100644
--- a/sources/qetapp.cpp
+++ b/sources/qetapp.cpp
@@ -261,7 +261,8 @@ void QETApp::systray(QSystemTrayIcon::ActivationReason reason) {
Minimizes all application windows in the systray
\~French Reduit toutes les fenetres de l'application dans le systray
*/
-void QETApp::reduceEveryEditor() {
+void QETApp::reduceEveryEditor()
+{
reduceDiagramEditors();
reduceElementEditors();
reduceTitleBlockTemplateEditors();
@@ -273,7 +274,8 @@ void QETApp::reduceEveryEditor() {
Restores all application windows in the systray
\~French Restaure toutes les fenetres de l'application dans le systray
*/
-void QETApp::restoreEveryEditor() {
+void QETApp::restoreEveryEditor()
+{
restoreDiagramEditors();
restoreElementEditors();
restoreTitleBlockTemplateEditors();
@@ -285,7 +287,8 @@ void QETApp::restoreEveryEditor() {
Minimize all schema editors in the systray
\~French Reduit tous les editeurs de schemas dans le systray
*/
-void QETApp::reduceDiagramEditors() {
+void QETApp::reduceDiagramEditors()
+{
setMainWindowsVisible(false);
}
@@ -294,7 +297,8 @@ void QETApp::reduceDiagramEditors() {
Restore all schema editors in the systray
\~French Restaure tous les editeurs de schemas dans le systray
*/
-void QETApp::restoreDiagramEditors() {
+void QETApp::restoreDiagramEditors()
+{
setMainWindowsVisible(true);
}
@@ -304,7 +308,8 @@ void QETApp::restoreDiagramEditors() {
Minimize all element editors in systray
\~French Reduit tous les editeurs d'element dans le systray
*/
-void QETApp::reduceElementEditors() {
+void QETApp::reduceElementEditors()
+{
setMainWindowsVisible(false);
}
@@ -313,7 +318,8 @@ void QETApp::reduceElementEditors() {
Restore all element editors in the systray
\~French Restaure tous les editeurs d'element dans le systray
*/
-void QETApp::restoreElementEditors() {
+void QETApp::restoreElementEditors()
+{
setMainWindowsVisible(true);
}
@@ -321,7 +327,8 @@ void QETApp::restoreElementEditors() {
@brief QETApp::reduceTitleBlockTemplateEditors
Reduce all known template editors
*/
-void QETApp::reduceTitleBlockTemplateEditors() {
+void QETApp::reduceTitleBlockTemplateEditors()
+{
setMainWindowsVisible(false);
}
@@ -329,7 +336,8 @@ void QETApp::reduceTitleBlockTemplateEditors() {
@brief QETApp::restoreTitleBlockTemplateEditors
Restore all known template editors
*/
-void QETApp::restoreTitleBlockTemplateEditors() {
+void QETApp::restoreTitleBlockTemplateEditors()
+{
setMainWindowsVisible(true);
}
@@ -338,7 +346,8 @@ void QETApp::restoreTitleBlockTemplateEditors() {
launches a new schema editor
\~French lance un nouvel editeur de schemas
*/
-void QETApp::newDiagramEditor() {
+void QETApp::newDiagramEditor()
+{
new QETDiagramEditor();
}
@@ -347,7 +356,8 @@ void QETApp::newDiagramEditor() {
launches a new element editor
\~French lance un nouvel editeur d'element
*/
-void QETApp::newElementEditor() {
+void QETApp::newElementEditor()
+{
new QETElementEditor();
}
@@ -355,7 +365,8 @@ void QETApp::newElementEditor() {
@brief QETApp::collectionCache
@return the collection cache provided by the application itself.
*/
-ElementsCollectionCache *QETApp::collectionCache() {
+ElementsCollectionCache *QETApp::collectionCache()
+{
return(collections_cache_);
}
@@ -510,7 +521,8 @@ QString QETApp::diagramTranslatedInfoKey(const QString &key)
@return the common title block templates collection,
i.e. the one provided by QElecrotTech
*/
-TitleBlockTemplatesFilesCollection *QETApp::commonTitleBlockTemplatesCollection() {
+TitleBlockTemplatesFilesCollection *QETApp::commonTitleBlockTemplatesCollection()
+{
if (!m_common_tbt_collection) {
m_common_tbt_collection =
new TitleBlockTemplatesFilesCollection(
@@ -530,7 +542,8 @@ TitleBlockTemplatesFilesCollection *QETApp::commonTitleBlockTemplatesCollection(
@return the custom title block templates collection,
i.e. the one managed by the end user
*/
-TitleBlockTemplatesFilesCollection *QETApp::customTitleBlockTemplatesCollection() {
+TitleBlockTemplatesFilesCollection *QETApp::customTitleBlockTemplatesCollection()
+{
if (!m_custom_tbt_collection) {
m_custom_tbt_collection =
new TitleBlockTemplatesFilesCollection(
@@ -549,7 +562,8 @@ TitleBlockTemplatesFilesCollection *QETApp::customTitleBlockTemplatesCollection(
@return the list of all available title block tempaltes collections,
beginning with the common and custom ones, plus the projects-embedded ones.
*/
-QList QETApp::availableTitleBlockTemplatesCollections() {
+QList QETApp::availableTitleBlockTemplatesCollections()
+{
QList collections_list;
collections_list << commonTitleBlockTemplatesCollection();
@@ -718,7 +732,8 @@ void QETApp::resetUserElementsDir()
@return the path of the directory containing the common title block
templates collection.
*/
-QString QETApp::commonTitleBlockTemplatesDir() {
+QString QETApp::commonTitleBlockTemplatesDir()
+{
#ifdef QET_ALLOW_OVERRIDE_CTBTD_OPTION
if (common_tbt_dir_ != QString()) return(common_tbt_dir_);
#endif
@@ -747,7 +762,8 @@ QString QETApp::commonTitleBlockTemplatesDir() {
@return the path of the directory containing the custom title block
templates collection.
*/
-QString QETApp::customTitleBlockTemplatesDir() {
+QString QETApp::customTitleBlockTemplatesDir()
+{
if (m_user_custom_tbt_dir.isEmpty())
{
QSettings settings;
@@ -794,7 +810,8 @@ QString QETApp::customTitleBlockTemplatesDir() {
\~ @return The path of the QElectroTech configuration folder
\~French Le chemin du dossier de configuration de QElectroTech
*/
-QString QETApp::configDir() {
+QString QETApp::configDir()
+{
#ifdef QET_ALLOW_OVERRIDE_CD_OPTION
if (config_dir != QString()) return(config_dir);
#endif
@@ -888,7 +905,8 @@ QString QETApp::symbolicPath(const QString &real_path) {
@return the list of file extensions QElectroTech is able to open and
supposed to handle. Note they are provided with no leading point.
*/
-QStringList QETApp::handledFileExtensions() {
+QStringList QETApp::handledFileExtensions()
+{
static QStringList ext;
if (!ext.count()) {
ext << "qet";
@@ -1036,7 +1054,8 @@ void QETApp::overrideLangDir(const QString &new_ld) {
@return The path of the folder containing the language files
\~French Le chemin du dossier contenant les fichiers de langue
*/
-QString QETApp::languagesPath() {
+QString QETApp::languagesPath()
+{
if (!lang_dir.isEmpty()) {
return(lang_dir);
} else {
@@ -1076,7 +1095,8 @@ QString QETApp::languagesPath() {
\~French true si l'utilisateur a accepte toutes les fermetures,
false sinon
*/
-bool QETApp::closeEveryEditor() {
+bool QETApp::closeEveryEditor()
+{
// make sure all windows are visible before leaving
// s'assure que toutes les fenetres soient visibles avant de quitter
restoreEveryEditor();
@@ -1203,7 +1223,8 @@ QFont QETApp::indiTextsItemFont(qreal size)
@return schema editors
\~French les editeurs de schemas
*/
-QList QETApp::diagramEditors() {
+QList QETApp::diagramEditors()
+{
return(QETApp::instance() -> detectWindows());
}
@@ -1212,7 +1233,8 @@ QList QETApp::diagramEditors() {
@return element editors
\~French les editeurs d'elements
*/
-QList QETApp::elementEditors() {
+QList QETApp::elementEditors()
+{
return(QETApp::instance() -> detectWindows());
}
@@ -1220,7 +1242,8 @@ QList QETApp::elementEditors() {
@brief QETApp::titleBlockTemplateEditors
@return the title block template editors
*/
-QList QETApp::titleBlockTemplateEditors() {
+QList QETApp::titleBlockTemplateEditors()
+{
return(QETApp::instance() -> detectWindows());
}
@@ -1261,7 +1284,8 @@ QList QETApp::titleBlockTemplateEditors(
\~ @return
\~ @see QTextOrientationSpinBoxWidget
*/
-QTextOrientationSpinBoxWidget *QETApp::createTextOrientationSpinBoxWidget() {
+QTextOrientationSpinBoxWidget *QETApp::createTextOrientationSpinBoxWidget()
+{
QTextOrientationSpinBoxWidget *widget = new QTextOrientationSpinBoxWidget();
widget -> orientationWidget() -> setFont(QETApp::diagramTextsFont());
widget -> orientationWidget() -> setUsableTexts(QList()
@@ -1283,7 +1307,8 @@ QTextOrientationSpinBoxWidget *QETApp::createTextOrientationSpinBoxWidget() {
@brief QETApp::defaultTitleBlockTemplate
@return the default titleblock template for diagrams
*/
-TitleBlockTemplate *QETApp::defaultTitleBlockTemplate() {
+TitleBlockTemplate *QETApp::defaultTitleBlockTemplate()
+{
if (!QETApp::default_titleblock_template_) {
TitleBlockTemplate *titleblock_template = new TitleBlockTemplate(QETApp::instance());
if (titleblock_template -> loadFromXmlFile(":/titleblocks/default.titleblock")) {
@@ -1349,7 +1374,8 @@ void QETApp::receiveMessage(int instanceId, QByteArray message)
@param T a class inheriting QMainWindow
@return the list of windows of type T
*/
-template QList QETApp::detectWindows() const {
+template QList QETApp::detectWindows() const
+{
QList windows;
foreach(QWidget *widget, qApp->topLevelWidgets()) {
if (!widget -> isWindow()) continue;
@@ -1375,7 +1401,8 @@ template void QETApp::setMainWindowsVisible(bool visible) {
@return The list of recent files for projects
\~French La liste des fichiers recents pour les projets
*/
-RecentFiles *QETApp::projectsRecentFiles() {
+RecentFiles *QETApp::projectsRecentFiles()
+{
return(m_projects_recent_files);
}
@@ -1384,7 +1411,8 @@ RecentFiles *QETApp::projectsRecentFiles() {
@return The list of recent files for the elements
\~French La liste des fichiers recents pour les elements
*/
-RecentFiles *QETApp::elementsRecentFiles() {
+RecentFiles *QETApp::elementsRecentFiles()
+{
return(m_elements_recent_files);
}
@@ -1464,7 +1492,8 @@ void QETApp::useSystemPalette(bool use) {
\~French Demande la fermeture de toutes les fenetres ;
si l'utilisateur les accepte, l'application quitte
*/
-void QETApp::quitQET() {
+void QETApp::quitQET()
+{
#pragma message("@TODO Segmentation fault when closing program before loading elements is finished")
if (closeEveryEditor()) {
qApp->quit();
@@ -1478,7 +1507,8 @@ void QETApp::quitQET() {
\~French Verifie s'il reste des fenetres (cachees ou non)
et quitte s'il n'en reste plus.
*/
-void QETApp::checkRemainingWindows() {
+void QETApp::checkRemainingWindows()
+{
/* little hack:
* the slot remembers after 500 ms of waiting in order to compensate
* for the fact that some windows can still appear alive when they
@@ -1733,7 +1763,8 @@ void QETApp::openTitleBlockTemplateFiles(const QStringList &files_list) {
en lancant un dialogue approprie.
\~ @see ConfigDialog
*/
-void QETApp::configureQET() {
+void QETApp::configureQET()
+{
// determine the parent widget to use for the dialog
// determine le widget parent a utiliser pour le dialogue
QWidget *parent_widget = qApp->activeWindow();
@@ -1783,7 +1814,8 @@ void QETApp::aboutQET()
\~French les barres d'outils et dock flottants de la fenetre
*/
QList QETApp::floatingToolbarsAndDocksForMainWindow(
- QMainWindow *window) const {
+ QMainWindow *window) const
+{
QList widgets;
foreach(QWidget *qw, qApp->topLevelWidgets()) {
if (!qw -> isWindow()) continue;
@@ -1822,7 +1854,8 @@ QList QETApp::floatingToolbarsAndDocksForMainWindow(
S'ils existent, ils sont juste memorises dans l'attribut arguments_files_.
Sinon, ils sont memorises dans l'attribut arguments_options_.
*/
-void QETApp::parseArguments() {
+void QETApp::parseArguments()
+{
// get the arguments
// recupere les arguments
QList arguments_list(qApp->arguments());
@@ -1877,7 +1910,8 @@ void QETApp::parseArguments() {
\~French Initialise le splash screen si et seulement si l'execution est
interactive. Autrement, l'attribut splash_screen_ vaut 0.
*/
-void QETApp::initSplashScreen() {
+void QETApp::initSplashScreen()
+{
if (non_interactive_execution_) return;
m_splash_screen = new QSplashScreen(QPixmap(":/ico/splash.png"));
m_splash_screen -> show();
@@ -1909,7 +1943,8 @@ void QETApp::setSplashScreenStep(const QString &message) {
Determine and apply the language to use for the application
\~French Determine et applique le langage a utiliser pour l'application
*/
-void QETApp::initLanguage() {
+void QETApp::initLanguage()
+{
setLanguage(langFromSetting());
}
@@ -1917,7 +1952,8 @@ void QETApp::initLanguage() {
@brief QETApp::initStyle
Setup the gui style
*/
-void QETApp::initStyle() {
+void QETApp::initStyle()
+{
initial_palette_ = qApp->palette();
//Apply or not the system style
@@ -1939,7 +1975,8 @@ void QETApp::initStyle() {
- le dossier de la collection perso
- the directory for custom title blocks
*/
-void QETApp::initConfiguration() {
+void QETApp::initConfiguration()
+{
// create configuration files if necessary
// cree les dossiers de configuration si necessaire
QDir config_dir(QETApp::configDir());
@@ -1974,7 +2011,8 @@ void QETApp::initConfiguration() {
Build the icon in the systray and its menu
\~French Construit l'icone dans le systray et son menu
*/
-void QETApp::initSystemTray() {
+void QETApp::initSystemTray()
+{
setSplashScreenStep(tr("Chargement... icône du systray",
"splash screen caption"));
// initialization of the icon menus in the systray
@@ -2093,7 +2131,8 @@ QETProject *QETApp::projectFromString(const QString &url) {
builds the icon menu in the systray
\~French construit le menu de l'icone dans le systray
*/
-void QETApp::buildSystemTrayMenu() {
+void QETApp::buildSystemTrayMenu()
+{
menu_systray -> clear();
// get editors
@@ -2295,7 +2334,8 @@ bool QETApp::eventFiltrer(QObject *object, QEvent *e) {
Display help and usage on standard output
\~French Affiche l'aide et l'usage sur la sortie standard
*/
-void QETApp::printHelp() {
+void QETApp::printHelp()
+{
QString help(
tr("Usage : ")
+ QFileInfo(qApp->applicationFilePath()).fileName()
@@ -2324,7 +2364,8 @@ void QETApp::printHelp() {
Print version to standard output
\~French Affiche la version sur la sortie standard
*/
-void QETApp::printVersion() {
+void QETApp::printVersion()
+{
std::cout << qPrintable(QET::displayedVersion) << std::endl;
}
@@ -2333,7 +2374,8 @@ void QETApp::printVersion() {
Display license on standard output
\~French Affiche la licence sur la sortie standard
*/
-void QETApp::printLicense() {
+void QETApp::printLicense()
+{
std::cout << qPrintable(QET::license()) << std::endl;
}
@@ -2342,7 +2384,8 @@ void QETApp::printLicense() {
@return the list of projects with their associated ids
\~French la liste des projets avec leurs ids associes
*/
-QMap QETApp::registeredProjects() {
+QMap QETApp::registeredProjects()
+{
return(registered_projects_);
}
diff --git a/sources/qetarguments.cpp b/sources/qetarguments.cpp
index 370b976c9..3f1ae48e0 100644
--- a/sources/qetarguments.cpp
+++ b/sources/qetarguments.cpp
@@ -100,7 +100,8 @@ QETArguments &QETArguments::operator=(const QETArguments &qet_arguments) {
/**
Destructeur
*/
-QETArguments::~QETArguments() {
+QETArguments::~QETArguments()
+{
}
/**
@@ -117,7 +118,8 @@ void QETArguments::setArguments(const QList &args) {
dans l'ordre suivant : options connues puis inconnues, fichiers de types
projet puis element.
*/
-QList QETArguments::arguments() const {
+QList QETArguments::arguments() const
+{
return(options_ + unknown_options_ + project_files_ + element_files_ + tbt_files_);
}
@@ -125,49 +127,56 @@ QList QETArguments::arguments() const {
@return tous les fichiers (projets et elements) passes en parametres.
Les fichiers de type projet viennent avant les fichiers de type element.
*/
-QList QETArguments::files() const {
+QList QETArguments::files() const
+{
return(project_files_ + element_files_ + tbt_files_);
}
/**
@return les fichiers de type projet
*/
-QList QETArguments::projectFiles() const {
+QList QETArguments::projectFiles() const
+{
return(project_files_);
}
/**
@return les fichiers de type element
*/
-QList QETArguments::elementFiles() const {
+QList QETArguments::elementFiles() const
+{
return(element_files_);
}
/**
@return title block template files
*/
-QList QETArguments::titleBlockTemplateFiles() const {
+QList QETArguments::titleBlockTemplateFiles() const
+{
return(tbt_files_);
}
/**
@return les options reconnues
*/
-QList QETArguments::options() const {
+QList QETArguments::options() const
+{
return(options_);
}
/**
@return les options non reconnues
*/
-QList QETArguments::unknownOptions() const {
+QList QETArguments::unknownOptions() const
+{
return(unknown_options_);
}
/**
Oublie tous les arguments de cet objet
*/
-void QETArguments::clear() {
+void QETArguments::clear()
+{
project_files_.clear();
element_files_.clear();
options_.clear();
@@ -290,7 +299,8 @@ void QETArguments::handleOptionArgument(const QString &option) {
@return true si l'utilisateur a specifie un dossier pour la collection
commune.
*/
-bool QETArguments::commonElementsDirSpecified() const {
+bool QETArguments::commonElementsDirSpecified() const
+{
return(!common_elements_dir_.isEmpty());
}
@@ -298,7 +308,8 @@ bool QETArguments::commonElementsDirSpecified() const {
@return le dossier de la collection commune specifie par l'utilisateur.
Si l'utilisateur n'en a pas specifie, une chaine vide est retournee.
*/
-QString QETArguments::commonElementsDir() const {
+QString QETArguments::commonElementsDir() const
+{
return(common_elements_dir_);
}
#endif
@@ -308,7 +319,8 @@ QString QETArguments::commonElementsDir() const {
@return true if the user has specified a directory for the common title
block templates collection
*/
-bool QETArguments::commonTitleBlockTemplatesDirSpecified() const {
+bool QETArguments::commonTitleBlockTemplatesDirSpecified() const
+{
return(!common_tbt_dir_.isEmpty());
}
@@ -316,7 +328,8 @@ bool QETArguments::commonTitleBlockTemplatesDirSpecified() const {
@return the directory of the common title block templates collection
specified by the user. If none were specified, return an empty string.
*/
-QString QETArguments::commonTitleBlockTemplatesDir() const {
+QString QETArguments::commonTitleBlockTemplatesDir() const
+{
return(common_tbt_dir_);
}
#endif
@@ -325,7 +338,8 @@ QString QETArguments::commonTitleBlockTemplatesDir() const {
/**
@return true si l'utilisateur a specifie un dossier pour la configuration.
*/
-bool QETArguments::configDirSpecified() const {
+bool QETArguments::configDirSpecified() const
+{
return(!config_dir_.isEmpty());
}
@@ -333,7 +347,8 @@ bool QETArguments::configDirSpecified() const {
@return le dossier de configuration specifie par l'utilisateur.
Si l'utilisateur n'en a pas specifie, une chaine vide est retournee.
*/
-QString QETArguments::configDir() const {
+QString QETArguments::configDir() const
+{
return(config_dir_);
}
#endif
@@ -341,7 +356,8 @@ QString QETArguments::configDir() const {
/**
@return true si l'utilisateur a specifie un dossier pour les fichiers de langue
*/
-bool QETArguments::langDirSpecified() const {
+bool QETArguments::langDirSpecified() const
+{
return(!lang_dir_.isEmpty());
}
@@ -349,7 +365,8 @@ bool QETArguments::langDirSpecified() const {
@return le dossier de langue specifie par l'utilisateur.
Si l'utilisateur n'en a pas specifie, une chaine vide est retournee.
*/
-QString QETArguments::langDir() const {
+QString QETArguments::langDir() const
+{
return(lang_dir_);
}
@@ -357,7 +374,8 @@ QString QETArguments::langDir() const {
@return true si les arguments comportent une demande d'affichage de l'aide,
false sinon
*/
-bool QETArguments::printHelpRequested() const {
+bool QETArguments::printHelpRequested() const
+{
return(print_help_);
}
@@ -365,7 +383,8 @@ bool QETArguments::printHelpRequested() const {
@return true si les arguments comportent une demande d'affichage de la
licence, false sinon
*/
-bool QETArguments::printLicenseRequested() const {
+bool QETArguments::printLicenseRequested() const
+{
return(print_license_);
}
@@ -373,6 +392,7 @@ bool QETArguments::printLicenseRequested() const {
@return true si les arguments comportent une demande d'affichage de la
version, false sinon
*/
-bool QETArguments::printVersionRequested() const {
+bool QETArguments::printVersionRequested() const
+{
return(print_version_);
}
diff --git a/sources/qetdiagrameditor.cpp b/sources/qetdiagrameditor.cpp
index d8011c349..19d9b2e28 100644
--- a/sources/qetdiagrameditor.cpp
+++ b/sources/qetdiagrameditor.cpp
@@ -106,8 +106,14 @@ QETDiagramEditor::QETDiagramEditor(const QStringList &files, QWidget *parent) :
setMinimumSize(QSize(500, 350));
setWindowState(Qt::WindowMaximized);
- connect (&m_workspace, SIGNAL(subWindowActivated(QMdiSubWindow *)), this, SLOT(subWindowActivated(QMdiSubWindow*)));
- connect (QApplication::clipboard(), SIGNAL(dataChanged()), this, SLOT(slot_updatePasteAction()));
+ connect (&m_workspace,
+ SIGNAL(subWindowActivated(QMdiSubWindow *)),
+ this,
+ SLOT(subWindowActivated(QMdiSubWindow*)));
+ connect (QApplication::clipboard(),
+ SIGNAL(dataChanged()),
+ this,
+ SLOT(slot_updatePasteAction()));
readSettings();
show();
@@ -128,14 +134,16 @@ QETDiagramEditor::QETDiagramEditor(const QStringList &files, QWidget *parent) :
/**
Destructeur
*/
-QETDiagramEditor::~QETDiagramEditor() {
+QETDiagramEditor::~QETDiagramEditor()
+{
}
/**
@brief QETDiagramEditor::setUpElementsPanel
Setup the element panel and element panel widget
*/
-void QETDiagramEditor::setUpElementsPanel() {
+void QETDiagramEditor::setUpElementsPanel()
+{
//Add the element panel as a QDockWidget
qdw_pa = new QDockWidget(tr("Projets", "dock title"), this);
@@ -184,7 +192,8 @@ void QETDiagramEditor::setUpElementsCollectionWidget()
@brief QETDiagramEditor::setUpUndoStack
Setup the undostack and undo stack widget
*/
-void QETDiagramEditor::setUpUndoStack() {
+void QETDiagramEditor::setUpUndoStack()
+{
QUndoView *undo_view = new QUndoView(&undo_group, this);
@@ -498,10 +507,10 @@ void QETDiagramEditor::setUpActions()
m_close_file ->setShortcut(QKeySequence::Close);
m_save_file ->setShortcut(QKeySequence::Save);
- new_file ->setStatusTip( tr("Crée un nouveau projet", "status bar tip") );
- open_file ->setStatusTip( tr("Ouvre un projet existant", "status bar tip") );
- m_close_file ->setStatusTip( tr("Ferme le projet courant", "status bar tip") );
- m_save_file ->setStatusTip( tr("Enregistre le projet courant et tous ses folios", "status bar tip") );
+ new_file ->setStatusTip( tr("Crée un nouveau projet", "status bar tip") );
+ open_file ->setStatusTip( tr("Ouvre un projet existant", "status bar tip") );
+ m_close_file ->setStatusTip( tr("Ferme le projet courant", "status bar tip") );
+ m_save_file ->setStatusTip( tr("Enregistre le projet courant et tous ses folios", "status bar tip") );
m_save_file_as ->setStatusTip( tr("Enregistre le projet courant avec un autre nom de fichier", "status bar tip") );
connect(m_save_file_as, &QAction::triggered, this, &QETDiagramEditor::saveAs);
@@ -568,8 +577,8 @@ void QETDiagramEditor::setUpActions()
select_nothing->setShortcut(QKeySequence::Deselect);
select_invert ->setShortcut(QKeySequence( tr("Ctrl+I")));
- select_all ->setStatusTip( tr("Sélectionne tous les éléments du folio", "status bar tip") );
- select_nothing->setStatusTip( tr("Désélectionne tous les éléments du folio", "status bar tip") );
+ select_all ->setStatusTip( tr("Sélectionne tous les éléments du folio", "status bar tip") );
+ select_nothing->setStatusTip( tr("Désélectionne tous les éléments du folio", "status bar tip") );
select_invert ->setStatusTip( tr("Désélectionne les éléments sélectionnés et sélectionne les éléments non sélectionnés", "status bar tip") );
select_all ->setData("select_all");
@@ -711,7 +720,8 @@ void QETDiagramEditor::setUpToolBar()
/**
@brief QETDiagramEditor::setUpMenu
*/
-void QETDiagramEditor::setUpMenu() {
+void QETDiagramEditor::setUpMenu()
+{
QMenu *menu_fichier = new QMenu(tr("&Fichier"));
QMenu *menu_edition = new QMenu(tr("&Édition"));
@@ -729,7 +739,8 @@ void QETDiagramEditor::setUpMenu() {
// File menu
QMenu *recentfile = menu_fichier -> addMenu(QET::Icons::DocumentOpenRecent, tr("&Récemment ouverts"));
recentfile->addActions(QETApp::projectsRecentFiles()->menu()->actions());
- connect(QETApp::projectsRecentFiles(), SIGNAL(fileOpeningRequested(const QString &)), this, SLOT(openRecentFile(const QString &)));
+ connect(QETApp::projectsRecentFiles(), SIGNAL(fileOpeningRequested(const QString &)),
+ this, SLOT(openRecentFile(const QString &)));
menu_fichier -> addActions(m_file_actions_group.actions());
menu_fichier -> addSeparator();
//menu_fichier -> addAction(import_diagram);
@@ -804,7 +815,8 @@ void QETDiagramEditor::setUpMenu() {
Permet de quitter l'application lors de la fermeture de la fenetre principale
@param qce Le QCloseEvent correspondant a l'evenement de fermeture
*/
-void QETDiagramEditor::closeEvent(QCloseEvent *qce) {
+void QETDiagramEditor::closeEvent(QCloseEvent *qce)
+{
// quitte directement s'il n'y a aucun projet ouvert
bool can_quit = true;
if (openedProjects().count()) {
@@ -850,7 +862,8 @@ bool QETDiagramEditor::event(QEvent *e)
@brief QETDiagramEditor::save
Ask the current active project to save
*/
-void QETDiagramEditor::save() {
+void QETDiagramEditor::save()
+{
if (ProjectView *project_view = currentProjectView()) {
QETResult saved = project_view -> save();
@@ -874,7 +887,8 @@ void QETDiagramEditor::save() {
@brief QETDiagramEditor::saveAs
Ask the current active project to save as
*/
-void QETDiagramEditor::saveAs() {
+void QETDiagramEditor::saveAs()
+{
if (ProjectView *project_view = currentProjectView()) {
QETResult save_file = project_view -> saveAs();
if (save_file.isOk()) {
@@ -914,7 +928,8 @@ bool QETDiagramEditor::newProject()
@param filepath Fichier a ouvrir
@see openAndAddDiagram
*/
-bool QETDiagramEditor::openRecentFile(const QString &filepath) {
+bool QETDiagramEditor::openRecentFile(const QString &filepath)
+{
// small hack to prevent all diagram editors from trying to topen the required
// recent file at the same time
if (qApp -> activeWindow() != this) return(false);
@@ -925,7 +940,8 @@ bool QETDiagramEditor::openRecentFile(const QString &filepath) {
Cette fonction demande un nom de fichier a ouvrir a l'utilisateur
@return true si l'ouverture a reussi, false sinon
*/
-bool QETDiagramEditor::openProject() {
+bool QETDiagramEditor::openProject()
+{
// demande un chemin de fichier a ouvrir a l'utilisateur
QString filepath = QFileDialog::getOpenFileName(
this,
@@ -948,7 +964,8 @@ bool QETDiagramEditor::openProject() {
@return true si la fermeture du projet a reussi, false sinon
Note : cette methode renvoie true si project est nul
*/
-bool QETDiagramEditor::closeProject(ProjectView *project_view) {
+bool QETDiagramEditor::closeProject(ProjectView *project_view)
+{
if (project_view) {
activateProject(project_view);
if (QMdiSubWindow *sub_window = subWindowForWidget(project_view)){
@@ -964,7 +981,8 @@ bool QETDiagramEditor::closeProject(ProjectView *project_view) {
@return true si la fermeture du fichier a reussi, false sinon
Note : cette methode renvoie true si project est nul
*/
-bool QETDiagramEditor::closeProject(QETProject *project) {
+bool QETDiagramEditor::closeProject(QETProject *project)
+{
if (ProjectView *project_view = findProject(project)) {
return(closeProject(project_view));
}
@@ -977,13 +995,15 @@ bool QETDiagramEditor::closeProject(QETProject *project) {
@param interactive true pour afficher des messages a l'utilisateur, false sinon
@return true si l'ouverture a reussi, false sinon
*/
-bool QETDiagramEditor::openAndAddProject(const QString &filepath, bool interactive)
+bool QETDiagramEditor::openAndAddProject(
+ const QString &filepath,
+ bool interactive)
{
if (filepath.isEmpty()) return(false);
QFileInfo filepath_info(filepath);
- //Check if project is not open in another editor
+ //Check if project is not open in another editor
if (QETDiagramEditor *diagram_editor = QETApp::diagramEditorForFile(filepath))
{
if (diagram_editor == this)
@@ -1003,7 +1023,7 @@ bool QETDiagramEditor::openAndAddProject(const QString &filepath, bool interacti
}
}
- // check the file exists
+ // check the file exists
if (!filepath_info.exists())
{
if (interactive)
@@ -1019,8 +1039,8 @@ bool QETDiagramEditor::openAndAddProject(const QString &filepath, bool interacti
}
return(false);
}
-
- //Check if file readable
+
+ //Check if file readable
if (!filepath_info.isReadable())
{
if (interactive) {
@@ -1035,7 +1055,7 @@ bool QETDiagramEditor::openAndAddProject(const QString &filepath, bool interacti
return(false);
}
- //Check if file is read only
+ //Check if file is read only
if (!filepath_info.isWritable())
{
if (interactive) {
@@ -1049,7 +1069,7 @@ bool QETDiagramEditor::openAndAddProject(const QString &filepath, bool interacti
}
}
- //Create the project
+ //Create the project
DialogWaiting::instance(this);
QETProject *project = new QETProject(filepath);
@@ -1086,10 +1106,11 @@ bool QETDiagramEditor::openAndAddProject(const QString &filepath, bool interacti
@param update_panel Whether the elements panel should be warned this
project has been added. Defaults to true.
*/
-bool QETDiagramEditor::addProject(QETProject *project, bool update_panel) {
+bool QETDiagramEditor::addProject(QETProject *project, bool update_panel)
+{
// enregistre le projet
QETApp::registerProject(project);
-
+
// cree un ProjectView pour visualiser le projet
ProjectView *project_view = new ProjectView(project);
addProjectView(project_view);
@@ -1111,7 +1132,8 @@ bool QETDiagramEditor::addProject(QETProject *project, bool update_panel) {
/**
@return la liste des projets ouverts dans cette fenetre
*/
-QList QETDiagramEditor::openedProjects() const {
+QList QETDiagramEditor::openedProjects() const
+{
QList result;
QList window_list(m_workspace.subWindowList());
foreach(QMdiSubWindow *window, window_list) {
@@ -1126,7 +1148,8 @@ QList QETDiagramEditor::openedProjects() const {
@return Le projet actuellement edite (= qui a le focus dans l'interface
MDI) ou 0 s'il n'y en a pas
*/
-ProjectView *QETDiagramEditor::currentProjectView() const {
+ProjectView *QETDiagramEditor::currentProjectView() const
+{
QMdiSubWindow *current_window = m_workspace.activeSubWindow();
if (!current_window) return(nullptr);
@@ -1159,7 +1182,8 @@ QETProject *QETDiagramEditor::currentProject() const
@return Le schema actuellement edite (= l'onglet ouvert dans le projet
courant) ou 0 s'il n'y en a pas
*/
-DiagramView *QETDiagramEditor::currentDiagramView() const {
+DiagramView *QETDiagramEditor::currentDiagramView() const
+{
if (ProjectView *project_view = currentProjectView()) {
return(project_view -> currentDiagram());
}
@@ -1190,7 +1214,8 @@ Element *QETDiagramEditor::currentElement() const
@param diagram_view Schema dont il faut retrouver
@return la vue sur le projet contenant ce schema ou 0 s'il n'y en a pas
*/
-ProjectView *QETDiagramEditor::findProject(DiagramView *diagram_view) const {
+ProjectView *QETDiagramEditor::findProject(DiagramView *diagram_view) const
+{
foreach(ProjectView *project_view, openedProjects()) {
if (project_view -> diagram_views().contains(diagram_view)) {
return(project_view);
@@ -1204,7 +1229,8 @@ ProjectView *QETDiagramEditor::findProject(DiagramView *diagram_view) const {
@param diagram Schema dont il faut retrouver
@return la vue sur le projet contenant ce schema ou 0 s'il n'y en a pas
*/
-ProjectView *QETDiagramEditor::findProject(Diagram *diagram) const {
+ProjectView *QETDiagramEditor::findProject(Diagram *diagram) const
+{
foreach(ProjectView *project_view, openedProjects()) {
foreach(DiagramView *diagram_view, project_view -> diagram_views()) {
if (diagram_view -> diagram() == diagram) {
@@ -1219,7 +1245,8 @@ ProjectView *QETDiagramEditor::findProject(Diagram *diagram) const {
@param project Projet dont il faut trouver la vue
@return la vue du projet passe en parametre
*/
-ProjectView *QETDiagramEditor::findProject(QETProject *project) const {
+ProjectView *QETDiagramEditor::findProject(QETProject *project) const
+{
foreach(ProjectView *opened_project, openedProjects()) {
if (opened_project -> project() == project) {
return(opened_project);
@@ -1233,7 +1260,8 @@ ProjectView *QETDiagramEditor::findProject(QETProject *project) const {
@return le ProjectView correspondant au chemin passe en parametre, ou 0 si
celui-ci n'a pas ete trouve
*/
-ProjectView *QETDiagramEditor::findProject(const QString &filepath) const {
+ProjectView *QETDiagramEditor::findProject(const QString &filepath) const
+{
foreach(ProjectView *opened_project, openedProjects()) {
if (QETProject *project = opened_project -> project()) {
if (project -> filePath() == filepath) {
@@ -1249,7 +1277,8 @@ ProjectView *QETDiagramEditor::findProject(const QString &filepath) const {
@return La sous-fenetre accueillant le widget passe en parametre, ou 0 si
celui-ci n'a pas ete trouve.
*/
-QMdiSubWindow *QETDiagramEditor::subWindowForWidget(QWidget *widget) const {
+QMdiSubWindow *QETDiagramEditor::subWindowForWidget(QWidget *widget) const
+{
foreach(QMdiSubWindow *sub_window, m_workspace.subWindowList()) {
if (sub_window -> widget() == widget) {
return(sub_window);
@@ -1470,7 +1499,8 @@ void QETDiagramEditor::slot_updateActions()
@brief QETDiagramEditor::slot_updateAutoNumDock
Update Auto Num Dock Widget when changing Project
*/
-void QETDiagramEditor::slot_updateAutoNumDock() {
+void QETDiagramEditor::slot_updateAutoNumDock()
+{
if ( m_workspace.subWindowList().indexOf(m_workspace.activeSubWindow()) != activeSubWindowIndex) {
activeSubWindowIndex = m_workspace.subWindowList().indexOf(m_workspace.activeSubWindow());
if (currentProjectView() != nullptr && currentDiagramView() != nullptr) {
@@ -1543,7 +1573,7 @@ void QETDiagramEditor::slot_updateComplexActions()
for(DiagramTextItem *dti : texts)
{
if(dti->type() == ConductorTextItem::Type)
- selected_conductor_texts++;
+ selected_conductor_texts++;
}
int selected_dynamic_elmt_text = 0;
for(DiagramTextItem *dti : texts)
@@ -1672,7 +1702,8 @@ void QETDiagramEditor::slot_updateModeActions()
@brief QETDiagramEditor::slot_updatePasteAction
Gere les actions ayant besoin du presse-papier
*/
-void QETDiagramEditor::slot_updatePasteAction() {
+void QETDiagramEditor::slot_updatePasteAction()
+{
DiagramView *dv = currentDiagramView();
bool editable_diagram = (dv && !dv -> diagram() -> isReadOnly());
@@ -1742,7 +1773,8 @@ void QETDiagramEditor::addProjectView(ProjectView *project_view)
/**
@return la liste des fichiers edites par cet editeur de schemas
*/
-QList QETDiagramEditor::editedFiles() const {
+QList QETDiagramEditor::editedFiles() const
+{
QList edited_files_list;
foreach (ProjectView *project_view, openedProjects()) {
QString diagram_file(project_view -> project() -> filePath());
@@ -1759,7 +1791,8 @@ QList QETDiagramEditor::editedFiles() const {
@return le ProjectView editant le fichier filepath, ou 0 si ce fichier n'est
pas edite par cet editeur de schemas.
*/
-ProjectView *QETDiagramEditor::viewForFile(const QString &filepath) const {
+ProjectView *QETDiagramEditor::viewForFile(const QString &filepath) const
+{
if (filepath.isEmpty()) return(nullptr);
QString searched_can_file_path = QFileInfo(filepath).canonicalFilePath();
@@ -1780,7 +1813,8 @@ ProjectView *QETDiagramEditor::viewForFile(const QString &filepath) const {
@brief QETDiagramEditor::drawGrid
@return true if the grid of folio must be displayed
*/
-bool QETDiagramEditor::drawGrid() const {
+bool QETDiagramEditor::drawGrid() const
+{
return m_draw_grid->isChecked();
}
@@ -1800,9 +1834,12 @@ void QETDiagramEditor::openBackupFiles(QList backup_files)
{
if (project -> state() != QETProject::FileOpenDiscard)
{
- QET::QetMessageBox::warning(this, tr("Échec de l'ouverture du projet", "message box title"),
- QString(tr("Une erreur est survenue lors de l'ouverture du fichier %1.",
- "message box content")).arg(file->managedFile().fileName()));
+ QET::QetMessageBox::warning(
+ this,
+ tr("Échec de l'ouverture du projet", "message box title"),
+ QString(tr(
+ "Une erreur est survenue lors de l'ouverture du fichier %1.",
+ "message box content")).arg(file->managedFile().fileName()));
}
delete project;
DialogWaiting::dropInstance();
@@ -1815,7 +1852,8 @@ void QETDiagramEditor::openBackupFiles(QList backup_files)
/**
met a jour le menu "Fenetres"
*/
-void QETDiagramEditor::slot_updateWindowsMenu() {
+void QETDiagramEditor::slot_updateWindowsMenu()
+{
// nettoyage du menu
foreach(QAction *a, windows_menu -> actions()) windows_menu -> removeAction(a);
@@ -1859,7 +1897,8 @@ void QETDiagramEditor::slot_updateWindowsMenu() {
Edite les proprietes du schema diagram
@param diagram_view schema dont il faut editer les proprietes
*/
-void QETDiagramEditor::editDiagramProperties(DiagramView *diagram_view) {
+void QETDiagramEditor::editDiagramProperties(DiagramView *diagram_view)
+{
if (ProjectView *project_view = findProject(diagram_view)) {
activateProject(project_view);
project_view -> editDiagramProperties(diagram_view);
@@ -1870,7 +1909,8 @@ void QETDiagramEditor::editDiagramProperties(DiagramView *diagram_view) {
Edite les proprietes du schema diagram
@param diagram schema dont il faut editer les proprietes
*/
-void QETDiagramEditor::editDiagramProperties(Diagram *diagram) {
+void QETDiagramEditor::editDiagramProperties(Diagram *diagram)
+{
if (ProjectView *project_view = findProject(diagram)) {
activateProject(project_view);
project_view -> editDiagramProperties(diagram);
@@ -1880,7 +1920,8 @@ void QETDiagramEditor::editDiagramProperties(Diagram *diagram) {
/**
Affiche les projets dans des fenetres.
*/
-void QETDiagramEditor::setWindowedMode() {
+void QETDiagramEditor::setWindowedMode()
+{
m_workspace.setViewMode(QMdiArea::SubWindowView);
m_windowed_view_mode -> setChecked(true);
slot_updateWindowsMenu();
@@ -1889,7 +1930,8 @@ void QETDiagramEditor::setWindowedMode() {
/**
Affiche les projets dans des onglets.
*/
-void QETDiagramEditor::setTabbedMode() {
+void QETDiagramEditor::setTabbedMode()
+{
m_workspace.setViewMode(QMdiArea::TabbedView);
m_tabbed_view_mode -> setChecked(true);
slot_updateWindowsMenu();
@@ -1935,7 +1977,8 @@ void QETDiagramEditor::writeSettings()
Active le schema passe en parametre
@param diagram Schema a activer
*/
-void QETDiagramEditor::activateDiagram(Diagram *diagram) {
+void QETDiagramEditor::activateDiagram(Diagram *diagram)
+{
if (QETProject *project = diagram -> project()) {
if (ProjectView *project_view = findProject(project)) {
activateWidget(project_view);
@@ -1950,7 +1993,8 @@ void QETDiagramEditor::activateDiagram(Diagram *diagram) {
Active le projet passe en parametre
@param project Projet a activer
*/
-void QETDiagramEditor::activateProject(QETProject *project) {
+void QETDiagramEditor::activateProject(QETProject *project)
+{
activateProject(findProject(project));
}
@@ -1958,12 +2002,14 @@ void QETDiagramEditor::activateProject(QETProject *project) {
Active le projet passe en parametre
@param project_view Projet a activer
*/
-void QETDiagramEditor::activateProject(ProjectView *project_view) {
+void QETDiagramEditor::activateProject(ProjectView *project_view)
+{
if (!project_view) return;
activateWidget(project_view);
}
-/*** @brief QETDiagramEditor::projectWasClosed
+/**
+ @brief QETDiagramEditor::projectWasClosed
Manage the close of a project.
@param project_view
*/
@@ -1976,11 +2022,11 @@ void QETDiagramEditor::projectWasClosed(ProjectView *project_view)
m_element_collection_widget->removeProject(project);
undo_group.removeStack(project -> undoStack());
QETApp::unregisterProject(project);
- }
- //When project is closed, a lot of signal are emited, notably if there is an item selected in a diagram.
- //In some special case, since signal/slot connection can be direct or queued, some signal are handled after QObject is deleted, and crash qet
- //notably in the function Diagram::elements when she call items() (I don't know exactly why).
- //set nullptr to "m_selection_properties_editor->setDiagram()" fix this crash
+ }
+ //When project is closed, a lot of signal are emited, notably if there is an item selected in a diagram.
+ //In some special case, since signal/slot connection can be direct or queued, some signal are handled after QObject is deleted, and crash qet
+ //notably in the function Diagram::elements when she call items() (I don't know exactly why).
+ //set nullptr to "m_selection_properties_editor->setDiagram()" fix this crash
m_selection_properties_editor->setDiagram(nullptr);
project_view -> deleteLater();
project -> deleteLater();
@@ -1990,7 +2036,8 @@ void QETDiagramEditor::projectWasClosed(ProjectView *project_view)
Edite les proprietes du projet project_view.
@param project_view Vue sur le projet dont il faut editer les proprietes
*/
-void QETDiagramEditor::editProjectProperties(ProjectView *project_view) {
+void QETDiagramEditor::editProjectProperties(ProjectView *project_view)
+{
if (!project_view) return;
activateProject(project_view);
project_view -> editProjectProperties();
@@ -2000,7 +2047,8 @@ void QETDiagramEditor::editProjectProperties(ProjectView *project_view) {
Edite les proprietes du projet project.
@param project Projet dont il faut editer les proprietes
*/
-void QETDiagramEditor::editProjectProperties(QETProject *project) {
+void QETDiagramEditor::editProjectProperties(QETProject *project)
+{
editProjectProperties(findProject(project));
}
@@ -2026,7 +2074,8 @@ void QETDiagramEditor::addDiagramToProject(QETProject *project)
Supprime un schema de son projet
@param diagram Schema a supprimer
*/
-void QETDiagramEditor::removeDiagram(Diagram *diagram) {
+void QETDiagramEditor::removeDiagram(Diagram *diagram)
+{
if (!diagram) return;
// recupere le projet contenant le schema
@@ -2048,7 +2097,8 @@ void QETDiagramEditor::removeDiagram(Diagram *diagram) {
la gauche
@param diagram Schema a decaler vers le haut / la gauche
*/
-void QETDiagramEditor::moveDiagramUp(Diagram *diagram) {
+void QETDiagramEditor::moveDiagramUp(Diagram *diagram)
+{
if (!diagram) return;
// recupere le projet contenant le schema
@@ -2067,7 +2117,8 @@ void QETDiagramEditor::moveDiagramUp(Diagram *diagram) {
la droite
@param diagram Schema a decaler vers le bas / la droite
*/
-void QETDiagramEditor::moveDiagramDown(Diagram *diagram) {
+void QETDiagramEditor::moveDiagramDown(Diagram *diagram)
+{
if (!diagram) return;
// recupere le projet contenant le schema
@@ -2086,7 +2137,8 @@ void QETDiagramEditor::moveDiagramDown(Diagram *diagram) {
la gauche en position 0
@param diagram Schema a decaler vers le haut / la gauche en position 0
*/
-void QETDiagramEditor::moveDiagramUpTop(Diagram *diagram) {
+void QETDiagramEditor::moveDiagramUpTop(Diagram *diagram)
+{
if (!diagram) return;
// recupere le projet contenant le schema
@@ -2106,7 +2158,8 @@ void QETDiagramEditor::moveDiagramUpTop(Diagram *diagram) {
la gauche x10
@param diagram Schema a decaler vers le haut / la gauche x10
*/
-void QETDiagramEditor::moveDiagramUpx10(Diagram *diagram) {
+void QETDiagramEditor::moveDiagramUpx10(Diagram *diagram)
+{
if (!diagram) return;
// recupere le projet contenant le schema
@@ -2125,7 +2178,8 @@ void QETDiagramEditor::moveDiagramUpx10(Diagram *diagram) {
la droite x10
@param diagram Schema a decaler vers le bas / la droite x10
*/
-void QETDiagramEditor::moveDiagramDownx10(Diagram *diagram) {
+void QETDiagramEditor::moveDiagramDownx10(Diagram *diagram)
+{
if (!diagram) return;
// recupere le projet contenant le schema
@@ -2139,7 +2193,8 @@ void QETDiagramEditor::moveDiagramDownx10(Diagram *diagram) {
}
}
-void QETDiagramEditor::reloadOldElementPanel() {
+void QETDiagramEditor::reloadOldElementPanel()
+{
pa->reloadAndFilter();
}
@@ -2187,7 +2242,8 @@ void QETDiagramEditor::findElementInPanel(const ElementsLocation &location)
Lance l'editeur d'element pour l'element filename
@param location Emplacement de l'element a editer
*/
-void QETDiagramEditor::editElementInEditor(const ElementsLocation &location) {
+void QETDiagramEditor::editElementInEditor(const ElementsLocation &location)
+{
QETApp::instance() -> openElementLocations(QList()
<< location);
}
@@ -2196,7 +2252,8 @@ void QETDiagramEditor::editElementInEditor(const ElementsLocation &location) {
Launch an element editor to edit the selected element in the current
diagram view.
*/
-void QETDiagramEditor::editSelectedElementInEditor() {
+void QETDiagramEditor::editSelectedElementInEditor()
+{
if (Element *selected_element = currentElement()) {
editElementInEditor(selected_element -> location());
}
@@ -2205,7 +2262,8 @@ void QETDiagramEditor::editSelectedElementInEditor() {
/**
Show the error message contained in \a result.
*/
-void QETDiagramEditor::showError(const QETResult &result) {
+void QETDiagramEditor::showError(const QETResult &result)
+{
if (result.isOk()) return;
showError(result.errorMessage());
}
@@ -2213,7 +2271,8 @@ void QETDiagramEditor::showError(const QETResult &result) {
/**
Show the \a error message.
*/
-void QETDiagramEditor::showError(const QString &error) {
+void QETDiagramEditor::showError(const QString &error)
+{
if (error.isEmpty()) return;
QET::QetMessageBox::critical(this, tr("Erreur", "message box title"), error);
}
diff --git a/sources/qetdiagrameditor.h b/sources/qetdiagrameditor.h
index 73e28c0d8..12b4adc69 100644
--- a/sources/qetdiagrameditor.h
+++ b/sources/qetdiagrameditor.h
@@ -52,14 +52,10 @@ class QETDiagramEditor : public QETMainWindow
Q_OBJECT
public:
- QETDiagramEditor(const QStringList & = QStringList(),
- QWidget * = nullptr);
+ QETDiagramEditor(
+ const QStringList & = QStringList(),
+ QWidget * = nullptr);
~QETDiagramEditor() override;
-
- private:
- QETDiagramEditor(const QETDiagramEditor &);
-
- public:
void closeEvent (QCloseEvent *) override;
QList openedProjects () const;
void addProjectView (ProjectView *);
@@ -73,8 +69,8 @@ class QETDiagramEditor : public QETMainWindow
protected:
bool event(QEvent *) override;
-
private:
+ QETDiagramEditor(const QETDiagramEditor &);
void setUpElementsPanel ();
void setUpElementsCollectionWidget();
void setUpUndoStack ();
@@ -148,70 +144,78 @@ class QETDiagramEditor : public QETMainWindow
void selectionChanged();
public:
- QAction *m_edit_diagram_properties; ///< Show a dialog to edit diagram properties
- QAction *m_conductor_reset; ///< Reset paths of selected conductors
- QAction *m_cut; ///< Cut selection to clipboard
- QAction *m_copy; ///< Copy selection to clipboard
+ QAction
+ *m_edit_diagram_properties, ///< Show a dialog to edit diagram properties
+ *m_conductor_reset, ///< Reset paths of selected conductors
+ *m_cut, ///< Cut selection to clipboard
+ *m_copy; ///< Copy selection to clipboard
- QActionGroup m_row_column_actions_group; /// Action related to add/remove rows/column in diagram
- QActionGroup m_selection_actions_group; ///Action related to edit a selected item
- QActionGroup *m_depth_action_group = nullptr;
+ QActionGroup
+ m_row_column_actions_group, /// Action related to add/remove rows/column in diagram
+ m_selection_actions_group, ///Action related to edit a selected item
+ *m_depth_action_group = nullptr;
private:
- QActionGroup *grp_visu_sel; ///< Action group for visualisation vs edition mode
- QActionGroup *m_group_view_mode; ///< Action group for project
- QActionGroup m_add_item_actions_group; ///Action related to adding (add text image shape...)
- QActionGroup m_zoom_actions_group; ///Action related to zoom for diagram
- QActionGroup m_select_actions_group; ///Action related to global selections
- QActionGroup m_file_actions_group; ///Actions related to file (open, close, save...)
+ QActionGroup
+ *grp_visu_sel, ///< Action group for visualisation vs edition mode
+ *m_group_view_mode, ///< Action group for project
+ m_add_item_actions_group, ///Action related to adding (add text image shape...)
+ m_zoom_actions_group, ///Action related to zoom for diagram
+ m_select_actions_group, ///Action related to global selections
+ m_file_actions_group; ///Actions related to file (open, close, save...)
- QAction *m_tabbed_view_mode; ///< Display projects as tabs
- QAction *m_windowed_view_mode; ///< Display projects as windows
- QAction *m_mode_selection; ///< Set edition mode
- QAction *m_mode_visualise; ///< Set visualisation mode
- QAction *m_export_diagram; ///< Export diagrams of the current project as imagess
- QAction *m_print; ///< Print diagrams of the current project
- QAction *m_quit_editor; ///< Quit the diagram editor
- QAction *undo; ///< Cancel the latest action
- QAction *redo; ///< Redo the latest cancelled operation
- QAction *m_paste; ///< Paste clipboard content on the current diagram
- QAction *m_auto_conductor; ///< Enable/Disable the use of auto conductor
- QAction *conductor_default; ///< Show a dialog to edit default conductor properties
- QAction *m_grey_background; ///< Switch the background color in white or grey
- QAction *m_draw_grid; ///< Switch the background grid display or not
- QAction *m_project_edit_properties; ///< Edit the properties of the current project.
- QAction *m_project_add_diagram; ///< Add a diagram to the current project.
- QAction *m_remove_diagram_from_project; ///< Delete a diagram from the current project
- QAction *m_clean_project; ///< Clean the content of the curent project by removing useless items
- QAction *m_project_folio_list; ///< Sommaire des schemas
- QAction *m_csv_export; ///< generate nomenclature
- QAction *m_add_nomenclature; ///< Add nomenclature graphics item;
- QAction *m_add_summary; /// m_zoom_action_toolBar; ///Only zoom action must displayed in the toolbar
- QAction *m_delete_selection; ///< Delete selection
- QAction *m_rotate_selection; ///< Rotate selected elements and text items by 90 degrees
- QAction *m_rotate_texts; ///< Direct selected text items to a specific angle
- QAction *m_find_element; ///< Find the selected element in the panel
- QAction *m_group_selected_texts = nullptr;
- QAction *m_close_file; ///< Close current project file
- QAction *m_save_file; ///< Save current project
- QAction *m_save_file_as; ///< Save current project as a specific file
- QAction *m_find = nullptr;
QMdiArea m_workspace;
QSignalMapper windowMapper;
QDir open_dialog_dir; /// Directory to use for file dialogs such as File > save
- QDockWidget *qdw_pa; /// Dock for the elements panel
- QDockWidget *m_qdw_elmt_collection;
- QDockWidget *qdw_undo; /// Dock for the undo list
+
+ QDockWidget
+ *qdw_pa, /// Dock for the elements panel
+ *m_qdw_elmt_collection,
+ *qdw_undo; /// Dock for the undo list
+
ElementsCollectionWidget *m_element_collection_widget;
DiagramPropertiesEditorDockWidget *m_selection_properties_editor;
@@ -219,11 +223,12 @@ class QETDiagramEditor : public QETMainWindow
ElementsPanelWidget *pa;
QMenu *windows_menu;
- QToolBar *main_tool_bar = nullptr,
- *view_tool_bar = nullptr,
- *diagram_tool_bar = nullptr,
- *m_add_item_tool_bar = nullptr,
- *m_depth_tool_bar = nullptr;
+ QToolBar
+ *main_tool_bar = nullptr,
+ *view_tool_bar = nullptr,
+ *diagram_tool_bar = nullptr,
+ *m_add_item_tool_bar = nullptr,
+ *m_depth_tool_bar = nullptr;
QUndoGroup undo_group;
AutoNumberingDockWidget *m_autonumbering_dock;
diff --git a/sources/qetgraphicsitem/ViewItem/projectdbmodel.cpp b/sources/qetgraphicsitem/ViewItem/projectdbmodel.cpp
index 620006624..67f9d47a9 100644
--- a/sources/qetgraphicsitem/ViewItem/projectdbmodel.cpp
+++ b/sources/qetgraphicsitem/ViewItem/projectdbmodel.cpp
@@ -215,11 +215,13 @@ void ProjectDBModel::setQuery(const QString &query)
@brief ProjectDBModel::queryString
@return the current query used by this model
*/
-QString ProjectDBModel::queryString() const {
+QString ProjectDBModel::queryString() const
+{
return m_query;
}
-QETProject *ProjectDBModel::project() const {
+QETProject *ProjectDBModel::project() const
+{
return m_project.data();
}
diff --git a/sources/qetgraphicsitem/ViewItem/qetgraphicsheaderitem.cpp b/sources/qetgraphicsitem/ViewItem/qetgraphicsheaderitem.cpp
index bc9d633b8..7dac5e773 100644
--- a/sources/qetgraphicsitem/ViewItem/qetgraphicsheaderitem.cpp
+++ b/sources/qetgraphicsitem/ViewItem/qetgraphicsheaderitem.cpp
@@ -31,7 +31,7 @@ static int no_model_width = 40;
@param parent
*/
QetGraphicsHeaderItem::QetGraphicsHeaderItem(QGraphicsItem *parent) :
- QGraphicsObject(parent)
+ QGraphicsObject(parent)
{}
/**
@@ -44,17 +44,23 @@ QetGraphicsHeaderItem::QetGraphicsHeaderItem(QGraphicsItem *parent) :
void QetGraphicsHeaderItem::setModel(QAbstractItemModel *model)
{
if (m_model) {
- disconnect(m_model, &QAbstractItemModel::headerDataChanged, this, &QetGraphicsHeaderItem::headerDataChanged);
- disconnect(m_model, &QAbstractItemModel::modelReset, this, &QetGraphicsHeaderItem::modelReseted);
- disconnect(m_model, &QAbstractItemModel::columnsInserted, this, &QetGraphicsHeaderItem::modelReseted);
+ disconnect(m_model, &QAbstractItemModel::headerDataChanged,
+ this, &QetGraphicsHeaderItem::headerDataChanged);
+ disconnect(m_model, &QAbstractItemModel::modelReset,
+ this, &QetGraphicsHeaderItem::modelReseted);
+ disconnect(m_model, &QAbstractItemModel::columnsInserted,
+ this, &QetGraphicsHeaderItem::modelReseted);
}
- m_model = model;
+ m_model = model;
if (m_model)
{
- connect(m_model, &QAbstractItemModel::headerDataChanged, this, &QetGraphicsHeaderItem::headerDataChanged);
- connect(m_model, &QAbstractItemModel::modelReset, this, &QetGraphicsHeaderItem::modelReseted);
- connect(m_model, &QAbstractItemModel::columnsInserted, this, &QetGraphicsHeaderItem::modelReseted);
+ connect(m_model, &QAbstractItemModel::headerDataChanged,
+ this, &QetGraphicsHeaderItem::headerDataChanged);
+ connect(m_model, &QAbstractItemModel::modelReset, this,
+ &QetGraphicsHeaderItem::modelReseted);
+ connect(m_model, &QAbstractItemModel::columnsInserted,
+ this, &QetGraphicsHeaderItem::modelReseted);
setUpMinimumSectionsSize();
m_current_sections_width.clear();
m_current_sections_width.resize(m_sections_minimum_width.size());
@@ -69,7 +75,8 @@ void QetGraphicsHeaderItem::setModel(QAbstractItemModel *model)
@brief QetGraphicsHeaderItem::model
@return the model that this item is presenting
*/
-QAbstractItemModel *QetGraphicsHeaderItem::model() const {
+QAbstractItemModel *QetGraphicsHeaderItem::model() const
+{
return m_model;
}
@@ -78,7 +85,8 @@ QAbstractItemModel *QetGraphicsHeaderItem::model() const {
Reimplemented from QGraphicsObject::boundingRect() const;
@return
*/
-QRectF QetGraphicsHeaderItem::boundingRect() const {
+QRectF QetGraphicsHeaderItem::boundingRect() const
+{
return m_bounding_rect;
}
@@ -89,7 +97,10 @@ QRectF QetGraphicsHeaderItem::boundingRect() const {
@param option
@param widget
*/
-void QetGraphicsHeaderItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
+void QetGraphicsHeaderItem::paint(
+ QPainter *painter,
+ const QStyleOptionGraphicsItem *option,
+ QWidget *widget)
{
Q_UNUSED(option)
Q_UNUSED(widget)
@@ -113,9 +124,13 @@ void QetGraphicsHeaderItem::paint(QPainter *painter, const QStyleOptionGraphicsI
painter->restore();
return;
}
- painter->setFont(m_model->headerData(0, Qt::Horizontal, Qt::FontRole).value());
+ painter->setFont(
+ m_model->headerData(
+ 0,
+ Qt::Horizontal,
+ Qt::FontRole).value());
- //Draw vertical lines
+ //Draw vertical lines
auto offset= 0;
for(auto size : m_current_sections_width)
{
@@ -125,15 +140,33 @@ void QetGraphicsHeaderItem::paint(QPainter *painter, const QStyleOptionGraphicsI
offset += size;
}
- //Write text of each cell
- auto margins_ = QETUtils::marginsFromString(m_model->headerData(0, Qt::Horizontal, Qt::UserRole+1).toString());
+ //Write text of each cell
+ auto margins_ = QETUtils::marginsFromString(
+ m_model->headerData(
+ 0,
+ Qt::Horizontal,
+ Qt::UserRole+1).toString());
QPointF top_left(margins_.left(), margins_.top());
for (auto i= 0 ; icolumnCount() ; ++i)
{
- QSize size(m_current_sections_width.at(i) - margins_.left() - margins_.right(), m_section_height - margins_.top() - margins_.bottom());
- painter->drawText(QRectF(top_left, size),
- m_model->headerData(0, Qt::Horizontal, Qt::TextAlignmentRole).toInt(),
- m_model->headerData(i, Qt::Horizontal, Qt::DisplayRole).toString());
+ QSize size(
+ m_current_sections_width.at(i)
+ - margins_.left()
+ - margins_.right(),
+
+ m_section_height
+ - margins_.top()
+ - margins_.bottom());
+ painter->drawText(
+ QRectF(top_left, size),
+ m_model->headerData(
+ 0,
+ Qt::Horizontal,
+ Qt::TextAlignmentRole).toInt(),
+ m_model->headerData(
+ i,
+ Qt::Horizontal,
+ Qt::DisplayRole).toString());
top_left.setX(top_left.x() + m_current_sections_width.at(i));
}
@@ -141,54 +174,71 @@ void QetGraphicsHeaderItem::paint(QPainter *painter, const QStyleOptionGraphicsI
painter->restore();
}
/**
- @brief QetGraphicsHeaderItem::toDXF
- Draw this table to the dxf document
- @param filepath file path of the the dxf document
- @return true if draw success
+ @brief QetGraphicsHeaderItem::toDXF
+ Draw this table to the dxf document
+ @param filepath file path of the the dxf document
+ @return true if draw success
*/
bool QetGraphicsHeaderItem::toDXF(const QString &filepath)
{
- QRectF rect = m_current_rect;
- QPolygonF poly(rect);
- Createdxf::drawPolygon(filepath,mapToScene(poly),0);
+ QRectF rect = m_current_rect;
+ QPolygonF poly(rect);
+ Createdxf::drawPolygon(filepath,mapToScene(poly),0);
- //Draw vertical lines
- auto offset= 0;
- for(auto size : m_current_sections_width)
- {
- QPointF p1(offset+size, m_current_rect.top());
- QPointF p2(offset+size, m_current_rect.bottom());
- Createdxf::drawLine(filepath,QLineF(mapToScene(p1),mapToScene(p2)),0);
- offset += size;
- }
+ //Draw vertical lines
+ auto offset= 0;
+ for(auto size : m_current_sections_width)
+ {
+ QPointF p1(offset+size, m_current_rect.top());
+ QPointF p2(offset+size, m_current_rect.bottom());
+ Createdxf::drawLine(
+ filepath,
+ QLineF(
+ mapToScene(p1),
+ mapToScene(p2)),
+ 0);
+ offset += size;
+ }
- //Write text of each cell
- auto margins_ = QETUtils::marginsFromString(m_model->headerData(0, Qt::Horizontal, Qt::UserRole+1).toString());
- QPointF top_left(margins_.left(), margins_.top());
- for (auto i= 0 ; icolumnCount() ; ++i)
- {
- QSize size(m_current_sections_width.at(i) - margins_.left() - margins_.right(), m_section_height - margins_.top() - margins_.bottom());
+ //Write text of each cell
+ auto margins_ = QETUtils::marginsFromString(
+ m_model->headerData(
+ 0,
+ Qt::Horizontal,
+ Qt::UserRole+1).toString());
+ QPointF top_left(margins_.left(), margins_.top());
+ for (auto i= 0 ; icolumnCount() ; ++i)
+ {
+ QSize size(m_current_sections_width.at(i) - margins_.left() - margins_.right(),
+ m_section_height - margins_.top() - margins_.bottom());
- QPointF qm = mapToScene(top_left);
- qreal h = size.height();// * Createdxf::yScale;
- qreal x = qm.x() * Createdxf::xScale;
- qreal y = Createdxf::sheetHeight - ((qm.y() + h/2) * Createdxf::yScale);
- qreal h1 = h * 0.5 * Createdxf::yScale;
+ QPointF qm = mapToScene(top_left);
+ qreal h = size.height();// * Createdxf::yScale;
+ qreal x = qm.x() * Createdxf::xScale;
+ qreal y = Createdxf::sheetHeight - ((qm.y() + h/2) * Createdxf::yScale);
+ qreal h1 = h * 0.5 * Createdxf::yScale;
- int valign = 2;
+ int valign = 2;
- Createdxf::drawTextAligned(filepath,m_model->headerData(i, Qt::Horizontal, Qt::DisplayRole).toString(),x,y,h1,0,0,0,valign,x,0,0);
+ Createdxf::drawTextAligned(
+ filepath,
+ m_model->headerData(
+ i,
+ Qt::Horizontal,
+ Qt::DisplayRole).toString(),
+ x,y,h1,0,0,0,valign,x,0,0);
- top_left.setX(top_left.x() + m_current_sections_width.at(i));
- }
- return true;
+ top_left.setX(top_left.x() + m_current_sections_width.at(i));
+ }
+ return true;
}
/**
@brief QetGraphicsHeaderItem::rect
@return the current rect of the item aka the size of rectangle painted.
*/
-QRect QetGraphicsHeaderItem::rect() const {
+QRect QetGraphicsHeaderItem::rect() const
+{
return m_current_rect;
}
@@ -223,7 +273,11 @@ void QetGraphicsHeaderItem::resizeSection(int logicalIndex, int size)
{
prepareGeometryChange();
m_current_sections_width.replace(logicalIndex, size);
- m_current_rect.setWidth(std::accumulate(m_current_sections_width.begin(), m_current_sections_width.end(), 0));
+ m_current_rect.setWidth(
+ std::accumulate(
+ m_current_sections_width.begin(),
+ m_current_sections_width.end(),
+ 0));
setUpBoundingRect();
update();
emit sectionResized(logicalIndex, size);
@@ -254,7 +308,14 @@ QDomElement QetGraphicsHeaderItem::toXml(QDomDocument &document) const
{
auto dom_element = document.createElement(xmlTagName());
if (m_model) {
- dom_element.appendChild(QETXML::marginsToXml(document, QETUtils::marginsFromString(m_model->headerData(0, Qt::Horizontal, Qt::UserRole+1).toString())));
+ dom_element.appendChild(
+ QETXML::marginsToXml(
+ document,
+ QETUtils::marginsFromString(
+ m_model->headerData(
+ 0,
+ Qt::Horizontal,
+ Qt::UserRole+1).toString())));
}
return dom_element;
@@ -271,8 +332,16 @@ void QetGraphicsHeaderItem::fromXml(const QDomElement &element)
return;
}
- auto margins_ = QETUtils::marginsToString(QETXML::marginsFromXml(element.firstChildElement("margins")));
- m_model->setHeaderData(0, Qt::Horizontal, QETUtils::marginsToString(QETXML::marginsFromXml(element.firstChildElement("margins"))), Qt::UserRole+1);
+ auto margins_ = QETUtils::marginsToString(
+ QETXML::marginsFromXml(
+ element.firstChildElement("margins")));
+ m_model->setHeaderData(
+ 0,
+ Qt::Horizontal,
+ QETUtils::marginsToString(
+ QETXML::marginsFromXml(
+ element.firstChildElement("margins"))),
+ Qt::UserRole+1);
}
/**
@@ -291,10 +360,19 @@ void QetGraphicsHeaderItem::setUpMinimumSectionsSize()
return;
}
- QFontMetrics metrics(m_model->headerData(0, Qt::Horizontal, Qt::FontRole).value());
- auto margins_ = QETUtils::marginsFromString(m_model->headerData(0, Qt::Horizontal, Qt::UserRole+1).toString());
+ QFontMetrics metrics(
+ m_model->headerData(
+ 0,
+ Qt::Horizontal,
+ Qt::FontRole).value());
+ auto margins_ = QETUtils::marginsFromString(
+ m_model->headerData(
+ 0,
+ Qt::Horizontal,
+ Qt::UserRole+1).toString());
//Set the height of row;
- m_minimum_section_height = metrics.boundingRect("HEIGHT TEST").height() + margins_.top() + margins_.bottom();
+ m_minimum_section_height = metrics.boundingRect("HEIGHT TEST").height()
+ + margins_.top() + margins_.bottom();
m_sections_minimum_width.clear();
m_sections_minimum_width.resize(m_model->columnCount());
@@ -302,17 +380,25 @@ void QetGraphicsHeaderItem::setUpMinimumSectionsSize()
for (auto i= 0 ; icolumnCount() ; ++i)
{
auto str = m_model->headerData(i, Qt::Horizontal).toString();
- m_sections_minimum_width.replace(i, metrics.boundingRect(str).width() + margins_.left() + margins_.right());
+ m_sections_minimum_width.replace(
+ i,
+ metrics.boundingRect(str).width()
+ + margins_.left()
+ + margins_.right());
}
- m_minimum_width = std::accumulate(m_sections_minimum_width.begin(), m_sections_minimum_width.end(), 0);
+ m_minimum_width = std::accumulate(
+ m_sections_minimum_width.begin(),
+ m_sections_minimum_width.end(),
+ 0);
}
/**
@brief QetGraphicsHeaderItem::setUpBoundingRect
Setup the bounding rect of the item
*/
-void QetGraphicsHeaderItem::setUpBoundingRect() {
+void QetGraphicsHeaderItem::setUpBoundingRect()
+{
m_bounding_rect = m_current_rect.adjusted(-10, -10, 10, 10);
}
@@ -323,7 +409,8 @@ void QetGraphicsHeaderItem::setUpBoundingRect() {
@param first
@param last
*/
-void QetGraphicsHeaderItem::headerDataChanged(Qt::Orientations orientation, int first, int last)
+void QetGraphicsHeaderItem::headerDataChanged(
+ Qt::Orientations orientation, int first, int last)
{
Q_UNUSED(orientation)
Q_UNUSED(first)
diff --git a/sources/qetgraphicsitem/ViewItem/qetgraphicsheaderitem.h b/sources/qetgraphicsitem/ViewItem/qetgraphicsheaderitem.h
index 2ad97f219..9fbd6bca8 100644
--- a/sources/qetgraphicsitem/ViewItem/qetgraphicsheaderitem.h
+++ b/sources/qetgraphicsitem/ViewItem/qetgraphicsheaderitem.h
@@ -51,17 +51,22 @@ class QetGraphicsHeaderItem : public QGraphicsObject
QAbstractItemModel *model() const;
virtual QRectF boundingRect() const override;
- virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
+ virtual void paint(
+ QPainter *painter,
+ const QStyleOptionGraphicsItem *option,
+ QWidget *widget) override;
QRect rect() const;
void resizeSection(int logicalIndex, int size);
int sectionSize(int logical_index) const;
- QVector minimumSectionWidth() const {return m_sections_minimum_width;}
- int minimumWidth() const {return m_minimum_width;}
+ QVector minimumSectionWidth() const
+ {return m_sections_minimum_width;}
+ int minimumWidth() const
+ {return m_minimum_width;}
QDomElement toXml (QDomDocument &document) const;
void fromXml(const QDomElement &element);
static QString xmlTagName() {return QString("graphics_header");}
- virtual bool toDXF (const QString &filepath);
+ virtual bool toDXF (const QString &filepath);
signals:
void sectionResized(int logicalIndex, int size);
@@ -70,19 +75,25 @@ class QetGraphicsHeaderItem : public QGraphicsObject
private:
void setUpMinimumSectionsSize();
void setUpBoundingRect();
- void headerDataChanged(Qt::Orientations orientation, int first, int last);
+ void headerDataChanged(
+ Qt::Orientations orientation,
+ int first,
+ int last);
void adjustSize();
void modelReseted();
- private:
+ QRect m_current_rect;
QRectF m_bounding_rect;
QAbstractItemModel *m_model = nullptr;
- QVector m_sections_minimum_width,
- m_current_sections_width;
- int m_section_height=1,
- m_minimum_section_height=1;
- int m_minimum_width=1;
- QRect m_current_rect;
+
+ QVector
+ m_sections_minimum_width,
+ m_current_sections_width;
+
+ int
+ m_section_height=1,
+ m_minimum_section_height=1,
+ m_minimum_width=1;
};
#endif // QETGRAPHICSHEADERITEM_H
diff --git a/sources/qetgraphicsitem/ViewItem/qetgraphicstableitem.cpp b/sources/qetgraphicsitem/ViewItem/qetgraphicstableitem.cpp
index aad8236ec..f555ca441 100644
--- a/sources/qetgraphicsitem/ViewItem/qetgraphicstableitem.cpp
+++ b/sources/qetgraphicsitem/ViewItem/qetgraphicstableitem.cpp
@@ -40,24 +40,29 @@ 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;
}
auto drawable_rect = table->diagram()->border_and_titleblock.insideBorderRect();
- table->setPos(drawable_rect.topLeft().x() + margins.left(), drawable_rect.topLeft().y() + margins.top() + table->headerItem()->rect().height());
+ table->setPos(
+ drawable_rect.topLeft().x() + margins.left(),
+ drawable_rect.topLeft().y()
+ + margins.top()
+ + table->headerItem()->rect().height());
auto size_ = table->size();
size_.setWidth(int(drawable_rect.width() - (margins.left() + margins.right())));
- //Size must be a multiple of 10, because the table adjust itself by step of 10.
+ //Size must be a multiple of 10, because the table adjust itself by step of 10.
while (size_.width()%10) {
--size_.rwidth(); }
table->setSize(size_);
- //Calcul the maximum row to display to fit the nomenclature into diagram
+ //Calcul the maximum row to display to fit the nomenclature into diagram
auto available_height = drawable_rect.height() - table->pos().y();
auto min_row_height = table->minimumRowHeigth();
table->setDisplayNRow(int(floor(available_height/min_row_height))); //Convert a double to int, but max_row_to_display is already rounded an integer so we assume everything is ok
@@ -130,16 +135,21 @@ QetGraphicsTableItem::QetGraphicsTableItem(QGraphicsItem *parent) :
setAcceptHoverEvents(true);
setUpHandler();
- //A litle bounding rect before model is set,
- //then user can already grab this item, even if model is not already set
+ //A litle bounding rect before model is set,
+ //then user can already grab this item, even if model is not already set
m_bounding_rect.setRect(m_br_margin/-2, m_br_margin/-2, 50, 50);
- connect(this, &QetGraphicsTableItem::xChanged, this, &QetGraphicsTableItem::adjustHandlerPos);
- connect(this, &QetGraphicsTableItem::yChanged, this, &QetGraphicsTableItem::adjustHandlerPos);
+ connect(this, &QetGraphicsTableItem::xChanged,
+ this, &QetGraphicsTableItem::adjustHandlerPos);
+ connect(this, &QetGraphicsTableItem::yChanged,
+ this, &QetGraphicsTableItem::adjustHandlerPos);
m_header_item = new QetGraphicsHeaderItem(this);
- connect(m_header_item, &QetGraphicsHeaderItem::sectionResized, this, &QetGraphicsTableItem::headerSectionResized);
- connect(m_header_item, &QetGraphicsHeaderItem::heightResized, this, [this]() {
+ connect(m_header_item, &QetGraphicsHeaderItem::sectionResized,
+ this, &QetGraphicsTableItem::headerSectionResized);
+ connect(m_header_item, &QetGraphicsHeaderItem::heightResized,
+ this, [this]()
+ {
m_header_item->setPos(0, 0-m_header_item->rect().height());
});
//Init the size of table without a model
@@ -160,8 +170,10 @@ void QetGraphicsTableItem::setModel(QAbstractItemModel *model)
{
if (m_model)
{
- disconnect(m_model, &QAbstractItemModel::dataChanged, this, &QetGraphicsTableItem::dataChanged);
- disconnect(m_model, &QAbstractItemModel::modelReset, this, &QetGraphicsTableItem::modelReseted);
+ disconnect(m_model, &QAbstractItemModel::dataChanged,
+ this, &QetGraphicsTableItem::dataChanged);
+ disconnect(m_model, &QAbstractItemModel::modelReset,
+ this, &QetGraphicsTableItem::modelReseted);
}
m_model = model;
m_header_item->setModel(model);
@@ -172,8 +184,10 @@ void QetGraphicsTableItem::setModel(QAbstractItemModel *model)
m_header_item->setPos(0, -m_header_item->rect().height());
if (m_model)
{
- connect(m_model, &QAbstractItemModel::dataChanged, this, &QetGraphicsTableItem::dataChanged);
- connect(m_model, &QAbstractItemModel::modelReset, this, &QetGraphicsTableItem::modelReseted);
+ connect(m_model, &QAbstractItemModel::dataChanged,
+ this, &QetGraphicsTableItem::dataChanged);
+ connect(m_model, &QAbstractItemModel::modelReset,
+ this, &QetGraphicsTableItem::modelReseted);
}
if (m_next_table) {
@@ -185,7 +199,8 @@ void QetGraphicsTableItem::setModel(QAbstractItemModel *model)
@brief QetGraphicsTableItem::model
@return The model that this item is presenting
*/
-QAbstractItemModel *QetGraphicsTableItem::model() const {
+QAbstractItemModel *QetGraphicsTableItem::model() const
+{
return m_model;
}
@@ -194,7 +209,8 @@ QAbstractItemModel *QetGraphicsTableItem::model() const {
Reimplemented from QGraphicsObject
@return
*/
-QRectF QetGraphicsTableItem::boundingRect() const {
+QRectF QetGraphicsTableItem::boundingRect() const
+{
return m_bounding_rect;
}
@@ -205,7 +221,10 @@ QRectF QetGraphicsTableItem::boundingRect() const {
@param option
@param widget
*/
-void QetGraphicsTableItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
+void QetGraphicsTableItem::paint(
+ QPainter *painter,
+ const QStyleOptionGraphicsItem *option,
+ QWidget *widget)
{
Q_UNUSED(option)
Q_UNUSED(widget)
@@ -236,7 +255,7 @@ void QetGraphicsTableItem::paint(QPainter *painter, const QStyleOptionGraphicsIt
}
painter->setFont(m_model->data(m_model->index(0,0), Qt::FontRole).value());
- //Draw vertical lines
+ //Draw vertical lines
auto offset= 0;
for(auto i=0 ; icolumnCount() ; ++i)
{
@@ -246,7 +265,7 @@ void QetGraphicsTableItem::paint(QPainter *painter, const QStyleOptionGraphicsIt
offset += m_header_item->sectionSize(i);
}
- //Calcule the number of rows to display.
+ //Calcule the number of rows to display.
auto row_count = m_model->rowCount();
if (m_previous_table) //Remove the number of row already displayed by previous tables
@@ -255,7 +274,7 @@ void QetGraphicsTableItem::paint(QPainter *painter, const QStyleOptionGraphicsIt
if (m_number_of_displayed_row > 0) //User override the number of row to display
row_count = std::min(row_count, m_number_of_displayed_row);
- //Draw horizontal lines
+ //Draw horizontal lines
auto cell_height = static_cast(m_current_size.height())/static_cast(row_count);
for(auto i= 1 ; i-1drawLine(p1, p2);
}
- //Write text of each cell
+ //Write text of each cell
for (auto i=0 ; i