|
QElectroTech
0.8-dev
|
Go to the documentation of this file.
18 #ifndef PROJECT_VIEW_H
19 #define PROJECT_VIEW_H
30 class WheelEnabledTabBar :
public QTabWidget
33 WheelEnabledTabBar(QWidget *parent =
nullptr)
37 double temp_index = 0;
39 void wheelEvent(QWheelEvent *event)
override
41 int index = currentIndex();
43 double scale_factor = 0.005;
44 if (event->modifiers() & Qt::ControlModifier) {
46 delta =
event->delta() * scale_factor;
47 if (delta > 0 && (temp_index > -1)) temp_index = temp_index - abs(delta);
48 if (delta < 0 && (temp_index < count())) temp_index = temp_index + abs(delta);
50 index = int (temp_index);
51 qDebug() <<
"index" << index <<
"temp_index" << temp_index <<
" " <<
event->delta() << delta;
53 if (index >= 0 && index < count())
54 setCurrentIndex(index);
176 WheelEnabledTabBar *
m_tab;
void readOnlyChanged(QETProject *, bool)
void setProject(QETProject *)
ProjectView::setProject Set the project display by the project view.
Definition: projectview.cpp:74
void diagramAdded(DiagramView *)
void setDisplayFallbackWidget(bool)
Definition: projectview.cpp:1040
static QList< QETTitleBlockTemplateEditor * > titleBlockTemplateEditors()
QETApp::titleBlockTemplateEditors.
Definition: qetapp.cpp:1231
void moveDiagramDownx10(DiagramView *)
Definition: projectview.cpp:542
void initWidgets()
Definition: projectview.cpp:736
void exec()
ProjectPropertiesDialog::exec execute this dialog.
Definition: projectpropertiesdialog.cpp:55
void projectTitleChanged(QETProject *, const QString &)
QUndoStack * undoStack()
Definition: qetproject.h:168
static QList< QETElementEditor * > elementEditors()
QETApp::elementEditors.
Definition: qetapp.cpp:1223
XmlElementCollection * embeddedElementCollection() const
QETProject::embeddedCollection.
Definition: qetproject.cpp:236
int cleanProject()
Definition: projectview.cpp:661
QETResult save()
Definition: projectview.cpp:610
QMap< int, DiagramView * > m_diagram_ids
Definition: projectview.h:181
Definition: assignvariables.h:35
QList< DiagramView * > diagram_views() const
Definition: projectview.cpp:97
Definition: qettemplateeditor.h:36
int folioIndex(const Diagram *) const
Definition: qetproject.cpp:227
void titleBlockFolioChanged(const QString &)
titleBlockFolioChanged Signal emitted after Folio has changed
QETResult noProjectResult() const
Definition: projectview.cpp:342
bool tryClosing()
Definition: projectview.cpp:211
void setFileName(const QString &)
Definition: diagramprintdialog.cpp:60
QString title() const
Definition: qetproject.cpp:366
void projectModified(QETProject *, bool)
virtual void deleteUnusedTitleBlocKTemplates()
Definition: templatescollection.cpp:341
QIcon AddFolio
Definition: qeticons.cpp:25
void moveDiagramDown(DiagramView *)
Definition: projectview.cpp:477
void changeLastTab()
change current diagramview to last tab
Definition: projectview.cpp:175
void updateWindowTitle()
ProjectView::updateWindowTitle Update the project view title.
Definition: projectview.cpp:851
void exportProject()
Definition: projectview.cpp:594
void editElementRequired(const ElementsLocation &)
Signal emitted when users wish to edit an element from the diagram.
void printProject()
Definition: projectview.cpp:564
int tryClosingDiagrams()
ProjectView::tryClosingDiagrams try to close this project, if diagram or project option are changed a...
Definition: projectview.cpp:284
void changeFirstTab()
change current diagramview to first tab
Definition: projectview.cpp:190
QIcon ArrowRightDouble
Definition: qeticons.cpp:31
void setDocName(const QString &)
Definition: diagramprintdialog.cpp:74
void editCurrentDiagramProperties()
Definition: projectview.cpp:433
void setProgressBar(int val)
DialogWaiting::setProgressBar.
Definition: dialogwaiting.cpp:49
DiagramView * findDiagram(Diagram *)
Definition: projectview.cpp:974
void changeTabDown()
change current diagramview to next folio
Definition: projectview.cpp:129
void removeDiagram(DiagramView *)
ProjectView::removeDiagram Remove a diagram (folio) of the project.
Definition: projectview.cpp:352
void projectClosed(ProjectView *)
void editProjectProperties()
Definition: projectview.cpp:424
void moveDiagramUpx10(DiagramView *)
Definition: projectview.cpp:521
void updateTabTitle(DiagramView *)
ProjectView::updateTabTitle Update the title of the tab which display the diagram view.
Definition: projectview.cpp:911
void setModified(bool)
Definition: qetproject.cpp:1213
bool tryClosingElementEditors()
Definition: projectview.cpp:260
BorderTitleBlock border_and_titleblock
Diagram dimensions and title block.
Definition: diagram.h:83
TitleBlockTemplatesProjectCollection * embeddedTitleBlockTemplatesCollection()
Definition: qetproject.cpp:243
void cleanUnusedElement()
XmlElementCollection::cleanUnusedElement Remove elements in this collection which is not used in the ...
Definition: xmlelementcollection.cpp:711
QETProject * m_project
Definition: projectview.h:170
QETProject * project()
Definition: projectview.cpp:65
~ProjectView() override
Definition: projectview.cpp:57
The Diagram class This class represents an electric diagram. It manages its various child elements,...
Definition: diagram.h:56
void diagramAdded(QETProject *, Diagram *)
QETResult doSave()
Definition: projectview.cpp:636
QList< Diagram * > diagrams() const
Definition: qetproject.cpp:217
QString stringToFileName(const QString &)
Definition: qet.cpp:414
QMessageBox::StandardButton question(QWidget *, const QString &, const QString &, QMessageBox::StandardButtons=QMessageBox::Ok, QMessageBox::StandardButton=QMessageBox::NoButton)
Definition: qetmessagebox.cpp:53
void initActions()
Definition: projectview.cpp:721
bool isOk() const
Definition: qetresult.cpp:47
DiagramView * lastDiagram()
Definition: projectview.cpp:183
QAction * m_end_view
Definition: projectview.h:169
void showDiagram(DiagramView *)
Definition: projectview.cpp:404
QLabel * fallback_label_
Definition: projectview.h:173
Definition: dialogwaiting.h:30
void tabDoubleClicked(int)
Definition: projectview.cpp:1026
void editElementRequired(const ElementsLocation &)
Diagram * addNewDiagram(int pos=-1)
QETProject::addNewDiagram Add a new diagram in project at position pos.
Definition: qetproject.cpp:1151
QString folio() const
Definition: bordertitleblock.h:113
void adjustReadOnlyState()
Definition: projectview.cpp:865
QString askUserForFilePath(bool=true)
Definition: projectview.cpp:315
QList< DiagramView * > m_diagram_view_list
Definition: projectview.h:183
QIcon ProjectFileGP
Definition: qeticons.cpp:148
static bool hasInstance()
Definition: dialogwaiting.h:46
static QString formulaToLabel(QString formula, sequentialNumbers &seqStruct, Diagram *diagram, const Element *elmt=nullptr)
AssignVariables::formulaToLabel Return the formula with variable assigned (ready to be displayed)
Definition: assignvariables.cpp:187
void rebuildDiagramsMap()
Definition: projectview.cpp:986
QETResult saveAs()
Definition: projectview.cpp:621
QString errorMessage() const
Definition: qetresult.cpp:61
ProjectView(QETProject *, QWidget *=nullptr)
Definition: projectview.cpp:42
The ElementsLocation class This class represents the location, the location of an element or of a cat...
Definition: elementslocation.h:46
int m_previous_tab_index
Definition: projectview.h:182
void showDiagram(Diagram *)
Signal emmitted when diagram must be show.
static DialogWaiting * instance(QWidget *parent=nullptr)
Definition: dialogwaiting.h:33
Definition: qetproject.h:51
Definition: qetresult.h:26
The ProjectView class This class provides a widget displaying the diagrams of a particular project us...
Definition: projectview.h:79
void loadDiagrams()
ProjectView::loadDiagrams Load diagrams of project. We create a diagram view for each diagram,...
Definition: projectview.cpp:814
Diagram * diagram()
Definition: diagramview.h:67
void titleChanged(DiagramView *, const QString &)
Signal emitted after the diagram title changed.
void tabChanged(int)
ProjectView::tabChanged Manage the tab change. If tab_id == -1 (there is no diagram opened),...
Definition: projectview.cpp:1004
DiagramView * firstDiagram()
Definition: projectview.cpp:198
void moveDiagramUpTop(DiagramView *)
Definition: projectview.cpp:498
QTabWidget * m_tab
Definition: projectview.h:178
int folioIndex() const
Diagram::folioIndex.
Definition: diagram.cpp:2335
QAction * m_first_view
Definition: projectview.h:168
void changeTabUp()
change current diagramview to previous tab
Definition: projectview.cpp:152
QString title() const
Diagram::title.
Definition: diagram.cpp:2023
void diagramActivated(DiagramView *)
DiagramView * nextDiagram()
Definition: projectview.cpp:140
ProjectView(const ProjectView &)
QWidget * fallback_widget_
Definition: projectview.h:172
void setTitle(const QString &val)
DialogWaiting::setTitle of action.
Definition: dialogwaiting.cpp:75
DiagramView * previousDiagram()
Definition: projectview.cpp:163
QMessageBox::StandardButton critical(QWidget *, const QString &, const QString &, QMessageBox::StandardButtons=QMessageBox::Ok, QMessageBox::StandardButton=QMessageBox::NoButton)
Definition: qetmessagebox.cpp:23
void diagramOrderChanged(int, int)
Definition: qetproject.cpp:1198
void cleanUnusedDirectory()
XmlElementCollection::cleanUnusedDirectory Remove the empty directories of this collection.
Definition: xmlelementcollection.cpp:721
Definition: diagramview.h:38
void initLayout()
Definition: projectview.cpp:792
void exec()
Definition: diagramprintdialog.cpp:110
void findElementRequired(const ElementsLocation &)
Signal emitted when users wish to locate an element from the diagram within elements collection.
void updateAllTabsTitle()
ProjectView::updateAllTabsTitle Update all tabs title.
Definition: projectview.cpp:943
void errorEncountered(const QString &)
void editDiagramProperties(DiagramView *)
Definition: projectview.cpp:440
The ProjectPropertiesDialog class this class builds a dialog to edit whole properties of a project.
Definition: projectpropertiesdialog.h:30
void moveDiagramUp(DiagramView *)
Definition: projectview.cpp:456
DiagramView * currentDiagram() const
ProjectView::currentDiagram.
Definition: projectview.cpp:105
Definition: exportdialog.h:30
QIcon ArrowLeftDouble
Definition: qeticons.cpp:29
void diagramRemoved(DiagramView *)
int progressBarValue() const
DialogWaiting::progressBarValue.
Definition: dialogwaiting.cpp:91
void findElementRequired(const ElementsLocation &)
The DiagramPrintDialog class This class implements both the dialog allowing users to configure the pr...
Definition: diagramprintdialog.h:34
void tabMoved(int, int)
Definition: projectview.cpp:953
void setDetail(const QString &val)
DialogWaiting::setDetail of action.
Definition: dialogwaiting.cpp:83
QIcon tr
Definition: qeticons.cpp:206
QIcon Diagram
Definition: qeticons.cpp:43
QIcon Cancel
Definition: qeticons.cpp:34
Definition: qetelementeditor.h:33
QAction * m_add_new_diagram
Definition: projectview.h:167
QVBoxLayout * layout_
Definition: projectview.h:171
void closeEvent(QCloseEvent *) override
Definition: projectview.cpp:116