QElectroTech  0.8-dev
Public Types | Public Slots | Signals | Public Member Functions | Properties | Private Slots | Private Member Functions | Private Attributes | List of all members
QETProject Class Reference

#include <qetproject.h>

Inherits QObject.

Collaboration diagram for QETProject:
Collaboration graph

Public Types

enum  ProjectState {
  Ok = 0, FileOpenFailed = 1, XmlParsingFailed = 2, ProjectParsingRunning = 3,
  ProjectParsingFailed = 4, FileOpenDiscard = 5
}
 

Public Slots

DiagramaddNewDiagram (int pos=-1)
 QETProject::addNewDiagram Add a new diagram in project at position pos. More...
 
void removeDiagram (Diagram *)
 QETProject::removeDiagram Remove diagram from project. More...
 
void diagramOrderChanged (int, int)
 
void setModified (bool)
 

Signals

void projectFilePathChanged (QETProject *, const QString &)
 
void projectTitleChanged (QETProject *, const QString &)
 
void projectInformationsChanged (QETProject *)
 
void diagramAdded (QETProject *, Diagram *)
 
void diagramRemoved (QETProject *, Diagram *)
 
void projectModified (QETProject *, bool)
 
void projectDiagramsOrderChanged (QETProject *, int, int)
 
void diagramUsedTemplate (TitleBlockTemplatesCollection *, const QString &)
 
void readOnlyChanged (QETProject *, bool)
 
void reportPropertiesChanged (const QString &old_str, const QString &new_str)
 
void XRefPropertiesChanged ()
 
void addAutoNumDiagram ()
 
void elementAutoNumAdded (QString name)
 
void elementAutoNumRemoved (QString name)
 
void conductorAutoNumAdded ()
 
void conductorAutoNumRemoved ()
 
void folioAutoNumAdded ()
 
void folioAutoNumRemoved ()
 
void folioAutoNumChanged (QString)
 
void defaultTitleBlockPropertiesChanged ()
 
void conductorAutoNumChanged ()
 

Public Member Functions

 QETProject (QObject *parent=nullptr)
 QETProject::QETProject Create a empty project. More...
 
 QETProject (const QString &path, QObject *=nullptr)
 QETProject::QETProject Construct a project from a .qet file. More...
 
 QETProject (KAutoSaveFile *backup, QObject *parent=nullptr)
 QETProject::QETProject. More...
 
 ~QETProject () override
 QETProject::~QETProject Destructor. More...
 
projectDataBasedataBase ()
 QETProject::dataBase. More...
 
QUuid uuid () const
 QETProject::uuid. More...
 
ProjectState state () const
 
QList< Diagram * > diagrams () const
 
int folioIndex (const Diagram *) const
 
XmlElementCollectionembeddedElementCollection () const
 QETProject::embeddedCollection. More...
 
TitleBlockTemplatesProjectCollectionembeddedTitleBlockTemplatesCollection ()
 
QString filePath ()
 
void setFilePath (const QString &)
 QETProject::setFilePath Set the filepath of this project file Set a file path also create a backup file according to the path. If a previous path was set, the previous backup file is deleted and a new one is created according to the path. More...
 
QString currentDir () const
 
QString pathNameTitle () const
 
QString title () const
 
qreal declaredQElectroTechVersion ()
 
void setTitle (const QString &)
 
BorderProperties defaultBorderProperties () const
 DEFAULT PROPERTIES. More...
 
void setDefaultBorderProperties (const BorderProperties &)
 
TitleBlockProperties defaultTitleBlockProperties () const
 
void setDefaultTitleBlockProperties (const TitleBlockProperties &)
 QETProject::setDefaultTitleBlockProperties Specify the title block to be used at the creation of a new diagram for this project. More...
 
ConductorProperties defaultConductorProperties () const
 
void setDefaultConductorProperties (const ConductorProperties &)
 
QString defaultReportProperties () const
 
void setDefaultReportProperties (const QString &properties)
 
XRefProperties defaultXRefProperties (const QString &type) const
 
QHash< QString, XRefPropertiesdefaultXRefProperties () const
 
void setDefaultXRefProperties (const QString &type, const XRefProperties &properties)
 
void setDefaultXRefProperties (QHash< QString, XRefProperties > hash)
 
QHash< QString, NumerotationContextconductorAutoNum () const
 QETProject::conductorAutoNum. More...
 
QHash< QString, NumerotationContextelementAutoNum () const
 QETProject::elementAutoNum. More...
 
QHash< QString, NumerotationContextfolioAutoNum () const
 QETProject::folioAutoNum. More...
 
void addConductorAutoNum (const QString &key, const NumerotationContext &context)
 QETProject::addConductorAutoNum Add a new conductor numerotation context. If key already exist, replace old context by the new context. More...
 
void addElementAutoNum (const QString &key, const NumerotationContext &context)
 QETProject::addElementAutoNum Add a new element numerotation context. If key already exist, replace old context by the new context. More...
 
void addFolioAutoNum (const QString &key, const NumerotationContext &context)
 QETProject::addFolioAutoNum Add a new folio numerotation context. If key already exist, replace old context by the new context. More...
 
void removeConductorAutoNum (const QString &key)
 QETProject::removeConductorAutoNum Remove Conductor Numerotation Context stored with key. More...
 
void removeElementAutoNum (const QString &key)
 QETProject::removeElementAutonum Remove Element Numerotation Context stored with key. More...
 
void removeFolioAutoNum (const QString &key)
 QETProject::removeFolioAutonum Remove Folio Numerotation Context stored with key. More...
 
NumerotationContext conductorAutoNum (const QString &key) const
 QETProject::conductorAutoNum Return conductor numerotation context stored with key. If key is not found, return an empty numerotation context. More...
 
NumerotationContext folioAutoNum (const QString &key) const
 QETProject::folioAutoNum Return folio numerotation context stored with key. If key is not found, return an empty numerotation context. More...
 
NumerotationContext elementAutoNum (const QString &key)
 QETProject::elementAutoNum Return element numerotation context stored with key. If key is not found, return an empty numerotation context. More...
 
QString conductorAutoNumFormula (const QString &key) const
 QETProject::conductorAutoNumFormula. More...
 
QString conductorCurrentAutoNum () const
 QETProject::conductorCurrentAutoNum. More...
 
void setCurrentConductorAutoNum (QString autoNum)
 QETProject::setCurrentConductorAutoNum. More...
 
QString elementAutoNumFormula (const QString &key) const
 QETProject::elementAutoNumFormula. More...
 
QString elementAutoNumCurrentFormula () const
 QETProject::elementAutoNumCurrentFormula. More...
 
QString elementCurrentAutoNum () const
 QETProject::elementCurrentAutoNum. More...
 
void setCurrrentElementAutonum (QString autoNum)
 QETProject::setCurrrentElementAutonum. More...
 
void freezeExistentElementLabel (bool freeze, int from, int to)
 QETProject::freezeExistentElementLabel Freeze Existent Elements in the selected folios. More...
 
void freezeNewElementLabel (bool freeze, int from, int to)
 QETProject::freezeNewElementLabel Freeze New Elements in the selected folios. More...
 
bool isFreezeNewElements ()
 QETProject::freezeNewElements. More...
 
void setFreezeNewElements (bool)
 QETProject::setfreezeNewElements Set Project Wide freeze new elements. More...
 
void freezeExistentConductorLabel (bool freeze, int from, int to)
 QETProject::freezeExistentConductorLabel Freeze Existent Conductors in the selected folios. More...
 
void freezeNewConductorLabel (bool freeze, int from, int to)
 QETProject::freezeNewConductorLabel Freeze New Conductors in the selected folios. More...
 
bool isFreezeNewConductors ()
 QETProject::isFreezeNewConductors. More...
 
void setFreezeNewConductors (bool)
 QETProject::setfreezeNewConductors Set Project Wide freeze new conductors. More...
 
bool autoConductor () const
 QETProject::autoConductor. More...
 
bool autoElement () const
 
bool autoFolio () const
 
void setAutoConductor (bool ac)
 QETProject::setAutoConductor. More...
 
void setAutoElement (bool ae)
 
void autoFolioNumberingNewFolios ()
 QETProject::autoFolioNumberingNewFolios emit Signal to add new Diagram with autonum properties. More...
 
void autoFolioNumberingSelectedFolios (int, int, const QString &)
 QETProject::autoFolioNumberingNewFolios. More...
 
QDomDocument toXml ()
 QETProject::toXml. More...
 
bool close ()
 
QETResult write ()
 QETProject::write Save the project in a file. More...
 
bool isReadOnly () const
 QETProject::isReadOnly. More...
 
void setReadOnly (bool)
 QETProject::setReadOnly Set this project to read only if read_only = true. More...
 
bool isEmpty () const
 
ElementsLocation importElement (ElementsLocation &location)
 QETProject::importElement Import the element represented by location to the embbeded collection of this project. More...
 
QString integrateTitleBlockTemplate (const TitleBlockTemplateLocation &, MoveTitleBlockTemplatesHandler *handler)
 QETProject::integrateTitleBlockTemplate Integrate a title block template into this project. More...
 
bool usesElement (const ElementsLocation &) const
 
QList< ElementsLocationunusedElements () const
 QETProject::unusedElements. More...
 
bool usesTitleBlockTemplate (const TitleBlockTemplateLocation &)
 
bool projectWasModified ()
 
bool projectOptionsWereModified ()
 
DiagramContext projectProperties ()
 
void setProjectProperties (const DiagramContext &)
 
QUndoStack * undoStack ()
 

Properties

bool autoConductor
 

Private Slots

void updateDiagramsFolioData ()
 
void updateDiagramsTitleBlockTemplate (TitleBlockTemplatesCollection *, const QString &)
 
void removeDiagramsTitleBlockTemplate (TitleBlockTemplatesCollection *, const QString &)
 
void usedTitleBlockTemplateChanged (const QString &)
 
void undoStackChanged (bool a)
 

Private Member Functions

 QETProject (const QETProject &)
 
void readProjectXml (QDomDocument &xml_project)
 QETProject::readProjectXml Read and make the project from an xml description. More...
 
void readDiagramsXml (QDomDocument &xml_project)
 QETProject::readDiagramsXml Load the diagrams from the xml description of the project. Note a project can have 0 diagram. More...
 
void readElementsCollectionXml (QDomDocument &xml_project)
 QETProject::readElementsCollectionXml Load the diagrams from the xml description of the project. More...
 
void readProjectPropertiesXml (QDomDocument &xml_project)
 QETProject::readProjectPropertiesXml Load project properties from the XML description of the project. More...
 
void readDefaultPropertiesXml (QDomDocument &xml_project)
 QETProject::readDefaultPropertiesXml load default properties for new diagram, found in the xml of this project or by default find in the QElectroTech global conf. More...
 
void writeProjectPropertiesXml (QDomElement &)
 
void writeDefaultPropertiesXml (QDomElement &)
 QETProject::writeDefaultPropertiesXml Export all defaults properties used by a new diagram and his content size of border content of titleblock default conductor defaut folio report default Xref. More...
 
void addDiagram (Diagram *diagram, int pos=-1)
 QETProject::addDiagram Add a diagram in this project. More...
 
NamesList namesListForIntegrationCategory ()
 
void writeBackup ()
 QETProject::writeBackup Write a backup file of this project, in the case that QET crash. More...
 
void init ()
 QETProject::init. More...
 
ProjectState openFile (QFile *file)
 QETProject::openFile. More...
 

Private Attributes

QString m_file_path
 File path this project is saved to. More...
 
ProjectState m_state
 Current state of the project. More...
 
QList< Diagram * > m_diagrams_list
 Diagrams carried by the project. More...
 
QString project_title_
 Project title. More...
 
qreal m_project_qet_version = -1
 QElectroTech version declared in the XML document at opening time. More...
 
bool m_modified = false
 Whether options were modified. More...
 
bool m_read_only = false
 Whether the project is read only. More...
 
QString read_only_file_path_
 Filepath for which this project is considered read only. More...
 
BorderProperties default_border_properties_ = BorderProperties::defaultProperties()
 Default dimensions and properties for new diagrams created within the project. More...
 
ConductorProperties default_conductor_properties_ = ConductorProperties::defaultProperties()
 Default conductor properties for new diagrams created within the project. More...
 
TitleBlockProperties default_titleblock_properties_
 Default title block properties for new diagrams created within the project. More...
 
QString m_default_report_properties = ReportProperties::defaultProperties()
 Default report properties. More...
 
QHash< QString, XRefPropertiesm_default_xref_properties = XRefProperties::defaultProperties()
 Default xref properties. More...
 
TitleBlockTemplatesProjectCollection m_titleblocks_collection
 Embedded title block templates collection. More...
 
DiagramContext m_project_properties
 project-wide variables that will be made available to child diagrams More...
 
QUndoStack * m_undo_stack
 undo stack for this project More...
 
QHash< QString, NumerotationContextm_conductor_autonum
 Conductor auto numerotation. More...
 
QString m_current_conductor_autonum
 
QHash< QString, NumerotationContextm_folio_autonum
 Folio auto numbering. More...
 
QHash< QString, NumerotationContextm_element_autonum
 Element Auto Numbering. More...
 
QString m_current_element_autonum
 
bool m_auto_conductor = true
 
XmlElementCollectionm_elements_collection = nullptr
 
bool m_freeze_new_elements = false
 
bool m_freeze_new_conductors = false
 
QTimer m_save_backup_timer
 
QTimer m_autosave_timer
 
KAutoSaveFile m_backup_file
 
QUuid m_uuid = QUuid::createUuid()
 
projectDataBase m_data_base
 

Detailed Description

This class represents a QET project. Typically saved as a .qet file, it consists in an XML document grouping 0 to n diagrams and embedding an elements collection. This collection enables users to export diagrams on remote machines without wondering whether required elements are available to them.

Member Enumeration Documentation

◆ ProjectState

Enumerator
Ok 
FileOpenFailed 

no error

XmlParsingFailed 

file opening failed

ProjectParsingRunning 

XML parsing failed.

ProjectParsingFailed 

the XML content is currently being processed

FileOpenDiscard 

the parsing of the XML content failed

Constructor & Destructor Documentation

◆ QETProject() [1/4]

QETProject::QETProject ( QObject *  parent = nullptr)

QETProject::QETProject Create a empty project.

Parameters
parent
Here is the call graph for this function:

◆ QETProject() [2/4]

QETProject::QETProject ( const QString &  path,
QObject *  parent = nullptr 
)

QETProject::QETProject Construct a project from a .qet file.

Parameters
path: path of the file
parent: parent QObject
Here is the call graph for this function:

◆ QETProject() [3/4]

QETProject::QETProject ( KAutoSaveFile *  backup,
QObject *  parent = nullptr 
)

QETProject::QETProject.

Parameters
backup: backup file to open, QETProject take ownership of backup.
parent: parent QObject
Here is the call graph for this function:

◆ ~QETProject()

QETProject::~QETProject ( )
override

◆ QETProject() [4/4]

QETProject::QETProject ( const QETProject )
private

Member Function Documentation

◆ addAutoNumDiagram

void QETProject::addAutoNumDiagram ( )
signal
Here is the caller graph for this function:

◆ addConductorAutoNum()

void QETProject::addConductorAutoNum ( const QString &  key,
const NumerotationContext context 
)

QETProject::addConductorAutoNum Add a new conductor numerotation context. If key already exist, replace old context by the new context.

Parameters
key
context
Here is the caller graph for this function:

◆ addDiagram()

void QETProject::addDiagram ( Diagram diagram,
int  pos = -1 
)
private

QETProject::addDiagram Add a diagram in this project.

Parameters
diagramadded diagram
pospostion of the new diagram, by default at the end
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addElementAutoNum()

void QETProject::addElementAutoNum ( const QString &  key,
const NumerotationContext context 
)

QETProject::addElementAutoNum Add a new element numerotation context. If key already exist, replace old context by the new context.

Parameters
key
context
Here is the caller graph for this function:

◆ addFolioAutoNum()

void QETProject::addFolioAutoNum ( const QString &  key,
const NumerotationContext context 
)

QETProject::addFolioAutoNum Add a new folio numerotation context. If key already exist, replace old context by the new context.

Parameters
key
context
Here is the caller graph for this function:

◆ addNewDiagram

Diagram * QETProject::addNewDiagram ( int  pos = -1)
slot

QETProject::addNewDiagram Add a new diagram in project at position pos.

Parameters
pos
Returns
the new created diagram
Here is the call graph for this function:
Here is the caller graph for this function:

◆ autoConductor()

bool QETProject::autoConductor ( ) const

QETProject::autoConductor.

Returns
true if use of auto conductor is authorized. See also Q_PROPERTY autoConductor

◆ autoElement()

bool QETProject::autoElement ( ) const

◆ autoFolio()

bool QETProject::autoFolio ( ) const

◆ autoFolioNumberingNewFolios()

void QETProject::autoFolioNumberingNewFolios ( )

QETProject::autoFolioNumberingNewFolios emit Signal to add new Diagram with autonum properties.

Here is the caller graph for this function:

◆ autoFolioNumberingSelectedFolios()

void QETProject::autoFolioNumberingSelectedFolios ( int  from,
int  to,
const QString &  autonum 
)

QETProject::autoFolioNumberingNewFolios.

Parameters
from
to
autonum: used, index from selected tabs "from" and "to" rename folios with selected autonum
Here is the call graph for this function:
Here is the caller graph for this function:

◆ close()

bool QETProject::close ( )

Ferme le projet

◆ conductorAutoNum() [1/2]

QHash< QString, NumerotationContext > QETProject::conductorAutoNum ( ) const

QETProject::conductorAutoNum.

Returns
All value of conductor autonum stored in project
Here is the caller graph for this function:

◆ conductorAutoNum() [2/2]

NumerotationContext QETProject::conductorAutoNum ( const QString &  key) const

QETProject::conductorAutoNum Return conductor numerotation context stored with key. If key is not found, return an empty numerotation context.

Parameters
key

◆ conductorAutoNumAdded

void QETProject::conductorAutoNumAdded ( )
signal
Here is the caller graph for this function:

◆ conductorAutoNumChanged

void QETProject::conductorAutoNumChanged ( )
signal
Here is the caller graph for this function:

◆ conductorAutoNumFormula()

QString QETProject::conductorAutoNumFormula ( const QString &  key) const

QETProject::conductorAutoNumFormula.

Parameters
key: autonum title
Returns
Formula of element autonum stored in conductor autonum
Here is the call graph for this function:
Here is the caller graph for this function:

◆ conductorAutoNumRemoved

void QETProject::conductorAutoNumRemoved ( )
signal
Here is the caller graph for this function:

◆ conductorCurrentAutoNum()

QString QETProject::conductorCurrentAutoNum ( ) const

QETProject::conductorCurrentAutoNum.

Returns
current conductor autonum title
Here is the caller graph for this function:

◆ currentDir()

QString QETProject::currentDir ( ) const
Returns
le dossier contenant le fichier projet si celui-ci a ete enregistre ; dans le cas contraire, cette methode retourne l'emplacement du bureau de l'utilisateur.

◆ dataBase()

projectDataBase * QETProject::dataBase ( )

QETProject::dataBase.

Returns
The data base of this project
Here is the caller graph for this function:

◆ declaredQElectroTechVersion()

qreal QETProject::declaredQElectroTechVersion ( )
Returns
la version de QElectroTech declaree dans le fichier projet lorsque celui-ci a ete ouvert ; si ce projet n'a jamais ete enregistre / ouvert depuis un fichier, cette methode retourne -1.

◆ defaultBorderProperties()

BorderProperties QETProject::defaultBorderProperties ( ) const

DEFAULT PROPERTIES.

Returns
les dimensions par defaut utilisees lors de la creation d'un nouveau schema dans ce projet.
Here is the caller graph for this function:

◆ defaultConductorProperties()

ConductorProperties QETProject::defaultConductorProperties ( ) const
Returns
le type de conducteur par defaut utilise lors de la creation d'un nouveau schema dans ce projet.
Here is the caller graph for this function:

◆ defaultReportProperties()

QString QETProject::defaultReportProperties ( ) const
Here is the caller graph for this function:

◆ defaultTitleBlockProperties()

TitleBlockProperties QETProject::defaultTitleBlockProperties ( ) const
Returns
le cartouche par defaut utilise lors de la creation d'un nouveau schema dans ce projet.
Here is the caller graph for this function:

◆ defaultTitleBlockPropertiesChanged

void QETProject::defaultTitleBlockPropertiesChanged ( )
signal
Here is the caller graph for this function:

◆ defaultXRefProperties() [1/2]

QHash<QString, XRefProperties> QETProject::defaultXRefProperties ( ) const
inline
Here is the caller graph for this function:

◆ defaultXRefProperties() [2/2]

XRefProperties QETProject::defaultXRefProperties ( const QString &  type) const
inline
Here is the caller graph for this function:

◆ diagramAdded

void QETProject::diagramAdded ( QETProject ,
Diagram  
)
signal
Here is the caller graph for this function:

◆ diagramOrderChanged

void QETProject::diagramOrderChanged ( int  old_index,
int  new_index 
)
slot

Gere le fait que l'ordre des schemas ait change

Parameters
old_indexancien indice du schema deplace
new_indexnouvel indice du schema deplace Si l'ancien ou le nouvel index est negatif ou superieur au nombre de schemas dans le projet, cette methode ne fait rien. Les index vont de 0 a "nombre de schemas - 1"
Here is the call graph for this function:
Here is the caller graph for this function:

◆ diagramRemoved

void QETProject::diagramRemoved ( QETProject ,
Diagram  
)
signal
Here is the caller graph for this function:

◆ diagrams()

QList< Diagram * > QETProject::diagrams ( ) const
Returns
la liste des schemas de ce projet
Here is the caller graph for this function:

◆ diagramUsedTemplate

void QETProject::diagramUsedTemplate ( TitleBlockTemplatesCollection ,
const QString &   
)
signal
Here is the caller graph for this function:

◆ elementAutoNum() [1/2]

QHash< QString, NumerotationContext > QETProject::elementAutoNum ( ) const

QETProject::elementAutoNum.

Returns
All value of element autonum stored in project
Here is the caller graph for this function:

◆ elementAutoNum() [2/2]

NumerotationContext QETProject::elementAutoNum ( const QString &  key)

QETProject::elementAutoNum Return element numerotation context stored with key. If key is not found, return an empty numerotation context.

Parameters
key

◆ elementAutoNumAdded

void QETProject::elementAutoNumAdded ( QString  name)
signal
Here is the caller graph for this function:

◆ elementAutoNumCurrentFormula()

QString QETProject::elementAutoNumCurrentFormula ( ) const

QETProject::elementAutoNumCurrentFormula.

Returns
current formula being used by project
Here is the call graph for this function:
Here is the caller graph for this function:

◆ elementAutoNumFormula()

QString QETProject::elementAutoNumFormula ( const QString &  key) const

QETProject::elementAutoNumFormula.

Parameters
key: autonum title
Returns
Formula of element autonum stored in element autonum
Here is the call graph for this function:
Here is the caller graph for this function:

◆ elementAutoNumRemoved

void QETProject::elementAutoNumRemoved ( QString  name)
signal
Here is the caller graph for this function:

◆ elementCurrentAutoNum()

QString QETProject::elementCurrentAutoNum ( ) const

QETProject::elementCurrentAutoNum.

Returns
current element autonum title
Here is the caller graph for this function:

◆ embeddedElementCollection()

XmlElementCollection * QETProject::embeddedElementCollection ( ) const

QETProject::embeddedCollection.

Returns
The embedded collection
Here is the caller graph for this function:

◆ embeddedTitleBlockTemplatesCollection()

TitleBlockTemplatesProjectCollection * QETProject::embeddedTitleBlockTemplatesCollection ( )
Returns
the title block templates collection enbeedded within this project
Here is the caller graph for this function:

◆ filePath()

QString QETProject::filePath ( )
Returns
le chemin du fichier dans lequel ce projet est enregistre
Here is the caller graph for this function:

◆ folioAutoNum() [1/2]

QHash< QString, NumerotationContext > QETProject::folioAutoNum ( ) const

QETProject::folioAutoNum.

Returns
All value of folio autonum stored in project
Here is the caller graph for this function:

◆ folioAutoNum() [2/2]

NumerotationContext QETProject::folioAutoNum ( const QString &  key) const

QETProject::folioAutoNum Return folio numerotation context stored with key. If key is not found, return an empty numerotation context.

Parameters
key

◆ folioAutoNumAdded

void QETProject::folioAutoNumAdded ( )
signal
Here is the caller graph for this function:

◆ folioAutoNumChanged

void QETProject::folioAutoNumChanged ( QString  )
signal

◆ folioAutoNumRemoved

void QETProject::folioAutoNumRemoved ( )
signal
Here is the caller graph for this function:

◆ folioIndex()

int QETProject::folioIndex ( const Diagram diagram) const
Parameters
diagramPointer to a Diagram object
Returns
the folio number of the given diagram object within the project, or -1 if it is not part of this project. Note: this returns 0 for the first diagram, not 1
Here is the caller graph for this function:

◆ freezeExistentConductorLabel()

void QETProject::freezeExistentConductorLabel ( bool  freeze,
int  from,
int  to 
)

QETProject::freezeExistentConductorLabel Freeze Existent Conductors in the selected folios.

Parameters
freeze
from- first folio index to apply freeze
to- last folio index to apply freeze
Here is the caller graph for this function:

◆ freezeExistentElementLabel()

void QETProject::freezeExistentElementLabel ( bool  freeze,
int  from,
int  to 
)

QETProject::freezeExistentElementLabel Freeze Existent Elements in the selected folios.

Parameters
freeze
from- first folio index to apply freeze
to- last folio index to apply freeze
Here is the caller graph for this function:

◆ freezeNewConductorLabel()

void QETProject::freezeNewConductorLabel ( bool  freeze,
int  from,
int  to 
)

QETProject::freezeNewConductorLabel Freeze New Conductors in the selected folios.

Parameters
freeze
from- first folio index to apply freeze
to- last folio index to apply freeze
Here is the caller graph for this function:

◆ freezeNewElementLabel()

void QETProject::freezeNewElementLabel ( bool  freeze,
int  from,
int  to 
)

QETProject::freezeNewElementLabel Freeze New Elements in the selected folios.

Parameters
freeze
from- first folio index to apply freeze
to- last folio index to apply freeze
Here is the caller graph for this function:

◆ importElement()

ElementsLocation QETProject::importElement ( ElementsLocation location)

QETProject::importElement Import the element represented by location to the embbeded collection of this project.

Parameters
location
Returns
the location of the imported element, location can be null.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ init()

void QETProject::init ( )
private

QETProject::init.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ integrateTitleBlockTemplate()

QString QETProject::integrateTitleBlockTemplate ( const TitleBlockTemplateLocation src_tbt,
MoveTitleBlockTemplatesHandler handler 
)

QETProject::integrateTitleBlockTemplate Integrate a title block template into this project.

Parameters
src_tbtThe location of the title block template to be integrated into this project
handler
Returns
the name of the template after integration, or an empty QString if a problem occurred.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isEmpty()

bool QETProject::isEmpty ( ) const
Returns
true si le projet peut etre considere comme vide, c'est-a-dire :
  • soit avec une collection embarquee vide
  • soit avec uniquement des schemas consideres comme vides
  • soit avec un titre de projet

◆ isFreezeNewConductors()

bool QETProject::isFreezeNewConductors ( )

QETProject::isFreezeNewConductors.

Returns
freeze new conductors Project Wide status
Here is the caller graph for this function:

◆ isFreezeNewElements()

bool QETProject::isFreezeNewElements ( )

QETProject::freezeNewElements.

Returns
freeze new elements Project Wide status

◆ isReadOnly()

bool QETProject::isReadOnly ( ) const

QETProject::isReadOnly.

Returns
true si le projet est en mode readonly, false sinon
Here is the caller graph for this function:

◆ namesListForIntegrationCategory()

NamesList QETProject::namesListForIntegrationCategory ( )
private
Returns
La liste des noms a utiliser pour la categorie dediee aux elements integres automatiquement dans le projet.
Here is the call graph for this function:

◆ openFile()

QETProject::ProjectState QETProject::openFile ( QFile *  file)
private

QETProject::openFile.

Parameters
file
Returns
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pathNameTitle()

QString QETProject::pathNameTitle ( ) const
Returns
une chaine de caractere du type "Projet titre du projet". Si le projet n'a pas de titre, le nom du fichier est utilise. Si le projet n'est pas associe a un fichier, cette methode retourne "Projet sans titre". De plus, si le projet est en lecture seule, le tag "[lecture seule]" est ajoute.
Here is the call graph for this function:

◆ projectDiagramsOrderChanged

void QETProject::projectDiagramsOrderChanged ( QETProject ,
int  ,
int   
)
signal
Here is the caller graph for this function:

◆ projectFilePathChanged

void QETProject::projectFilePathChanged ( QETProject ,
const QString &   
)
signal
Here is the caller graph for this function:

◆ projectInformationsChanged

void QETProject::projectInformationsChanged ( QETProject )
signal
Here is the caller graph for this function:

◆ projectModified

void QETProject::projectModified ( QETProject ,
bool   
)
signal
Here is the caller graph for this function:

◆ projectOptionsWereModified()

bool QETProject::projectOptionsWereModified ( )
Returns
true if project options (title, project-wide properties, settings for new diagrams, diagrams order...) were modified, false otherwise.
Here is the caller graph for this function:

◆ projectProperties()

DiagramContext QETProject::projectProperties ( )
Returns
the project-wide properties made available to child diagrams.
Here is the caller graph for this function:

◆ projectTitleChanged

void QETProject::projectTitleChanged ( QETProject ,
const QString &   
)
signal
Here is the caller graph for this function:

◆ projectWasModified()

bool QETProject::projectWasModified ( )

Cette methode sert a reperer un projet vide, c-a-d un projet identique a ce que l'on obtient en faisant Fichier > Nouveau.

Returns
true si les schemas, la collection embarquee ou les proprietes de ce projet ont ete modifies. Concretement, le projet doit avoir un titre vide et ni ses schemas ni sa collection embarquee ne doivent avoir ete modifies.
See also
diagramsWereModified(), embeddedCollectionWasModified()
Here is the call graph for this function:

◆ readDefaultPropertiesXml()

void QETProject::readDefaultPropertiesXml ( QDomDocument &  xml_project)
private

QETProject::readDefaultPropertiesXml load default properties for new diagram, found in the xml of this project or by default find in the QElectroTech global conf.

Parameters
xml_project: the xml description of the project
Here is the call graph for this function:
Here is the caller graph for this function:

◆ readDiagramsXml()

void QETProject::readDiagramsXml ( QDomDocument &  xml_project)
private

QETProject::readDiagramsXml Load the diagrams from the xml description of the project. Note a project can have 0 diagram.

Parameters
xml_project
Here is the call graph for this function:
Here is the caller graph for this function:

◆ readElementsCollectionXml()

void QETProject::readElementsCollectionXml ( QDomDocument &  xml_project)
private

QETProject::readElementsCollectionXml Load the diagrams from the xml description of the project.

Parameters
xml_project: the xml description of the project
Here is the caller graph for this function:

◆ readOnlyChanged

void QETProject::readOnlyChanged ( QETProject ,
bool   
)
signal
Here is the caller graph for this function:

◆ readProjectPropertiesXml()

void QETProject::readProjectPropertiesXml ( QDomDocument &  xml_project)
private

QETProject::readProjectPropertiesXml Load project properties from the XML description of the project.

Parameters
xml_project: the xml description of the project
Here is the call graph for this function:
Here is the caller graph for this function:

◆ readProjectXml()

void QETProject::readProjectXml ( QDomDocument &  xml_project)
private

QETProject::readProjectXml Read and make the project from an xml description.

Parameters
xml_project: the description of the project from an xml
Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeConductorAutoNum()

void QETProject::removeConductorAutoNum ( const QString &  key)

QETProject::removeConductorAutoNum Remove Conductor Numerotation Context stored with key.

Parameters
key

◆ removeDiagram

void QETProject::removeDiagram ( Diagram diagram)
slot

QETProject::removeDiagram Remove diagram from project.

Parameters
diagram
Here is the call graph for this function:

◆ removeDiagramsTitleBlockTemplate

void QETProject::removeDiagramsTitleBlockTemplate ( TitleBlockTemplatesCollection collection,
const QString &  template_name 
)
privateslot

Inform each diagram that the template_name title block is about to be removed.

Parameters
collectionTitle block templates collection
template_nameName of the removed template
Here is the caller graph for this function:

◆ removeElementAutoNum()

void QETProject::removeElementAutoNum ( const QString &  key)

QETProject::removeElementAutonum Remove Element Numerotation Context stored with key.

Parameters
key
Here is the caller graph for this function:

◆ removeFolioAutoNum()

void QETProject::removeFolioAutoNum ( const QString &  key)

QETProject::removeFolioAutonum Remove Folio Numerotation Context stored with key.

Parameters
key

◆ reportPropertiesChanged

void QETProject::reportPropertiesChanged ( const QString &  old_str,
const QString &  new_str 
)
signal
Here is the caller graph for this function:

◆ setAutoConductor()

void QETProject::setAutoConductor ( bool  ac)

QETProject::setAutoConductor.

Parameters
acEnable the use of auto conductor if true See also Q_PROPERTY autoConductor

◆ setAutoElement()

void QETProject::setAutoElement ( bool  ae)

◆ setCurrentConductorAutoNum()

void QETProject::setCurrentConductorAutoNum ( QString  autoNum)

QETProject::setCurrentConductorAutoNum.

Parameters
autoNumset the current conductor autonum to autonum
Here is the caller graph for this function:

◆ setCurrrentElementAutonum()

void QETProject::setCurrrentElementAutonum ( QString  autoNum)

QETProject::setCurrrentElementAutonum.

Parameters
autoNum: set the current element autonum to autonum
Here is the caller graph for this function:

◆ setDefaultBorderProperties()

void QETProject::setDefaultBorderProperties ( const BorderProperties border)

Permet de specifier les dimensions par defaut utilisees lors de la creation d'un nouveau schema dans ce projet.

Parameters
borderdimensions d'un schema

◆ setDefaultConductorProperties()

void QETProject::setDefaultConductorProperties ( const ConductorProperties conductor)

Permet de specifier e type de conducteur par defaut utilise lors de la creation d'un nouveau schema dans ce projet.

◆ setDefaultReportProperties()

void QETProject::setDefaultReportProperties ( const QString &  properties)
Here is the caller graph for this function:

◆ setDefaultTitleBlockProperties()

void QETProject::setDefaultTitleBlockProperties ( const TitleBlockProperties titleblock)

QETProject::setDefaultTitleBlockProperties Specify the title block to be used at the creation of a new diagram for this project.

Parameters
titleblock
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setDefaultXRefProperties() [1/2]

void QETProject::setDefaultXRefProperties ( const QString &  type,
const XRefProperties properties 
)

◆ setDefaultXRefProperties() [2/2]

void QETProject::setDefaultXRefProperties ( QHash< QString, XRefProperties hash)

◆ setFilePath()

void QETProject::setFilePath ( const QString &  filepath)

QETProject::setFilePath Set the filepath of this project file Set a file path also create a backup file according to the path. If a previous path was set, the previous backup file is deleted and a new one is created according to the path.

Parameters
filepath
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setFreezeNewConductors()

void QETProject::setFreezeNewConductors ( bool  set)

QETProject::setfreezeNewConductors Set Project Wide freeze new conductors.

Here is the caller graph for this function:

◆ setFreezeNewElements()

void QETProject::setFreezeNewElements ( bool  set)

QETProject::setfreezeNewElements Set Project Wide freeze new elements.

Here is the caller graph for this function:

◆ setModified

void QETProject::setModified ( bool  modified)
slot

Mark this project as modified and emit the projectModified() signal.

Here is the caller graph for this function:

◆ setProjectProperties()

void QETProject::setProjectProperties ( const DiagramContext context)

Use context as project-wide properties made available to child diagrams.

Here is the call graph for this function:

◆ setReadOnly()

void QETProject::setReadOnly ( bool  read_only)

QETProject::setReadOnly Set this project to read only if read_only = true.

Parameters
read_only
Here is the caller graph for this function:

◆ setTitle()

void QETProject::setTitle ( const QString &  title)
Parameters
titlele nouveau titre du projet
Here is the call graph for this function:
Here is the caller graph for this function:

◆ state()

QETProject::ProjectState QETProject::state ( ) const

Cette methode peut etre utilisee pour tester la bonne ouverture d'un projet

Returns
l'etat du projet
See also
ProjectState
Here is the caller graph for this function:

◆ title()

QString QETProject::title ( ) const
Returns
le titre du projet
Here is the caller graph for this function:

◆ toXml()

QDomDocument QETProject::toXml ( )

QETProject::toXml.

Returns
un document XML representant le projet
Here is the call graph for this function:
Here is the caller graph for this function:

◆ undoStack()

QUndoStack* QETProject::undoStack ( )
inline
Here is the caller graph for this function:

◆ undoStackChanged

void QETProject::undoStackChanged ( bool  a)
inlineprivateslot
Here is the call graph for this function:
Here is the caller graph for this function:

◆ unusedElements()

QList< ElementsLocation > QETProject::unusedElements ( ) const

QETProject::unusedElements.

Returns
the list of unused element (exactly her location) An unused element, is an element present in the embedded collection but not present in a diagram of this project. Be aware that an element can be not present in a diagram, but managed by an undo command (delete an element), so an unused element can be used after an undo.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateDiagramsFolioData

void QETProject::updateDiagramsFolioData ( )
privateslot

Indique a chaque schema du projet quel est son numero de folio et combien de folio le projet contient.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateDiagramsTitleBlockTemplate

void QETProject::updateDiagramsTitleBlockTemplate ( TitleBlockTemplatesCollection collection,
const QString &  template_name 
)
privateslot

Inform each diagram that the template_name title block changed.

Parameters
collectionTitle block templates collection
template_nameName of the changed template
Here is the caller graph for this function:

◆ usedTitleBlockTemplateChanged

void QETProject::usedTitleBlockTemplateChanged ( const QString &  template_name)
privateslot

Handles the fact a digram changed the title block template it used

Parameters
template_nameName of the template
Here is the call graph for this function:
Here is the caller graph for this function:

◆ usesElement()

bool QETProject::usesElement ( const ElementsLocation location) const

Permet de savoir si un element est utilise dans un projet

Parameters
locationEmplacement d'un element
Returns
true si l'element location est utilise sur au moins un des schemas de ce projet, false sinon
Here is the call graph for this function:
Here is the caller graph for this function:

◆ usesTitleBlockTemplate()

bool QETProject::usesTitleBlockTemplate ( const TitleBlockTemplateLocation location)
Parameters
locationLocation of a title block template
Returns
true if the provided template is used by at least one diagram within this project, false otherwise
Here is the call graph for this function:

◆ uuid()

QUuid QETProject::uuid ( ) const

QETProject::uuid.

Returns
the uuid of this project
Here is the caller graph for this function:

◆ write()

QETResult QETProject::write ( )

QETProject::write Save the project in a file.

See also
filePath()
setFilePath()
Returns
true if the project was successfully saved, else false
Here is the call graph for this function:

◆ writeBackup()

void QETProject::writeBackup ( )
private

QETProject::writeBackup Write a backup file of this project, in the case that QET crash.

Here is the call graph for this function:

◆ writeDefaultPropertiesXml()

void QETProject::writeDefaultPropertiesXml ( QDomElement &  xml_element)
private

QETProject::writeDefaultPropertiesXml Export all defaults properties used by a new diagram and his content size of border content of titleblock default conductor defaut folio report default Xref.

Parameters
xml_element: xml element to use for store default propertie.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeProjectPropertiesXml()

void QETProject::writeProjectPropertiesXml ( QDomElement &  xml_element)
private

Export project properties under the xml_element XML element.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ XRefPropertiesChanged

void QETProject::XRefPropertiesChanged ( )
signal
Here is the caller graph for this function:

Member Data Documentation

◆ default_border_properties_

BorderProperties QETProject::default_border_properties_ = BorderProperties::defaultProperties()
private

Default dimensions and properties for new diagrams created within the project.

◆ default_conductor_properties_

ConductorProperties QETProject::default_conductor_properties_ = ConductorProperties::defaultProperties()
private

Default conductor properties for new diagrams created within the project.

◆ default_titleblock_properties_

TitleBlockProperties QETProject::default_titleblock_properties_
private

Default title block properties for new diagrams created within the project.

◆ m_auto_conductor

bool QETProject::m_auto_conductor = true
private

◆ m_autosave_timer

QTimer QETProject::m_autosave_timer
private

◆ m_backup_file

KAutoSaveFile QETProject::m_backup_file
private

◆ m_conductor_autonum

QHash<QString, NumerotationContext> QETProject::m_conductor_autonum
private

Conductor auto numerotation.

◆ m_current_conductor_autonum

QString QETProject::m_current_conductor_autonum
private

◆ m_current_element_autonum

QString QETProject::m_current_element_autonum
private

◆ m_data_base

projectDataBase QETProject::m_data_base
private

◆ m_default_report_properties

QString QETProject::m_default_report_properties = ReportProperties::defaultProperties()
private

Default report properties.

◆ m_default_xref_properties

QHash<QString, XRefProperties> QETProject::m_default_xref_properties = XRefProperties::defaultProperties()
private

Default xref properties.

◆ m_diagrams_list

QList<Diagram *> QETProject::m_diagrams_list
private

Diagrams carried by the project.

◆ m_element_autonum

QHash<QString, NumerotationContext> QETProject::m_element_autonum
private

Element Auto Numbering.

◆ m_elements_collection

XmlElementCollection* QETProject::m_elements_collection = nullptr
private

◆ m_file_path

QString QETProject::m_file_path
private

File path this project is saved to.

◆ m_folio_autonum

QHash<QString, NumerotationContext> QETProject::m_folio_autonum
private

Folio auto numbering.

◆ m_freeze_new_conductors

bool QETProject::m_freeze_new_conductors = false
private

◆ m_freeze_new_elements

bool QETProject::m_freeze_new_elements = false
private

◆ m_modified

bool QETProject::m_modified = false
private

Whether options were modified.

◆ m_project_properties

DiagramContext QETProject::m_project_properties
private

project-wide variables that will be made available to child diagrams

◆ m_project_qet_version

qreal QETProject::m_project_qet_version = -1
private

QElectroTech version declared in the XML document at opening time.

◆ m_read_only

bool QETProject::m_read_only = false
private

Whether the project is read only.

◆ m_save_backup_timer

QTimer QETProject::m_save_backup_timer
private

◆ m_state

ProjectState QETProject::m_state
private

Current state of the project.

◆ m_titleblocks_collection

TitleBlockTemplatesProjectCollection QETProject::m_titleblocks_collection
private

Embedded title block templates collection.

◆ m_undo_stack

QUndoStack* QETProject::m_undo_stack
private

undo stack for this project

◆ m_uuid

QUuid QETProject::m_uuid = QUuid::createUuid()
private

◆ project_title_

QString QETProject::project_title_
private

Project title.

◆ read_only_file_path_

QString QETProject::read_only_file_path_
private

Filepath for which this project is considered read only.

Property Documentation

◆ autoConductor

bool QETProject::autoConductor
readwrite

The documentation for this class was generated from the following files: