QElectroTech
0.70
|
#include <projectview.h>
Signals | |
void | diagramAdded (DiagramView *) |
void | diagramRemoved (DiagramView *) |
void | diagramActivated (DiagramView *) |
void | projectClosed (ProjectView *) |
void | errorEncountered (const QString &) |
void | findElementRequired (const ElementsLocation &) |
void | editElementRequired (const ElementsLocation &) |
Public Member Functions | |
ProjectView (QETProject *, QWidget *=nullptr) | |
~ProjectView () override | |
QETProject * | project () |
void | setProject (QETProject *) |
QList< DiagramView * > | diagram_views () const |
DiagramView * | currentDiagram () const |
ProjectView::currentDiagram. More... | |
void | closeEvent (QCloseEvent *) override |
void | changeTabUp () |
change current diagramview to previous tab More... | |
void | changeTabDown () |
change current diagramview to next folio More... | |
void | changeFirstTab () |
change current diagramview to first tab More... | |
void | changeLastTab () |
change current diagramview to last tab More... | |
Private Slots | |
void | tabChanged (int) |
ProjectView::tabChanged Manage the tab change. If tab_id == -1 (there is no diagram opened), we display the fallback widget. More... | |
void | tabDoubleClicked (int) |
void | setDisplayFallbackWidget (bool) |
void | adjustReadOnlyState () |
Private Member Functions | |
ProjectView (const ProjectView &) | |
void | initActions () |
void | initWidgets () |
void | initLayout () |
void | loadDiagrams () |
ProjectView::loadDiagrams Load diagrams of project. We create a diagram view for each diagram, and add it to the project view. More... | |
DiagramView * | findDiagram (Diagram *) |
DiagramView * | nextDiagram () |
DiagramView * | previousDiagram () |
DiagramView * | firstDiagram () |
DiagramView * | lastDiagram () |
void | rebuildDiagramsMap () |
bool | tryClosing () |
bool | tryClosingElementEditors () |
int | tryClosingDiagrams () |
ProjectView::tryClosingDiagrams try to close this project, if diagram or project option are changed a dialog ask if user want to save the modification. More... | |
QString | askUserForFilePath (bool=true) |
QETResult | noProjectResult () const |
Private Attributes | |
QAction * | add_new_diagram_ |
QETProject * | m_project |
QVBoxLayout * | layout_ |
QWidget * | fallback_widget_ |
QLabel * | fallback_label_ |
QTabWidget * | m_tab |
QMap< int, DiagramView * > | m_diagram_ids |
int | m_previous_tab_index = -1 |
QList< DiagramView * > | m_diagram_view_list |
This class provides a widget displaying the diagrams of a particular project using tabs.
Definition at line 38 of file projectview.h.
ProjectView::ProjectView | ( | QETProject * | project, |
QWidget * | parent = nullptr |
||
) |
Constructeur
project | projet a visualiser |
parent | Widget parent |
Definition at line 43 of file projectview.cpp.
References initActions(), initLayout(), initWidgets(), project(), and setProject().
|
override |
Destructeur Supprime les DiagramView embarquees
Definition at line 58 of file projectview.cpp.
References m_diagram_ids.
|
private |
|
slot |
ProjectView::addDiagram Add diagram view to this project view.
diagram_view |
Definition at line 381 of file projectview.cpp.
References QET::Icons::Diagram, diagramAdded(), editElementRequired(), findElementRequired(), m_diagram_ids, m_diagram_view_list, m_project, m_tab, rebuildDiagramsMap(), showDiagram(), BorderTitleBlock::titleBlockFolioChanged(), updateAllTabsTitle(), and updateTabTitle().
Referenced by addNewDiagram(), addNewDiagramFolioList(), and loadDiagrams().
|
slot |
ProjectView::addNewDiagram Add new diagram to project view.
Definition at line 347 of file projectview.cpp.
References addDiagram(), addNewDiagramFolioList(), m_project, and showDiagram().
Referenced by initActions(), and setProject().
|
slot |
ProjectView::addNewDiagramFolioList Add new diagram folio list to project.
Definition at line 363 of file projectview.cpp.
References addDiagram(), diagram_views(), m_project, m_tab, and showDiagram().
Referenced by addNewDiagram().
|
privateslot |
Effectue les actions necessaires lorsque le projet visualise entre ou sort du mode lecture seule.
Definition at line 908 of file projectview.cpp.
References add_new_diagram_, m_project, m_tab, and updateWindowTitle().
Referenced by setProject().
|
private |
Ask the user to provide a file path in which the currently edited project will be saved.
assign | When true, assign the provided filepath to the project through setFilePath(). Defaults to true. |
Definition at line 311 of file projectview.cpp.
References m_project, and QET::Icons::tr.
Referenced by saveAs(), and tryClosing().
void ProjectView::changeFirstTab | ( | ) |
change current diagramview to first tab
Definition at line 186 of file projectview.cpp.
References firstDiagram(), and m_tab.
Referenced by DiagramView::keyPressEvent().
void ProjectView::changeLastTab | ( | ) |
change current diagramview to last tab
Definition at line 171 of file projectview.cpp.
References lastDiagram(), and m_tab.
Referenced by DiagramView::keyPressEvent().
void ProjectView::changeTabDown | ( | ) |
change current diagramview to next folio
Definition at line 125 of file projectview.cpp.
References m_tab, nextDiagram(), and rebuildDiagramsMap().
Referenced by DiagramView::keyPressEvent().
void ProjectView::changeTabUp | ( | ) |
change current diagramview to previous tab
Definition at line 148 of file projectview.cpp.
References m_tab, previousDiagram(), and rebuildDiagramsMap().
Referenced by DiagramView::keyPressEvent().
|
slot |
Allow the user to clean the project, which includes: deleting unused title block templates deleting unused elements deleting empty categories
Definition at line 728 of file projectview.cpp.
References QET::Icons::Cancel, XmlElementCollection::cleanUnusedDirectory(), XmlElementCollection::cleanUnusedElement(), QET::QetMessageBox::critical(), TitleBlockTemplatesProjectCollection::deleteUnusedTitleBlocKTemplates(), QETProject::embeddedElementCollection(), QETProject::embeddedTitleBlockTemplatesCollection(), m_project, and QET::Icons::tr.
|
override |
Gere la fermeture du schema.
qce | Le QCloseEvent decrivant l'evenement |
Definition at line 112 of file projectview.cpp.
References projectClosed(), and tryClosing().
DiagramView * ProjectView::currentDiagram | ( | ) | const |
Definition at line 101 of file projectview.cpp.
References m_diagram_ids, and m_tab.
Referenced by editCurrentDiagramProperties(), loadDiagrams(), AutoNumberingDockWidget::on_m_conductor_cb_activated(), AutoNumberingDockWidget::on_m_element_cb_activated(), AutoNumberingDockWidget::setActive(), and AutoNumberingDockWidget::setProject().
QList< DiagramView * > ProjectView::diagram_views | ( | ) | const |
Definition at line 93 of file projectview.cpp.
References m_diagram_view_list.
Referenced by addNewDiagramFolioList(), findDiagram(), loadDiagrams(), and moveDiagramUpTop().
|
signal |
Referenced by tabChanged().
|
signal |
Referenced by addDiagram().
|
signal |
Referenced by removeDiagram().
|
slot |
Save project content, then write the project file. May call saveAs if no filepath was provided before.
Definition at line 703 of file projectview.cpp.
References m_project, noProjectResult(), project(), saveAs(), QETProject::undoStack(), and updateWindowTitle().
|
slot |
Edite les proprietes du schema courant
Definition at line 500 of file projectview.cpp.
References currentDiagram(), and editDiagramProperties().
|
slot |
Edite les proprietes du schema diagram_view
Definition at line 507 of file projectview.cpp.
References showDiagram().
Referenced by editCurrentDiagramProperties(), editDiagramProperties(), and tabDoubleClicked().
|
slot |
Edite les proprietes du schema diagram
Definition at line 516 of file projectview.cpp.
References editDiagramProperties(), and findDiagram().
|
signal |
Referenced by addDiagram(), and QETDiagramEditor::addProjectView().
|
slot |
Enable the user to edit properties of the current project through a configuration dialog.
Definition at line 491 of file projectview.cpp.
References ProjectPropertiesDialog::exec(), and m_project.
|
signal |
Referenced by tryClosing().
|
slot |
|
private |
diagram | Schema a trouver |
Definition at line 985 of file projectview.cpp.
References diagram_views().
Referenced by editDiagramProperties(), moveDiagramDown(), moveDiagramDownx10(), moveDiagramUp(), moveDiagramUpTop(), moveDiagramUpx10(), removeDiagram(), and showDiagram().
|
signal |
Referenced by addDiagram(), and QETDiagramEditor::addProjectView().
|
private |
Definition at line 194 of file projectview.cpp.
References m_diagram_ids.
Referenced by changeFirstTab().
|
private |
Initialize actions for this widget.
Definition at line 788 of file projectview.cpp.
References add_new_diagram_, QET::Icons::AddFolio, addNewDiagram(), and QET::Icons::tr.
Referenced by ProjectView().
|
private |
Initialize layout for this widget.
Definition at line 830 of file projectview.cpp.
References fallback_label_, fallback_widget_, layout_, and m_tab.
Referenced by ProjectView().
|
private |
Initialize child widgets for this widget.
Definition at line 796 of file projectview.cpp.
References add_new_diagram_, fallback_label_, fallback_widget_, m_tab, QET::Icons::ProjectFileGP, tabChanged(), tabDoubleClicked(), tabMoved(), and QET::Icons::tr.
Referenced by ProjectView().
|
private |
Definition at line 179 of file projectview.cpp.
References m_diagram_ids.
Referenced by changeLastTab().
|
private |
ProjectView::loadDiagrams Load diagrams of project. We create a diagram view for each diagram, and add it to the project view.
Definition at line 852 of file projectview.cpp.
References addDiagram(), currentDiagram(), DiagramView::diagram(), diagram_views(), QETProject::diagrams(), QETProject::getFolioSheetsQuantity(), DialogWaiting::hasInstance(), DialogWaiting::instance(), Diagram::loadCndFolioSeq(), Diagram::loadElmtFolioSeq(), m_project, m_tab, DialogWaiting::progressBarValue(), DialogWaiting::setDetail(), setDisplayFallbackWidget(), QETProject::setModified(), DialogWaiting::setProgressBar(), DialogWaiting::setTitle(), and QET::Icons::tr.
Referenced by setProject().
|
slot |
Deplace le schema diagram_view vers le bas / la droite
Definition at line 544 of file projectview.cpp.
References m_diagram_ids, and m_tab.
Referenced by moveDiagramDown().
|
slot |
Deplace le schema diagram vers le bas / la droite
Definition at line 558 of file projectview.cpp.
References findDiagram(), and moveDiagramDown().
|
slot |
Deplace le schema diagram_view vers le bas / la droite x10
Definition at line 609 of file projectview.cpp.
References m_diagram_ids, and m_tab.
Referenced by moveDiagramDownx10().
|
slot |
Deplace le schema diagram vers le bas / la droite x10
Definition at line 623 of file projectview.cpp.
References findDiagram(), and moveDiagramDownx10().
|
slot |
Deplace le schema diagram_view vers le haut / la gauche
Definition at line 523 of file projectview.cpp.
References m_diagram_ids, and m_tab.
Referenced by moveDiagramUp().
|
slot |
Deplace le schema diagram vers le haut / la gauche
Definition at line 537 of file projectview.cpp.
References findDiagram(), and moveDiagramUp().
|
slot |
Definition at line 565 of file projectview.cpp.
References diagram_views(), m_diagram_ids, and m_tab.
Referenced by moveDiagramUpTop().
|
slot |
Definition at line 580 of file projectview.cpp.
References findDiagram(), and moveDiagramUpTop().
|
slot |
Deplace le schema diagram_view vers le haut / la gauche x10
Definition at line 588 of file projectview.cpp.
References m_diagram_ids, and m_tab.
Referenced by moveDiagramUpx10().
|
slot |
Deplace le schema diagram vers le haut / la gauche x10
Definition at line 602 of file projectview.cpp.
References findDiagram(), and moveDiagramUpx10().
|
private |
Definition at line 136 of file projectview.cpp.
References m_diagram_ids, and m_tab.
Referenced by changeTabDown().
|
private |
Definition at line 338 of file projectview.cpp.
References QET::Icons::tr.
|
private |
Definition at line 159 of file projectview.cpp.
References m_diagram_ids, and m_tab.
Referenced by changeTabUp().
|
slot |
Ce slot demarre un dialogue permettant a l'utilisateur de parametrer et de lancer l'impression de toute ou partie du projet.
Definition at line 631 of file projectview.cpp.
References DiagramPrintDialog::exec(), m_project, DiagramPrintDialog::setDocName(), DiagramPrintDialog::setFileName(), QET::stringToFileName(), and QET::Icons::tr.
QETProject * ProjectView::project | ( | ) |
Definition at line 69 of file projectview.cpp.
References m_project.
Referenced by QETDiagramEditor::currentProject(), doSave(), QETDiagramEditor::generateTerminalBlock(), ProjectView(), setProject(), QETDiagramEditor::setUpActions(), and tryClosingDiagrams().
|
signal |
Referenced by closeEvent().
|
private |
Reconstruit la map associant les index des onglets avec les DiagramView
Definition at line 997 of file projectview.cpp.
References m_diagram_ids, m_diagram_view_list, and m_tab.
Referenced by addDiagram(), changeTabDown(), changeTabUp(), removeDiagram(), and tabMoved().
|
slot |
ProjectView::removeDiagram Remove a diagram (folio) of the project.
diagram_view | : diagram view to remove |
Definition at line 415 of file projectview.cpp.
References QET::Icons::Cancel, diagramRemoved(), m_diagram_ids, m_diagram_view_list, m_project, m_tab, QET::QetMessageBox::question(), rebuildDiagramsMap(), QET::Icons::tr, and updateAllTabsTitle().
Referenced by removeDiagram().
|
slot |
Enleve un schema du ProjectView
diagram | Schema a enlever |
Definition at line 459 of file projectview.cpp.
References findDiagram(), and removeDiagram().
|
slot |
Save project properties along with all modified diagrams.
Definition at line 677 of file projectview.cpp.
References doSave().
|
slot |
Ask users for a filepath in order to save the project.
options | May be used to specify what should be saved; defaults to all modified diagrams. |
Definition at line 688 of file projectview.cpp.
References askUserForFilePath(), doSave(), m_project, and noProjectResult().
Referenced by doSave().
|
privateslot |
fallback | true pour afficher le widget de fallback, false pour afficher les onglets. Le widget de Fallback est le widget affiche lorsque le projet ne comporte aucun schema. |
Definition at line 1051 of file projectview.cpp.
References fallback_widget_, and m_tab.
Referenced by loadDiagrams(), and tabChanged().
void ProjectView::setProject | ( | QETProject * | project | ) |
Definit le projet visualise par le ProjectView. Ne fait rien si le projet a deja ete defini.
project | projet a visualiser |
Definition at line 78 of file projectview.cpp.
References addNewDiagram(), adjustReadOnlyState(), loadDiagrams(), m_project, project(), and updateWindowTitle().
Referenced by ProjectView().
|
slot |
Active l'onglet adequat pour afficher le schema passe en parametre
diagram | Schema a afficher |
Definition at line 471 of file projectview.cpp.
References m_tab.
Referenced by addDiagram(), addNewDiagram(), addNewDiagramFolioList(), and editDiagramProperties().
|
slot |
Active l'onglet adequat pour afficher le schema passe en parametre
diagram | Schema a afficher |
Definition at line 480 of file projectview.cpp.
References findDiagram(), and m_tab.
|
privateslot |
ProjectView::tabChanged Manage the tab change. If tab_id == -1 (there is no diagram opened), we display the fallback widget.
tab_id |
Definition at line 1015 of file projectview.cpp.
References diagramActivated(), m_diagram_ids, m_previous_tab_index, m_tab, and setDisplayFallbackWidget().
Referenced by initWidgets().
|
privateslot |
Gere le double-clic sur un onglet : edite les proprietes du schema
tab_id | Index de l'onglet concerne |
Definition at line 1037 of file projectview.cpp.
References editDiagramProperties(), and m_diagram_ids.
Referenced by initWidgets().
|
slot |
from | Index de l'onglet avant le deplacement |
to | Index de l'onglet apres le deplacement |
Definition at line 964 of file projectview.cpp.
References QETProject::diagramOrderChanged(), m_diagram_ids, m_project, rebuildDiagramsMap(), and updateTabTitle().
Referenced by initWidgets().
|
private |
Cette methode essaye de fermer successivement les editeurs d'element puis les schemas du projet. L'utilisateur peut refuser de fermer un schema ou un editeur.
Definition at line 207 of file projectview.cpp.
References askUserForFilePath(), QET::Icons::Cancel, errorEncountered(), QETResult::errorMessage(), QETResult::isOk(), m_project, tryClosingDiagrams(), tryClosingElementEditors(), and updateWindowTitle().
Referenced by closeEvent().
|
private |
ProjectView::tryClosingDiagrams try to close this project, if diagram or project option are changed a dialog ask if user want to save the modification.
Definition at line 280 of file projectview.cpp.
References QET::Icons::Cancel, m_project, project(), QET::QetMessageBox::question(), QETProject::title(), and QET::Icons::tr.
Referenced by tryClosing().
|
private |
Un projet comporte des elements integres. Cette methode ferme les editeurs d'elements associes a ce projet. L'utilisateur peut refuser la fermeture d'un editeur d'element.
Definition at line 256 of file projectview.cpp.
References QETApp::elementEditors(), m_project, and QETApp::titleBlockTemplateEditors().
Referenced by tryClosing().
|
slot |
ProjectView::updateAllTabsTitle Update all tabs title.
Definition at line 954 of file projectview.cpp.
References m_diagram_ids, and updateTabTitle().
Referenced by addDiagram(), and removeDiagram().
|
slot |
ProjectView::updateTabTitle Update the title of the tab which display the diagram view .
diagram | : The diagram view. |
Definition at line 925 of file projectview.cpp.
References Diagram::border_and_titleblock, DiagramView::diagram(), BorderTitleBlock::folio(), Diagram::folioIndex(), autonum::AssignVariables::formulaToLabel(), m_diagram_ids, m_tab, and Diagram::title().
Referenced by addDiagram(), tabMoved(), and updateAllTabsTitle().
|
slot |
ProjectView::updateWindowTitle Update the project view title.
Definition at line 894 of file projectview.cpp.
References m_project, and QET::Icons::tr.
Referenced by adjustReadOnlyState(), doSave(), setProject(), and tryClosing().
|
private |
Definition at line 129 of file projectview.h.
Referenced by adjustReadOnlyState(), initActions(), and initWidgets().
|
private |
Definition at line 133 of file projectview.h.
Referenced by initLayout(), and initWidgets().
|
private |
Definition at line 132 of file projectview.h.
Referenced by initLayout(), initWidgets(), and setDisplayFallbackWidget().
|
private |
Definition at line 131 of file projectview.h.
Referenced by initLayout().
|
private |
Definition at line 135 of file projectview.h.
Referenced by addDiagram(), currentDiagram(), firstDiagram(), lastDiagram(), moveDiagramDown(), moveDiagramDownx10(), moveDiagramUp(), moveDiagramUpTop(), moveDiagramUpx10(), nextDiagram(), previousDiagram(), rebuildDiagramsMap(), removeDiagram(), tabChanged(), tabDoubleClicked(), tabMoved(), updateAllTabsTitle(), updateTabTitle(), and ~ProjectView().
|
private |
Definition at line 137 of file projectview.h.
Referenced by addDiagram(), diagram_views(), rebuildDiagramsMap(), and removeDiagram().
|
private |
Definition at line 136 of file projectview.h.
Referenced by tabChanged().
|
private |
Definition at line 130 of file projectview.h.
Referenced by addDiagram(), addNewDiagram(), addNewDiagramFolioList(), adjustReadOnlyState(), askUserForFilePath(), cleanProject(), doSave(), editProjectProperties(), exportProject(), loadDiagrams(), printProject(), project(), removeDiagram(), saveAs(), setProject(), tabMoved(), tryClosing(), tryClosingDiagrams(), tryClosingElementEditors(), and updateWindowTitle().
|
private |
Definition at line 134 of file projectview.h.
Referenced by addDiagram(), addNewDiagramFolioList(), adjustReadOnlyState(), changeFirstTab(), changeLastTab(), changeTabDown(), changeTabUp(), currentDiagram(), initLayout(), initWidgets(), loadDiagrams(), moveDiagramDown(), moveDiagramDownx10(), moveDiagramUp(), moveDiagramUpTop(), moveDiagramUpx10(), nextDiagram(), previousDiagram(), rebuildDiagramsMap(), removeDiagram(), setDisplayFallbackWidget(), showDiagram(), tabChanged(), and updateTabTitle().