QElectroTech  0.8-dev
Signals | Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
projectDataBase Class Reference

The projectDataBase class This class wrap a sqlite data base where you can find several thing 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 More...
 
virtual ~projectDataBase () override
 projectDataBase::~projectDataBase Destructor More...
 
void updateDB ()
 projectDataBase::updateDB Up to date the content of the data base. Emit the signal dataBaseUpdated More...
 
QETProjectproject () const
 projectDataBase::project More...
 
QSqlQuery newQuery (const QString &query=QString())
 projectDataBase::newQuery More...
 
void addElement (Element *element)
 projectDataBase::addElement More...
 
void removeElement (Element *element)
 projectDataBase::removeElement More...
 
void elementInfoChanged (Element *element)
 projectDataBase::elementInfoChanged More...
 
void addDiagram (Diagram *diagram)
 
void removeDiagram (Diagram *diagram)
 

Static Public Member Functions

static void exportDb (projectDataBase *db, QWidget *parent=nullptr, const QString &caption=QString(), const QString &dir=QString())
 projectDataBase::exportDb More...
 

Private Member Functions

 projectDataBase (QETProject *project, const QString &connection_name, const QString &path, QObject *parent=nullptr)
 
bool createDataBase (const QString &connection_name=QString(), const QString &name=QString())
 projectDataBase::createDataBase Create the data base More...
 
void createElementNomenclatureView ()
 projectDataBase::createElementNomenclatureView More...
 
void createSummaryView ()
 projectDataBase::createSummaryView More...
 
void populateDiagramTable ()
 
void populateElementTable ()
 projectDataBase::populateElementTable Populate the element table More...
 
void populateElementInfoTable ()
 projectDataBase::populateElementsTable Populate the elements table More...
 
void populateDiagramInfoTable ()
 
void prepareQuery ()
 

Static Private Member Functions

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

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
 

Detailed Description

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

Note
this class is still in developement.

Constructor & Destructor Documentation

◆ projectDataBase() [1/2]

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() [2/2]

projectDataBase::projectDataBase ( QETProject project,
const QString &  connection_name,
const QString &  path,
QObject *  parent = nullptr 
)
private
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:

◆ createDataBase()

bool projectDataBase::createDataBase ( const QString &  connection_name = QString(),
const QString &  name = QString() 
)
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:

◆ elementInfoChanged()

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:

◆ 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:

◆ exportDb()

void projectDataBase::exportDb ( projectDataBase db,
QWidget *  parent = nullptr,
const QString &  caption = QString(),
const QString &  dir = QString() 
)
static

projectDataBase::exportDb

Parameters
db
parent
caption
dir
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::populateElementsTable Populate the elements 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_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_element_query

QSqlQuery projectDataBase::m_update_element_query
private

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