QElectroTech 0.100.0-dev
Loading...
Searching...
No Matches
Signals | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
projectDataBase Class Reference

The projectDataBase class This class wraps a sqlite data base where you can find several things about the content of a project. More...

#include <projectdatabase.h>

Inherits QObject.

Collaboration diagram for projectDataBase:
Collaboration graph

Signals

void dataBaseUpdated ()
 

Public Member Functions

 projectDataBase (QETProject *project, QObject *parent=nullptr)
 projectDataBase::projectDataBase Default constructor
 
virtual ~projectDataBase () override
 projectDataBase::~projectDataBase Destructor
 
void updateDB ()
 projectDataBase::updateDB Up to date the content of the data base. Emit the signal dataBaseUpdated
 
QETProjectproject () const
 projectDataBase::project
 
QSqlQuery newQuery (const QString &query=QString())
 projectDataBase::newQuery
 
void addElement (Element *element)
 projectDataBase::addElement
 
void removeElement (Element *element)
 projectDataBase::removeElement
 
void elementInfoChanged (Element *element)
 projectDataBase::elementInfoChanged
 
void elementInfoChanged (QList< Element * > elements)
 
void addDiagram (Diagram *diagram)
 
void removeDiagram (Diagram *diagram)
 
void diagramInfoChanged (Diagram *diagram)
 
void diagramOrderChanged ()
 

Private Member Functions

bool createDataBase ()
 projectDataBase::createDataBase Create the data base
 
void createElementNomenclatureView ()
 projectDataBase::createElementNomenclatureView
 
void createSummaryView ()
 projectDataBase::createSummaryView
 
void populateDiagramTable ()
 
void populateElementTable ()
 projectDataBase::populateElementTable Populate the element table
 
void populateElementInfoTable ()
 projectDataBase::populateElementInfoTable Populate the element info table
 
void populateDiagramInfoTable ()
 
void prepareQuery ()
 
void bindDiagramInfoValues (QSqlQuery &query, Diagram *diagram)
 

Static Private Member Functions

static QHash< QString, QString > elementInfoToString (Element *elmt)
 projectDataBase::elementInfoToString
 

Private Attributes

QPointer< QETProjectm_project
 
QSqlDatabase m_data_base
 
QSqlQuery m_insert_elements_query
 
QSqlQuery m_insert_element_info_query
 
QSqlQuery m_remove_element_query
 
QSqlQuery m_update_element_query
 
QSqlQuery m_insert_diagram_query
 
QSqlQuery m_remove_diagram_query
 
QSqlQuery m_insert_diagram_info_query
 
QSqlQuery m_update_diagram_info_query
 
QSqlQuery m_diagram_order_changed
 
QSqlQuery m_diagram_info_order_changed
 

Detailed Description

The projectDataBase class This class wraps a sqlite data base where you can find several things about the content of a project.

Note
this class is still in development.

Constructor & Destructor Documentation

◆ projectDataBase()

projectDataBase::projectDataBase ( QETProject project,
QObject *  parent = nullptr 
)

projectDataBase::projectDataBase Default constructor

Parameters
project: project from the database work
parent: parent QObject
Here is the call graph for this function:

◆ ~projectDataBase()

projectDataBase::~projectDataBase ( )
overridevirtual

Member Function Documentation

◆ addDiagram()

void projectDataBase::addDiagram ( Diagram diagram)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addElement()

void projectDataBase::addElement ( Element element)

projectDataBase::addElement

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

◆ bindDiagramInfoValues()

void projectDataBase::bindDiagramInfoValues ( QSqlQuery &  query,
Diagram diagram 
)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createDataBase()

bool projectDataBase::createDataBase ( )
private

projectDataBase::createDataBase Create the data base

Returns
: true if the data base was successfully created.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createElementNomenclatureView()

void projectDataBase::createElementNomenclatureView ( )
private

projectDataBase::createElementNomenclatureView

Here is the caller graph for this function:

◆ createSummaryView()

void projectDataBase::createSummaryView ( )
private

projectDataBase::createSummaryView

Here is the caller graph for this function:

◆ dataBaseUpdated

void projectDataBase::dataBaseUpdated ( )
signal
Here is the caller graph for this function:

◆ diagramInfoChanged()

void projectDataBase::diagramInfoChanged ( Diagram diagram)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ diagramOrderChanged()

void projectDataBase::diagramOrderChanged ( )

◆ elementInfoChanged() [1/2]

void projectDataBase::elementInfoChanged ( Element element)

projectDataBase::elementInfoChanged

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

◆ elementInfoChanged() [2/2]

void projectDataBase::elementInfoChanged ( QList< Element * >  elements)
Here is the call graph for this function:

◆ elementInfoToString()

QHash< QString, QString > projectDataBase::elementInfoToString ( Element elmt)
staticprivate

projectDataBase::elementInfoToString

Parameters
elmt
Returns
the element information in hash as key for the info name and value as the information value.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ newQuery()

QSqlQuery projectDataBase::newQuery ( const QString &  query = QString())

projectDataBase::newQuery

Returns
a QSqlquery with query as query and the internal database of this class as database to use.
Here is the caller graph for this function:

◆ populateDiagramInfoTable()

void projectDataBase::populateDiagramInfoTable ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ populateDiagramTable()

void projectDataBase::populateDiagramTable ( )
private
Here is the caller graph for this function:

◆ populateElementInfoTable()

void projectDataBase::populateElementInfoTable ( )
private

projectDataBase::populateElementInfoTable Populate the element info table

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

◆ populateElementTable()

void projectDataBase::populateElementTable ( )
private

projectDataBase::populateElementTable Populate the element table

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

◆ prepareQuery()

void projectDataBase::prepareQuery ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ project()

QETProject * projectDataBase::project ( ) const

projectDataBase::project

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

◆ removeDiagram()

void projectDataBase::removeDiagram ( Diagram diagram)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeElement()

void projectDataBase::removeElement ( Element element)

projectDataBase::removeElement

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

◆ updateDB()

void projectDataBase::updateDB ( )

projectDataBase::updateDB Up to date the content of the data base. Emit the signal dataBaseUpdated

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

Member Data Documentation

◆ m_data_base

QSqlDatabase projectDataBase::m_data_base
private

◆ m_diagram_info_order_changed

QSqlQuery projectDataBase::m_diagram_info_order_changed
private

◆ m_diagram_order_changed

QSqlQuery projectDataBase::m_diagram_order_changed
private

◆ m_insert_diagram_info_query

QSqlQuery projectDataBase::m_insert_diagram_info_query
private

◆ m_insert_diagram_query

QSqlQuery projectDataBase::m_insert_diagram_query
private

◆ m_insert_element_info_query

QSqlQuery projectDataBase::m_insert_element_info_query
private

◆ m_insert_elements_query

QSqlQuery projectDataBase::m_insert_elements_query
private

◆ m_project

QPointer<QETProject> projectDataBase::m_project
private

◆ m_remove_diagram_query

QSqlQuery projectDataBase::m_remove_diagram_query
private

◆ m_remove_element_query

QSqlQuery projectDataBase::m_remove_element_query
private

◆ m_update_diagram_info_query

QSqlQuery projectDataBase::m_update_diagram_info_query
private

◆ m_update_element_query

QSqlQuery projectDataBase::m_update_element_query
private

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