QElectroTech  0.8-dev
qetproject.h
Go to the documentation of this file.
1 /*
2  Copyright 2006-2020 The QElectroTech Team
3  This file is part of QElectroTech.
4 
5  QElectroTech is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 2 of the License, or
8  (at your option) any later version.
9 
10  QElectroTech is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
17 */
18 #ifndef QET_PROJECT_H
19 #define QET_PROJECT_H
20 
21 #include "nameslist.h"
22 #include "elementslocation.h"
23 #include "borderproperties.h"
24 #include "conductorproperties.h"
25 #include "titleblockproperties.h"
26 #include "templatescollection.h"
28 #include "projectdatabase.h"
29 #include "reportproperties.h"
30 
31 #include <KAutoSaveFile>
32 
33 class Diagram;
34 class ElementsLocation;
35 class QETResult;
36 class TitleBlockTemplate;
39 class QUndoStack;
41 class QTimer;
42 class KAutoSaveFile;
43 
50 class QETProject : public QObject
51 {
52  Q_OBJECT
53  public :
54  //This enum lists possible states for a particular project.
55  enum ProjectState {
56  Ok = 0,
61  FileOpenDiscard = 5
62  };
63 
64  Q_PROPERTY(bool autoConductor READ autoConductor WRITE setAutoConductor)
65 
66  // constructors, destructor
67  public:
68  QETProject (QObject *parent = nullptr);
69  QETProject (const QString &path, QObject * = nullptr);
70  QETProject (KAutoSaveFile *backup, QObject *parent=nullptr);
71  ~QETProject() override;
72 
73  private:
75 
76  // methods
77  public:
79  QUuid uuid() const;
80  ProjectState state() const;
81  QList<Diagram *> diagrams() const;
82  int folioIndex(const Diagram *) const;
85  QString filePath();
86  void setFilePath(const QString &);
87  QString currentDir() const;
88  QString pathNameTitle() const;
89  QString title() const;
91  void setTitle(const QString &);
92 
96 
99 
102 
103  QString defaultReportProperties() const;
104  void setDefaultReportProperties (const QString &properties);
105 
106  XRefProperties defaultXRefProperties (const QString &type) const {return m_default_xref_properties[type];}
107  QHash <QString, XRefProperties> defaultXRefProperties() const {return m_default_xref_properties;}
108  void setDefaultXRefProperties(const QString& type, const XRefProperties &properties);
109  void setDefaultXRefProperties(QHash <QString, XRefProperties> hash);
110 
111  QHash <QString, NumerotationContext> conductorAutoNum() const;
112  QHash <QString, NumerotationContext> elementAutoNum() const;
113  QHash <QString, NumerotationContext> folioAutoNum() const;
114  void addConductorAutoNum (const QString& key, const NumerotationContext& context);
115  void addElementAutoNum (const QString& key, const NumerotationContext& context);
116  void addFolioAutoNum (const QString& key, const NumerotationContext& context);
117  void removeConductorAutoNum (const QString& key);
118  void removeElementAutoNum (const QString& key);
119  void removeFolioAutoNum (const QString& key);
120  NumerotationContext conductorAutoNum(const QString &key) const;
121  NumerotationContext folioAutoNum(const QString &key) const;
122  NumerotationContext elementAutoNum(const QString &key);
123 
124  QString conductorAutoNumFormula(const QString& key) const; //returns Formula
125  QString conductorCurrentAutoNum() const;
126  void setCurrentConductorAutoNum(QString autoNum);
127 
128  QString elementAutoNumFormula(const QString& key) const;
129  QString elementAutoNumCurrentFormula() const;
130  QString elementCurrentAutoNum() const;
131  void setCurrrentElementAutonum(QString autoNum);
132 
133  //Element
134  void freezeExistentElementLabel(bool freeze, int from, int to);
135  void freezeNewElementLabel(bool freeze, int from, int to);
136  bool isFreezeNewElements();
137  void setFreezeNewElements(bool);
138 
139  //Conductor
140  void freezeExistentConductorLabel(bool freeze, int from, int to);
141  void freezeNewConductorLabel(bool freeze, int from, int to);
142  bool isFreezeNewConductors();
143  void setFreezeNewConductors(bool);
144 
145  bool autoConductor () const;
146  bool autoElement () const;
147  bool autoFolio () const;
148  void setAutoConductor (bool ac);
149  void setAutoElement (bool ae);
151  void autoFolioNumberingSelectedFolios(int, int, const QString&);
152 
153  QDomDocument toXml();
154  bool close();
155  QETResult write();
156  bool isReadOnly() const;
157  void setReadOnly(bool);
158  bool isEmpty() const;
161  bool usesElement(const ElementsLocation &) const;
162  QList <ElementsLocation> unusedElements() const;
164  bool projectWasModified();
167  void setProjectProperties(const DiagramContext &);
168  QUndoStack* undoStack() {return m_undo_stack;}
169 
170  public slots:
171  Diagram *addNewDiagram(int pos = -1);
172  void removeDiagram(Diagram *);
173  void diagramOrderChanged(int, int);
174  void setModified(bool);
175 
176  signals:
177  void projectFilePathChanged(QETProject *, const QString &);
178  void projectTitleChanged(QETProject *, const QString &);
186  void reportPropertiesChanged(const QString &old_str, const QString &new_str);
189  void elementAutoNumAdded(QString name);
190  void elementAutoNumRemoved(QString name);
195  void folioAutoNumChanged(QString);
198 
199  private slots:
203  void usedTitleBlockTemplateChanged(const QString &);
204  void undoStackChanged (bool a) {if (!a) setModified(true);}
205 
206  private:
207  void readProjectXml(QDomDocument &xml_project);
208  void readDiagramsXml(QDomDocument &xml_project);
209  void readElementsCollectionXml(QDomDocument &xml_project);
210  void readProjectPropertiesXml(QDomDocument &xml_project);
211  void readDefaultPropertiesXml(QDomDocument &xml_project);
212 
213  void writeProjectPropertiesXml(QDomElement &);
214  void writeDefaultPropertiesXml(QDomElement &);
215  void addDiagram(Diagram *diagram, int pos = -1);
217  void writeBackup();
218  void init();
219  ProjectState openFile(QFile *file);
220 
221  // attributes
222  private:
224  QString m_file_path;
228  QList<Diagram *> m_diagrams_list;
230  QString project_title_;
234  bool m_modified = false;
236  bool m_read_only = false;
254  QUndoStack *m_undo_stack;
256  QHash <QString, NumerotationContext> m_conductor_autonum;//Title and NumContext hash
259  QHash <QString, NumerotationContext> m_folio_autonum;
261  QHash <QString, NumerotationContext> m_element_autonum; //Title and NumContext hash
263  bool m_auto_conductor = true;
265  bool m_freeze_new_elements = false;
269  KAutoSaveFile m_backup_file;
270  QUuid m_uuid = QUuid::createUuid();
272 };
273 
275 #endif
ElementsLocation::exist
bool exist() const
ElementsLocation::exist.
Definition: elementslocation.cpp:472
QETProject::m_file_path
QString m_file_path
File path this project is saved to.
Definition: qetproject.h:224
QETProject::readOnlyChanged
void readOnlyChanged(QETProject *, bool)
QETProject::projectProperties
DiagramContext projectProperties()
Definition: qetproject.cpp:1669
QETProject::defaultTitleBlockProperties
TitleBlockProperties defaultTitleBlockProperties() const
Definition: qetproject.cpp:416
TitleBlockTemplatesProjectCollection::templates
QStringList templates() override
Definition: templatescollection.cpp:182
QETProject::addAutoNumDiagram
void addAutoNumDiagram()
QETProject::ProjectParsingRunning
@ ProjectParsingRunning
XML parsing failed.
Definition: qetproject.h:59
QETProject::conductorAutoNumAdded
void conductorAutoNumAdded()
QETProject::autoFolioNumberingNewFolios
void autoFolioNumberingNewFolios()
QETProject::autoFolioNumberingNewFolios emit Signal to add new Diagram with autonum properties.
Definition: qetproject.cpp:788
BorderProperties
The BorderProperties class This class is a container for dimensions and display properties of a diagr...
Definition: borderproperties.h:29
QETProject::m_diagrams_list
QList< Diagram * > m_diagrams_list
Diagrams carried by the project.
Definition: qetproject.h:228
QETProject::addElementAutoNum
void addElementAutoNum(const QString &key, const NumerotationContext &context)
QETProject::addElementAutoNum Add a new element numerotation context. If key already exist,...
Definition: qetproject.cpp:598
QETProject::m_current_conductor_autonum
QString m_current_conductor_autonum
Definition: qetproject.h:257
NamesList::addName
void addName(const QString &, const QString &)
Definition: nameslist.cpp:43
QETProject::dataBase
projectDataBase * dataBase()
QETProject::dataBase.
Definition: qetproject.cpp:124
QETProject::projectTitleChanged
void projectTitleChanged(QETProject *, const QString &)
QETProject::undoStack
QUndoStack * undoStack()
Definition: qetproject.h:168
QET::Ignore
@ Ignore
Skip the current item.
Definition: qet.h:129
QETProject::integrateTitleBlockTemplate
QString integrateTitleBlockTemplate(const TitleBlockTemplateLocation &, MoveTitleBlockTemplatesHandler *handler)
QETProject::integrateTitleBlockTemplate Integrate a title block template into this project.
Definition: qetproject.cpp:1065
QETProject::embeddedElementCollection
XmlElementCollection * embeddedElementCollection() const
QETProject::embeddedCollection.
Definition: qetproject.cpp:236
IntegrationMoveTitleBlockTemplatesHandler
Definition: integrationmovetemplateshandler.h:27
TitleBlockTemplatesProjectCollection::getTemplateXmlDescription
QDomElement getTemplateXmlDescription(const QString &) override
Definition: templatescollection.cpp:217
TitleBlockTemplateLocation::getTemplateXmlDescription
QDomElement getTemplateXmlDescription() const
Definition: templatelocation.cpp:138
DiagramContext::fromXml
void fromXml(const QDomElement &, const QString &="property")
Definition: diagramcontext.cpp:157
QETProject::undoStackChanged
void undoStackChanged(bool a)
Definition: qetproject.h:204
nameslist.h
QETProject::isReadOnly
bool isReadOnly() const
QETProject::isReadOnly.
Definition: qetproject.cpp:924
QETProject::projectDiagramsOrderChanged
void projectDiagramsOrderChanged(QETProject *, int, int)
QETProject::m_uuid
QUuid m_uuid
Definition: qetproject.h:270
QETProject::folioIndex
int folioIndex(const Diagram *) const
Definition: qetproject.cpp:227
TitleBlockTemplatesProjectCollection::setTemplateXmlDescription
bool setTemplateXmlDescription(const QString &, const QDomElement &) override
Definition: templatescollection.cpp:235
Q_DECLARE_METATYPE
Q_DECLARE_METATYPE(NamesList)
QETProject::defaultBorderProperties
BorderProperties defaultBorderProperties() const
DEFAULT PROPERTIES.
Definition: qetproject.cpp:399
QETProject::openFile
ProjectState openFile(QFile *file)
QETProject::openFile.
Definition: qetproject.cpp:172
QETProject::autoFolioNumberingSelectedFolios
void autoFolioNumberingSelectedFolios(int, int, const QString &)
QETProject::autoFolioNumberingNewFolios.
Definition: qetproject.cpp:799
QET::Custom
@ Custom
From user collection.
Definition: qet.h:154
QETProject::removeElementAutoNum
void removeElementAutoNum(const QString &key)
QETProject::removeElementAutonum Remove Element Numerotation Context stored with key.
Definition: qetproject.cpp:629
ConductorProperties::defaultProperties
static ConductorProperties defaultProperties()
ConductorProperties::defaultProperties.
Definition: conductorproperties.cpp:720
QETProject::title
QString title() const
Definition: qetproject.cpp:366
QETProject::projectModified
void projectModified(QETProject *, bool)
titleblockproperties.h
QETProject::ProjectState
ProjectState
Definition: qetproject.h:55
ElementsLocation::fileName
QString fileName() const
ElementLocation::fileName.
Definition: elementslocation.cpp:793
XRefProperties::fromXml
bool fromXml(const QDomElement &xml_element) override
XRefProperties::fromXml Load from xml.
Definition: xrefproperties.cpp:133
QET::version
const QString version
QElectroTech version (as string, used to mark projects and elements XML documents)
Definition: qet.h:32
QETProject::projectFilePathChanged
void projectFilePathChanged(QETProject *, const QString &)
QETProject::m_project_qet_version
qreal m_project_qet_version
QElectroTech version declared in the XML document at opening time.
Definition: qetproject.h:232
QETProject::defaultTitleBlockPropertiesChanged
void defaultTitleBlockPropertiesChanged()
TitleBlockTemplatesCollection::changed
void changed(TitleBlockTemplatesCollection *, const QString &=QString())
DialogWaiting::setProgressBarRange
void setProgressBarRange(int min, int max)
DialogWaiting::setProgressBarRange.
Definition: dialogwaiting.cpp:66
TitleBlockProperties::collection
QET::QetCollection collection
Specify the location of the title block.
Definition: titleblockproperties.h:68
QETProject::projectOptionsWereModified
bool projectOptionsWereModified()
Definition: qetproject.cpp:1660
QETProject::addConductorAutoNum
void addConductorAutoNum(const QString &key, const NumerotationContext &context)
QETProject::addConductorAutoNum Add a new conductor numerotation context. If key already exist,...
Definition: qetproject.cpp:587
QETProject::usedTitleBlockTemplateChanged
void usedTitleBlockTemplateChanged(const QString &)
Definition: qetproject.cpp:1780
QETProject::setFreezeNewConductors
void setFreezeNewConductors(bool)
QETProject::setfreezeNewConductors Set Project Wide freeze new conductors.
Definition: qetproject.cpp:715
QETProject::updateDiagramsFolioData
void updateDiagramsFolioData()
Definition: qetproject.cpp:1705
XmlElementCollection::copy
ElementsLocation copy(ElementsLocation &source, ElementsLocation &destination, const QString &rename=QString(), bool deep_copy=true)
XmlElementCollection::copy Copy the content represented by source (an element or a directory) to dest...
Definition: xmlelementcollection.cpp:545
QETProject::m_auto_conductor
bool m_auto_conductor
Definition: qetproject.h:263
QETProject::m_conductor_autonum
QHash< QString, NumerotationContext > m_conductor_autonum
Conductor auto numerotation.
Definition: qetproject.h:256
QETProject::diagramRemoved
void diagramRemoved(QETProject *, Diagram *)
QETProject::freezeNewConductorLabel
void freezeNewConductorLabel(bool freeze, int from, int to)
QETProject::freezeNewConductorLabel Freeze New Conductors in the selected folios.
Definition: qetproject.cpp:697
QETProject::writeProjectPropertiesXml
void writeProjectPropertiesXml(QDomElement &)
Definition: qetproject.cpp:1498
QETProject::XmlParsingFailed
@ XmlParsingFailed
file opening failed
Definition: qetproject.h:58
QETProject::removeDiagramsTitleBlockTemplate
void removeDiagramsTitleBlockTemplate(TitleBlockTemplatesCollection *, const QString &)
Definition: qetproject.cpp:1767
QETProject::writeDefaultPropertiesXml
void writeDefaultPropertiesXml(QDomElement &)
QETProject::writeDefaultPropertiesXml Export all defaults properties used by a new diagram and his co...
Definition: qetproject.cpp:1512
QETProject::importElement
ElementsLocation importElement(ElementsLocation &location)
QETProject::importElement Import the element represented by location to the embbeded collection of th...
Definition: qetproject.cpp:972
XmlElementCollection
The XmlElementCollection class This class represent a collection of elements stored to xml.
Definition: xmlelementcollection.h:34
QETProject::autoFolio
bool autoFolio() const
QETApp::commonTitleBlockTemplatesCollection
static TitleBlockTemplatesFilesCollection * commonTitleBlockTemplatesCollection()
QETApp::commonTitleBlockTemplatesCollection.
Definition: qetapp.cpp:521
TitleBlockTemplatesCollection::aboutToRemove
void aboutToRemove(TitleBlockTemplatesCollection *, const QString &)
NumerotationContextCommands
The NumerotationContextCommands class this class provide methods to handle content of NumerotationCon...
Definition: numerotationcontextcommands.h:31
borderproperties.h
xmlelementcollection.h
ElementsLocation::uuid
QUuid uuid() const
ElementsLocation::uuid.
Definition: elementslocation.cpp:737
QETProject::readProjectXml
void readProjectXml(QDomDocument &xml_project)
QETProject::readProjectXml Read and make the project from an xml description.
Definition: qetproject.cpp:1226
QETProject::conductorAutoNumFormula
QString conductorAutoNumFormula(const QString &key) const
QETProject::conductorAutoNumFormula.
Definition: qetproject.cpp:548
QETProject::isEmpty
bool isEmpty() const
Definition: qetproject.cpp:950
TitleBlockProperties::fromXml
void fromXml(const QDomElement &)
Definition: titleblockproperties.cpp:105
QETProject::setCurrentConductorAutoNum
void setCurrentConductorAutoNum(QString autoNum)
QETProject::setCurrentConductorAutoNum.
Definition: qetproject.cpp:568
QETProject::defaultConductorProperties
ConductorProperties defaultConductorProperties() const
Definition: qetproject.cpp:454
XmlElementCollection::exist
bool exist(const QString &path) const
XmlElementCollection::exist Return true if the path path exist in this collection.
Definition: xmlelementcollection.cpp:569
DialogWaiting::setProgressBar
void setProgressBar(int val)
DialogWaiting::setProgressBar.
Definition: dialogwaiting.cpp:49
qetmessagebox.h
QETProject::ProjectParsingFailed
@ ProjectParsingFailed
the XML content is currently being processed
Definition: qetproject.h:60
QETProject::default_border_properties_
BorderProperties default_border_properties_
Default dimensions and properties for new diagrams created within the project.
Definition: qetproject.h:240
QETProject::elementCurrentAutoNum
QString elementCurrentAutoNum() const
QETProject::elementCurrentAutoNum.
Definition: qetproject.cpp:531
autonum::numerotationContextToFormula
QString numerotationContextToFormula(const NumerotationContext &nc)
numerotationContextToFormula
Definition: assignvariables.cpp:473
ElementsLocation::isFileSystem
bool isFileSystem() const
ElementsLocation::isFileSystem.
Definition: elementslocation.cpp:428
assignvariables.h
NumerotationContext
Definition: numerotationcontext.h:31
QET::findInDomElement
QList< QDomElement > findInDomElement(const QDomElement &, const QString &)
Definition: qet.cpp:333
QET::Managed
@ Managed
the current item was handled by the Strategy object: do not treat it and continue
Definition: qet.h:132
QETProject::setModified
void setModified(bool)
Definition: qetproject.cpp:1213
QET::Diagram
@ Diagram
Definition: qet.h:108
Diagram::border_and_titleblock
BorderTitleBlock border_and_titleblock
Diagram dimensions and title block.
Definition: diagram.h:83
Diagram::usedTitleBlockTemplateChanged
void usedTitleBlockTemplateChanged(const QString &)
qetapp.h
QETProject::m_undo_stack
QUndoStack * m_undo_stack
undo stack for this project
Definition: qetproject.h:254
QETProject::usesElement
bool usesElement(const ElementsLocation &) const
Definition: qetproject.cpp:1100
QETProject::embeddedTitleBlockTemplatesCollection
TitleBlockTemplatesProjectCollection * embeddedTitleBlockTemplatesCollection()
Definition: qetproject.cpp:243
QETProject::autoConductor
bool autoConductor
Definition: qetproject.h:64
QETProject::setReadOnly
void setReadOnly(bool)
QETProject::setReadOnly Set this project to read only if read_only = true.
Definition: qetproject.cpp:933
numerotationcontextcommands.h
ElementsLocation::isElement
bool isElement() const
ElementsLocation::isElement.
Definition: elementslocation.cpp:412
QETProject::default_conductor_properties_
ConductorProperties default_conductor_properties_
Default conductor properties for new diagrams created within the project.
Definition: qetproject.h:242
QETProject::m_titleblocks_collection
TitleBlockTemplatesProjectCollection m_titleblocks_collection
Embedded title block templates collection.
Definition: qetproject.h:250
QETProject::unusedElements
QList< ElementsLocation > unusedElements() const
QETProject::unusedElements.
Definition: qetproject.cpp:1117
QETProject::updateDiagramsTitleBlockTemplate
void updateDiagramsTitleBlockTemplate(TitleBlockTemplatesCollection *, const QString &)
Definition: qetproject.cpp:1754
QETProject::setTitle
void setTitle(const QString &)
Definition: qetproject.cpp:382
qetresult.h
NumerotationContextCommands::next
NumerotationContext next()
NumerotationContextCommands::next.
Definition: numerotationcontextcommands.cpp:41
QETProject::conductorAutoNumChanged
void conductorAutoNumChanged()
TitleBlockTemplate
The TitleBlockTemplate class This class represents an title block template for an electric diagram....
Definition: titleblocktemplate.h:36
reportproperties.h
TitleBlockTemplatesFilesCollection
Definition: templatescollection.h:124
QETProject::projectWasModified
bool projectWasModified()
Definition: qetproject.cpp:1690
XmlElementCollection::addElement
QString addElement(ElementsLocation &location)
XmlElementCollection::addElement Add the element at location to this collection. The element is copie...
Definition: xmlelementcollection.cpp:333
Diagram
The Diagram class This class represents an electric diagram. It manages its various child elements,...
Definition: diagram.h:56
ElementsLocation::parent
ElementsLocation parent() const
ElementsLocation::parent.
Definition: elementslocation.cpp:346
ReportProperties::defaultProperties
static QString defaultProperties()
ReportProperties::defaultProperties.
Definition: reportproperties.cpp:28
QETProject::diagramUsedTemplate
void diagramUsedTemplate(TitleBlockTemplatesCollection *, const QString &)
MoveTitleBlockTemplatesHandler
Definition: movetemplateshandler.h:30
QETProject::~QETProject
~QETProject() override
QETProject::~QETProject Destructor.
Definition: qetproject.cpp:114
QETProject::diagramAdded
void diagramAdded(QETProject *, Diagram *)
QETProject::conductorAutoNumRemoved
void conductorAutoNumRemoved()
XRefProperties
The XRefProperties class this class store properties used by XrefItem.
Definition: xrefproperties.h:29
QETProject::diagrams
QList< Diagram * > diagrams() const
Definition: qetproject.cpp:217
TitleBlockTemplateLocation::parentProject
QETProject * parentProject() const
Definition: templatelocation.cpp:116
QETProject::m_element_autonum
QHash< QString, NumerotationContext > m_element_autonum
Element Auto Numbering.
Definition: qetproject.h:261
TitleBlockProperties
Definition: titleblockproperties.h:29
QETProject::project_title_
QString project_title_
Project title.
Definition: qetproject.h:230
QETProject::readDefaultPropertiesXml
void readDefaultPropertiesXml(QDomDocument &xml_project)
QETProject::readDefaultPropertiesXml load default properties for new diagram, found in the xml of thi...
Definition: qetproject.cpp:1407
QETProject::isFreezeNewElements
bool isFreezeNewElements()
QETProject::freezeNewElements.
Definition: qetproject.cpp:749
TitleBlockProperties::toXml
void toXml(QDomElement &) const
Definition: titleblockproperties.cpp:76
xrefproperties.h
QETProject::setFilePath
void setFilePath(const QString &)
QETProject::setFilePath Set the filepath of this project file Set a file path also create a backup fi...
Definition: qetproject.cpp:262
BorderTitleBlock::needFolioData
void needFolioData()
needFolioData Signal emitted when the title block requires its data to be updated in order to generat...
QET::Rename
@ Rename
the target has to be renamed
Definition: qet.h:133
QETProject::writeBackup
void writeBackup()
QETProject::writeBackup Write a backup file of this project, in the case that QET crash.
Definition: qetproject.cpp:1647
BorderProperties::toXml
void toXml(QDomElement &) const
BorderProperties::toXml Exports dimensions as XML attributes added to element e.
Definition: borderproperties.cpp:98
QETProject::folioAutoNumAdded
void folioAutoNumAdded()
elementslocation.h
TitleBlockTemplateLocation
Definition: templatelocation.h:29
QETProject::usesTitleBlockTemplate
bool usesTitleBlockTemplate(const TitleBlockTemplateLocation &)
Definition: qetproject.cpp:1133
DialogWaiting
Definition: dialogwaiting.h:30
QETProject::m_backup_file
KAutoSaveFile m_backup_file
Definition: qetproject.h:269
QETApp::customTitleBlockTemplatesCollection
static TitleBlockTemplatesFilesCollection * customTitleBlockTemplatesCollection()
QETApp::customTitleBlockTemplatesCollection.
Definition: qetapp.cpp:541
QETProject::removeDiagram
void removeDiagram(Diagram *)
QETProject::removeDiagram Remove diagram from project.
Definition: qetproject.cpp:1173
QETProject::m_state
ProjectState m_state
Current state of the project.
Definition: qetproject.h:226
QETProject::addNewDiagram
Diagram * addNewDiagram(int pos=-1)
QETProject::addNewDiagram Add a new diagram in project at position pos.
Definition: qetproject.cpp:1151
QETProject::default_titleblock_properties_
TitleBlockProperties default_titleblock_properties_
Default title block properties for new diagrams created within the project.
Definition: qetproject.h:244
QETProject::m_current_element_autonum
QString m_current_element_autonum
Definition: qetproject.h:262
ElementsLocation::projectCollectionPath
QString projectCollectionPath() const
ElementsLocation::projectCollectionPath.
Definition: elementslocation.cpp:176
QETProject::setCurrrentElementAutonum
void setCurrrentElementAutonum(QString autoNum)
QETProject::setCurrrentElementAutonum.
Definition: qetproject.cpp:539
templatescollection.h
QETProject::filePath
QString filePath()
Definition: qetproject.cpp:250
ConductorProperties::fromXml
void fromXml(QDomElement &)
ConductorProperties::fromXml Import conductor propertie, from the attribute of the xml element 'e'.
Definition: conductorproperties.cpp:307
QETProject::folioAutoNumChanged
void folioAutoNumChanged(QString)
QETProject::setFreezeNewElements
void setFreezeNewElements(bool)
QETProject::setfreezeNewElements Set Project Wide freeze new elements.
Definition: qetproject.cpp:757
XmlElementCollection::root
QDomElement root() const
XmlElementCollection::root The root is the first DOM-Element the xml collection, the tag name of the ...
Definition: xmlelementcollection.cpp:110
QETProject::setDefaultTitleBlockProperties
void setDefaultTitleBlockProperties(const TitleBlockProperties &)
QETProject::setDefaultTitleBlockProperties Specify the title block to be used at the creation of a ne...
Definition: qetproject.cpp:425
QETProject::defaultXRefProperties
QHash< QString, XRefProperties > defaultXRefProperties() const
Definition: qetproject.h:107
TitleBlockProperties::defaultProperties
static TitleBlockProperties defaultProperties()
TitleBlockProperties::defaultProperties Return the default properties stored in the setting file.
Definition: titleblockproperties.cpp:182
QET::writeXmlFile
bool writeXmlFile(QDomDocument &xml_doc, const QString &filepath, QString *error_message=nullptr)
Definition: qet.cpp:584
numerotationcontext.h
ConductorProperties::toXml
void toXml(QDomElement &) const
ConductorProperties::toXml Export conductor propertie, in the XML element 'e'.
Definition: conductorproperties.cpp:264
DialogWaiting::hasInstance
static bool hasInstance()
Definition: dialogwaiting.h:46
BorderProperties::defaultProperties
static BorderProperties defaultProperties()
BorderProperties::defaultProperties.
Definition: borderproperties.cpp:169
QET::Abort
@ Abort
abort the whole operation, ignoring the curent item
Definition: qet.h:131
QETProject::isFreezeNewConductors
bool isFreezeNewConductors()
QETProject::isFreezeNewConductors.
Definition: qetproject.cpp:707
ImportElementDialog::action
QET::Action action() const
Definition: importelementdialog.cpp:35
ElementsLocation::isProject
bool isProject() const
ElementsLocation::isProject.
Definition: elementslocation.cpp:459
QETProject::reportPropertiesChanged
void reportPropertiesChanged(const QString &old_str, const QString &new_str)
QETProject::elementAutoNumAdded
void elementAutoNumAdded(QString name)
dialogwaiting.h
QETProject::conductorAutoNum
QHash< QString, NumerotationContext > conductorAutoNum() const
QETProject::conductorAutoNum.
Definition: qetproject.cpp:493
QETProject::m_default_xref_properties
QHash< QString, XRefProperties > m_default_xref_properties
Default xref properties.
Definition: qetproject.h:248
Diagram::defaultConductorProperties
ConductorProperties defaultConductorProperties
Default properties for new conductors.
Definition: diagram.h:81
QETProject::autoElement
bool autoElement() const
BorderProperties::fromXml
void fromXml(QDomElement &)
BorderProperties::fromXml Import dimensions from XML attributes of element e.
Definition: borderproperties.cpp:116
QETProject::setDefaultBorderProperties
void setDefaultBorderProperties(const BorderProperties &)
Definition: qetproject.cpp:408
qetproject.h
QETProject::read_only_file_path_
QString read_only_file_path_
Filepath for which this project is considered read only.
Definition: qetproject.h:238
QETProject::m_default_report_properties
QString m_default_report_properties
Default report properties.
Definition: qetproject.h:246
TitleBlockTemplatesProjectCollection::fromXml
virtual void fromXml(const QDomElement &)
Definition: templatescollection.cpp:323
conductorproperties.h
QETProject::freezeExistentElementLabel
void freezeExistentElementLabel(bool freeze, int from, int to)
QETProject::freezeExistentElementLabel Freeze Existent Elements in the selected folios.
Definition: qetproject.cpp:726
ElementsLocation::collectionPath
QString collectionPath(bool protocol=true) const
ElementsLocation::collectionPath Return the path of the represented element relative to collection if...
Definition: elementslocation.cpp:160
QETProject::m_save_backup_timer
QTimer m_save_backup_timer
Definition: qetproject.h:267
QETProject::FileOpenFailed
@ FileOpenFailed
no error
Definition: qetproject.h:57
ElementsLocation
The ElementsLocation class This class represents the location, the location of an element or of a cat...
Definition: elementslocation.h:46
QETProject::m_freeze_new_conductors
bool m_freeze_new_conductors
Definition: qetproject.h:266
QETProject::addDiagram
void addDiagram(Diagram *diagram, int pos=-1)
QETProject::addDiagram Add a diagram in this project.
Definition: qetproject.cpp:1591
QETProject::m_project_properties
DiagramContext m_project_properties
project-wide variables that will be made available to child diagrams
Definition: qetproject.h:252
projectDataBase::updateDB
void updateDB()
projectDataBase::updateDB Up to date the content of the data base. Emit the signal dataBaseUpdated
Definition: projectdatabase.cpp:61
QETProject::addFolioAutoNum
void addFolioAutoNum(const QString &key, const NumerotationContext &context)
QETProject::addFolioAutoNum Add a new folio numerotation context. If key already exist,...
Definition: qetproject.cpp:611
QETProject::readElementsCollectionXml
void readElementsCollectionXml(QDomDocument &xml_project)
QETProject::readElementsCollectionXml Load the diagrams from the xml description of the project.
Definition: qetproject.cpp:1369
DialogWaiting::instance
static DialogWaiting * instance(QWidget *parent=nullptr)
Definition: dialogwaiting.h:33
QETProject
Definition: qetproject.h:51
BorderTitleBlock::importTitleBlock
void importTitleBlock(const TitleBlockProperties &)
BorderTitleBlock::importTitleBlock.
Definition: bordertitleblock.cpp:304
QETResult
Definition: qetresult.h:26
NamesList
Definition: nameslist.h:30
QETProject::freezeNewElementLabel
void freezeNewElementLabel(bool freeze, int from, int to)
QETProject::freezeNewElementLabel Freeze New Elements in the selected folios.
Definition: qetproject.cpp:739
QETProject::m_elements_collection
XmlElementCollection * m_elements_collection
Definition: qetproject.h:264
QETProject::elementAutoNumCurrentFormula
QString elementAutoNumCurrentFormula() const
QETProject::elementAutoNumCurrentFormula.
Definition: qetproject.cpp:523
QETProject::pathNameTitle
QString pathNameTitle() const
Definition: qetproject.cpp:317
QETProject::write
QETResult write()
QETProject::write Save the project in a file.
Definition: qetproject.cpp:891
QETProject::QETProject
QETProject(QObject *parent=nullptr)
QETProject::QETProject Create a empty project.
Definition: qetproject.cpp:45
QETProject::m_freeze_new_elements
bool m_freeze_new_elements
Definition: qetproject.h:265
QET::Action
Action
Definition: qet.h:127
QETProject::uuid
QUuid uuid() const
QETProject::uuid.
Definition: qetproject.cpp:132
QET::Embedded
@ Embedded
From an embedded collection (a project for exemple)
Definition: qet.h:155
QETProject::setDefaultXRefProperties
void setDefaultXRefProperties(const QString &type, const XRefProperties &properties)
Definition: qetproject.cpp:478
QETProject::m_read_only
bool m_read_only
Whether the project is read only.
Definition: qetproject.h:236
QET::QetMessageBox::warning
QMessageBox::StandardButton warning(QWidget *, const QString &, const QString &, QMessageBox::StandardButtons=QMessageBox::Ok, QMessageBox::StandardButton=QMessageBox::NoButton)
Definition: qetmessagebox.cpp:68
QETProject::m_autosave_timer
QTimer m_autosave_timer
Definition: qetproject.h:268
DiagramContext::toXml
void toXml(QDomElement &, const QString &="property") const
Definition: diagramcontext.cpp:142
QET::Erase
@ Erase
Erase the target content.
Definition: qet.h:130
integrationmovetemplateshandler.h
Diagram::title
QString title() const
Diagram::title.
Definition: diagram.cpp:2023
ConductorProperties
The ConductorProperties class This class represents the functional properties of a particular conduct...
Definition: conductorproperties.h:68
QETProject::init
void init()
QETProject::init.
Definition: qetproject.cpp:139
QET::attributeIsAnInteger
bool attributeIsAnInteger(const QDomElement &, const QString &, int *=nullptr)
Definition: qet.cpp:210
QETProject::elementAutoNumRemoved
void elementAutoNumRemoved(QString name)
QETProject::freezeExistentConductorLabel
void freezeExistentConductorLabel(bool freeze, int from, int to)
QETProject::freezeExistentConductorLabel Freeze Existent Conductors in the selected folios.
Definition: qetproject.cpp:684
QETProject::readDiagramsXml
void readDiagramsXml(QDomDocument &xml_project)
QETProject::readDiagramsXml Load the diagrams from the xml description of the project....
Definition: qetproject.cpp:1292
ImportElementDialog
Definition: importelementdialog.h:29
TitleBlockTemplatesCollection
Definition: templatescollection.h:34
QET::writeToFile
bool writeToFile(QDomDocument &xml_doc, QFile *file, QString *error_message=nullptr)
Definition: qet.cpp:703
QETProject::folioAutoNum
QHash< QString, NumerotationContext > folioAutoNum() const
QETProject::folioAutoNum.
Definition: qetproject.cpp:576
TitleBlockProperties::template_name
QString template_name
Name of the template used to render the title block - an empty string means "the default template pro...
Definition: titleblockproperties.h:65
projectDataBase::removeDiagram
void removeDiagram(Diagram *diagram)
Definition: projectdatabase.cpp:179
Diagram::initFromXml
bool initFromXml(QDomElement &, QPointF=QPointF(), bool=true, DiagramContent *=nullptr)
Diagram::initFromXml Imports the described schema in an XML element. This method delegates its work t...
Definition: diagram.cpp:1067
ElementsLocation::project
QETProject * project() const
ElementsLocation::project.
Definition: elementslocation.cpp:365
DialogWaiting::setTitle
void setTitle(const QString &val)
DialogWaiting::setTitle of action.
Definition: dialogwaiting.cpp:75
projectDataBase
The projectDataBase class This class wrap a sqlite data base where you can find several thing about t...
Definition: projectdatabase.h:39
QETProject::QETProject
QETProject(const QETProject &)
QETProject::projectInformationsChanged
void projectInformationsChanged(QETProject *)
NumerotationContext::fromXml
void fromXml(QDomElement &)
NumerotationContext::fromXml load numerotation context from e.
Definition: numerotationcontext.cpp:172
QETProject::XRefPropertiesChanged
void XRefPropertiesChanged()
QETProject::m_data_base
projectDataBase m_data_base
Definition: qetproject.h:271
QETProject::diagramOrderChanged
void diagramOrderChanged(int, int)
Definition: qetproject.cpp:1198
XmlElementCollection::elementsLocation
QList< ElementsLocation > elementsLocation(QDomElement dom_element=QDomElement(), bool childs=true) const
XmlElementCollection::elementsLocation Return all locations stored in dom_element (element and direct...
Definition: xmlelementcollection.cpp:642
QETProject::setAutoElement
void setAutoElement(bool ae)
importelementdialog.h
QETProject::readProjectPropertiesXml
void readProjectPropertiesXml(QDomDocument &xml_project)
QETProject::readProjectPropertiesXml Load project properties from the XML description of the project.
Definition: qetproject.cpp:1395
QETProject::elementAutoNum
QHash< QString, NumerotationContext > elementAutoNum() const
QETProject::elementAutoNum.
Definition: qetproject.cpp:501
QETProject::defaultReportProperties
QString defaultReportProperties() const
Definition: qetproject.cpp:466
titleblocktemplate.h
autonum
Definition: assignvariables.cpp:30
QETProject::elementAutoNumFormula
QString elementAutoNumFormula(const QString &key) const
QETProject::elementAutoNumFormula.
Definition: qetproject.cpp:510
projectDataBase::addDiagram
void addDiagram(Diagram *diagram)
Definition: projectdatabase.cpp:150
QET::Common
@ Common
From common collection.
Definition: qet.h:153
QETProject::close
bool close()
Definition: qetproject.cpp:880
QETProject::FileOpenDiscard
@ FileOpenDiscard
the parsing of the XML content failed
Definition: qetproject.h:61
movetemplateshandler.h
QETProject::removeConductorAutoNum
void removeConductorAutoNum(const QString &key)
QETProject::removeConductorAutoNum Remove Conductor Numerotation Context stored with key.
Definition: qetproject.cpp:620
QETProject::state
ProjectState state() const
Definition: qetproject.cpp:210
QETProject::namesListForIntegrationCategory
NamesList namesListForIntegrationCategory()
Definition: qetproject.cpp:1617
QETProject::folioAutoNumRemoved
void folioAutoNumRemoved()
DialogWaiting::progressBarValue
int progressBarValue() const
DialogWaiting::progressBarValue.
Definition: dialogwaiting.cpp:91
BorderTitleBlock::importBorder
void importBorder(const BorderProperties &)
BorderTitleBlock::importBorder.
Definition: bordertitleblock.cpp:351
QETProject::Ok
@ Ok
Definition: qetproject.h:56
DiagramContext::addValue
bool addValue(const QString &, const QVariant &, bool show=true)
Definition: diagramcontext.cpp:91
QETProject::setDefaultReportProperties
void setDefaultReportProperties(const QString &properties)
Definition: qetproject.cpp:470
TitleBlockTemplatesProjectCollection
Definition: templatescollection.h:83
DialogWaiting::setDetail
void setDetail(const QString &val)
DialogWaiting::setDetail of action.
Definition: dialogwaiting.cpp:83
XRefProperties::defaultProperties
static QHash< QString, XRefProperties > defaultProperties()
XRefProperties::defaultProperties.
Definition: xrefproperties.cpp:165
QETProject::defaultXRefProperties
XRefProperties defaultXRefProperties(const QString &type) const
Definition: qetproject.h:106
QET::Icons::tr
QIcon tr
Definition: qeticons.cpp:206
projectdatabase.h
QETProject::removeFolioAutoNum
void removeFolioAutoNum(const QString &key)
QETProject::removeFolioAutonum Remove Folio Numerotation Context stored with key.
Definition: qetproject.cpp:640
QETProject::setDefaultConductorProperties
void setDefaultConductorProperties(const ConductorProperties &)
Definition: qetproject.cpp:462
QETProject::currentDir
QString currentDir() const
Definition: qetproject.cpp:298
QET::Retry
@ Retry
The operation must be tried again.
Definition: qet.h:128
QET::Icons::Cancel
QIcon Cancel
Definition: qeticons.cpp:34
DiagramContext
Definition: diagramcontext.h:56
diagram.h
QETProject::setAutoConductor
void setAutoConductor(bool ac)
QETProject::setAutoConductor.
Definition: qetproject.cpp:777
QETProject::conductorCurrentAutoNum
QString conductorCurrentAutoNum() const
QETProject::conductorCurrentAutoNum.
Definition: qetproject.cpp:560
QETProject::setProjectProperties
void setProjectProperties(const DiagramContext &)
Definition: qetproject.cpp:1676
TitleBlockTemplateLocation::name
QString name() const
Definition: templatelocation.cpp:73
QETProject::m_modified
bool m_modified
Whether options were modified.
Definition: qetproject.h:234
QETProject::declaredQElectroTechVersion
qreal declaredQElectroTechVersion()
Definition: qetproject.cpp:375
NumerotationContextCommands::toRepresentedString
QString toRepresentedString()
NumerotationContextCommands::toFinalString.
Definition: numerotationcontextcommands.cpp:71
QETProject::toXml
QDomDocument toXml()
QETProject::toXml.
Definition: qetproject.cpp:824
QETProject::m_folio_autonum
QHash< QString, NumerotationContext > m_folio_autonum
Folio auto numbering.
Definition: qetproject.h:259