mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 20:50:34 +01:00
Update project database class
Add method : addDiagram and removeDiagram
This commit is contained in:
@@ -60,7 +60,7 @@ QColor Diagram::background_color = Qt::white;
|
||||
*/
|
||||
Diagram::Diagram(QETProject *project) :
|
||||
QGraphicsScene (project),
|
||||
m_project (nullptr),
|
||||
m_project (project),
|
||||
diagram_qet_version_ (-1),
|
||||
draw_grid_ (true),
|
||||
use_border_ (true),
|
||||
@@ -76,8 +76,7 @@ Diagram::Diagram(QETProject *project) :
|
||||
//https://stackoverflow.com/questions/38458830/crash-after-qgraphicssceneremoveitem-with-custom-item-class
|
||||
//http://www.qtcentre.org/archive/index.php/t-33730.html
|
||||
//http://tech-artists.org/t/qt-properly-removing-qgraphicitems/3063
|
||||
|
||||
setProject(project);
|
||||
|
||||
qgi_manager_ = new QGIManager(this);
|
||||
setBackgroundBrush(Qt::white);
|
||||
conductor_setter_ = new QGraphicsLineItem(nullptr);
|
||||
@@ -1836,20 +1835,6 @@ QETProject *Diagram::project() const {
|
||||
return(m_project);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Diagram::setProject
|
||||
* Set parent project of this diagram, project also become the parent QObject of this diagram
|
||||
* @param project new project
|
||||
*/
|
||||
void Diagram::setProject(QETProject *project)
|
||||
{
|
||||
if (m_project == project)
|
||||
return;
|
||||
|
||||
m_project = project;
|
||||
setParent (project);
|
||||
}
|
||||
|
||||
/**
|
||||
@return the folio number of this diagram within its parent project, or -1
|
||||
if it is has no parent project
|
||||
|
||||
Reference in New Issue
Block a user