mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 20:50:34 +01:00
Fix behavior :
In some condition, label of report element are not up to date. In some condition, the title of tabs widget of folios are not up to date git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4980 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -21,3 +21,6 @@ part terminal + 1106
|
||||
part text + 1107
|
||||
part text field + 1108
|
||||
part rectangle + 1109
|
||||
|
||||
###QetGraphicsHandlerItem###
|
||||
QetGraphicsHandlerItem = 1200
|
||||
|
||||
@@ -393,7 +393,7 @@ void ProjectView::addDiagram(DiagramView *diagram_view)
|
||||
m_diagram_view_list << diagram_view;
|
||||
|
||||
rebuildDiagramsMap();
|
||||
updateTabTitle(diagram_view);
|
||||
updateAllTabsTitle();
|
||||
|
||||
connect(diagram_view, SIGNAL(showDiagram(Diagram*)), this, SLOT(showDiagram(Diagram*)));
|
||||
connect(diagram_view, SIGNAL(titleChanged(DiagramView *, const QString &)), this, SLOT(updateTabTitle(DiagramView *)));
|
||||
@@ -406,15 +406,18 @@ void ProjectView::addDiagram(DiagramView *diagram_view)
|
||||
}
|
||||
|
||||
/**
|
||||
Enleve un schema du ProjectView
|
||||
@param diagram_view Schema a enlever
|
||||
*/
|
||||
void ProjectView::removeDiagram(DiagramView *diagram_view) {
|
||||
if (!diagram_view) return;
|
||||
if (m_project -> isReadOnly()) return;
|
||||
|
||||
// verifie que le schema est bien present dans le projet
|
||||
if (!m_diagram_ids.values().contains(diagram_view)) return;
|
||||
* @brief ProjectView::removeDiagram
|
||||
* Remove a diagram (folio) of the project
|
||||
* @param diagram_view : diagram view to remove
|
||||
*/
|
||||
void ProjectView::removeDiagram(DiagramView *diagram_view)
|
||||
{
|
||||
if (!diagram_view)
|
||||
return;
|
||||
if (m_project -> isReadOnly())
|
||||
return;
|
||||
if (!m_diagram_ids.values().contains(diagram_view))
|
||||
return;
|
||||
|
||||
|
||||
//Ask confirmation to user.
|
||||
@@ -429,21 +432,20 @@ void ProjectView::removeDiagram(DiagramView *diagram_view) {
|
||||
return;
|
||||
}
|
||||
|
||||
// enleve le DiagramView des onglets
|
||||
int diagram_tab_id = m_diagram_ids.key(diagram_view);
|
||||
m_tab -> removeTab(diagram_tab_id);
|
||||
//Remove the diagram view of the tabs widget
|
||||
int index_to_remove = m_diagram_ids.key(diagram_view);
|
||||
m_tab->removeTab(index_to_remove);
|
||||
m_diagram_view_list.removeAll(diagram_view);
|
||||
rebuildDiagramsMap();
|
||||
|
||||
// supprime le DiagramView, puis le Diagram
|
||||
m_project -> removeDiagram(diagram_view -> diagram());
|
||||
delete diagram_view;
|
||||
|
||||
// signale le retrait du schema
|
||||
emit(diagramRemoved(diagram_view));
|
||||
|
||||
// rend definitif le retrait du schema
|
||||
//Make definitve the withdrawal
|
||||
m_project -> write();
|
||||
updateAllTabsTitle();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -91,6 +91,7 @@ void ReportElement::linkToElement(Element * elmt)
|
||||
m_formula = diagram()->project()->defaultReportProperties();
|
||||
setConnectionForFormula(m_formula);
|
||||
connect(diagram()->project(), &QETProject::reportPropertiesChanged, this, &ReportElement::reportPropertiesChange);
|
||||
connect(diagram()->project(), &QETProject::diagramRemoved, this, &ReportElement::updateLabel);
|
||||
|
||||
if (elmt->terminals().size())
|
||||
{
|
||||
@@ -124,6 +125,7 @@ void ReportElement::unlinkAllElements()
|
||||
{
|
||||
removeConnectionForFormula(m_formula);
|
||||
disconnect(diagram()->project(), &QETProject::reportPropertiesChanged, this, &ReportElement::reportPropertiesChange);
|
||||
disconnect(diagram()->project(), &QETProject::diagramRemoved, this, &ReportElement::updateLabel);
|
||||
|
||||
if (elmt->terminals().size())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user