31class WheelEnabledTabBar :
public QTabWidget
34 WheelEnabledTabBar(QWidget *parent =
nullptr)
38 double temp_index = 0;
40 void wheelEvent(QWheelEvent *event)
override
42 int index = currentIndex();
44 double scale_factor = 0.005;
45 if (event->modifiers() & Qt::ControlModifier) {
47 delta =
event->delta() * scale_factor;
48 if (delta > 0 && (temp_index > -1)) temp_index = temp_index - abs(delta);
49 if (delta < 0 && (temp_index < count())) temp_index = temp_index + abs(delta);
51 index = int (temp_index);
52 qDebug() <<
"index" << index <<
"temp_index" << temp_index <<
" " <<
event->delta() << delta;
54 if (index >= 0 && index < count())
55 setCurrentIndex(index);
179 WheelEnabledTabBar *
m_tab;
The Diagram class This class represents an electric diagram. It manages its various child elements,...
Definition diagram.h:56
Definition diagramview.h:39
The ElementsLocation class This class represents the location, the location of an element or of a cat...
Definition elementslocation.h:47
The ProjectView class This class provides a widget displaying the diagrams of a particular project us...
Definition projectview.h:80
DiagramView * firstDiagram()
Definition projectview.cpp:209
void updateTabTitle(DiagramView *)
ProjectView::updateTabTitle Update the title of the tab which display the diagram view.
Definition projectview.cpp:917
QList< DiagramView * > m_diagram_view_list
Definition projectview.h:186
void removeDiagram(DiagramView *)
ProjectView::removeDiagram Remove a diagram (folio) of the project.
Definition projectview.cpp:371
QAction * m_add_new_diagram
Definition projectview.h:170
void closeEvent(QCloseEvent *) override
Definition projectview.cpp:120
void rebuildDiagramsMap()
Definition projectview.cpp:992
ProjectView(const ProjectView &)
void adjustReadOnlyState()
Definition projectview.cpp:871
~ProjectView() override
Definition projectview.cpp:57
void setDisplayFallbackWidget(bool)
Definition projectview.cpp:1047
QList< DiagramView * > diagram_views() const
Definition projectview.cpp:99
QLabel * fallback_label_
Definition projectview.h:176
int tryClosingDiagrams()
ProjectView::tryClosingDiagrams try to close this project, if diagram or project option are changed a...
Definition projectview.cpp:298
DiagramView * currentDiagram() const
ProjectView::currentDiagram.
Definition projectview.cpp:108
DiagramView * findDiagram(Diagram *)
Definition projectview.cpp:980
void editCurrentDiagramProperties()
Definition projectview.cpp:453
void moveDiagramDown(DiagramView *)
Definition projectview.cpp:498
void moveDiagramDownx10(DiagramView *)
Definition projectview.cpp:563
void changeFirstTab()
change current diagramview to first tab
Definition projectview.cpp:200
void editProjectProperties()
Definition projectview.cpp:443
void moveDiagramUp(DiagramView *)
Definition projectview.cpp:477
void setProject(QETProject *project)
ProjectView::setProject Set the project display by the project view.
Definition projectview.cpp:76
void diagramActivated(DiagramView *)
QMap< int, DiagramView * > m_diagram_ids
Definition projectview.h:184
void updateWindowTitle()
ProjectView::updateWindowTitle Update the project view title.
Definition projectview.cpp:856
QVBoxLayout * layout_
Definition projectview.h:174
QWidget * fallback_widget_
Definition projectview.h:175
void moveDiagramUpx10(DiagramView *)
Definition projectview.cpp:542
void changeTabDown()
change current diagramview to next folio
Definition projectview.cpp:133
bool tryClosing()
Definition projectview.cpp:223
int cleanProject()
Definition projectview.cpp:653
DiagramView * nextDiagram()
Definition projectview.cpp:145
void showDiagram(DiagramView *)
Definition projectview.cpp:423
void diagramAdded(DiagramView *)
void changeTabUp()
change current diagramview to previous tab
Definition projectview.cpp:158
void initActions()
Definition projectview.cpp:714
DiagramView * previousDiagram()
Definition projectview.cpp:170
void initLayout()
Definition projectview.cpp:787
bool tryClosingElementEditors()
Definition projectview.cpp:273
void loadDiagrams()
ProjectView::loadDiagrams Load diagrams of project. We create a diagram view for each diagram,...
Definition projectview.cpp:810
void errorEncountered(const QString &)
void exportProject()
Definition projectview.cpp:584
QTabWidget * m_tab
Definition projectview.h:181
QETResult save()
Definition projectview.cpp:601
QETProject * project()
Definition projectview.cpp:66
void projectClosed(ProjectView *)
void tabMoved(int, int)
Definition projectview.cpp:959
void editDiagramProperties(DiagramView *)
Definition projectview.cpp:461
void moveDiagramUpTop(DiagramView *)
Definition projectview.cpp:519
DiagramView * lastDiagram()
Definition projectview.cpp:192
void updateAllTabsTitle()
ProjectView::updateAllTabsTitle Update all tabs title.
Definition projectview.cpp:949
void tabChanged(int)
ProjectView::tabChanged Manage the tab change. If tab_id == -1 (there is no diagram opened),...
Definition projectview.cpp:1011
void tabDoubleClicked(int)
Definition projectview.cpp:1033
void initWidgets()
Definition projectview.cpp:729
QETProject * m_project
Definition projectview.h:173
QETResult doSave()
Definition projectview.cpp:628
QETResult saveAs()
Definition projectview.cpp:613
int m_previous_tab_index
Definition projectview.h:185
void changeLastTab()
change current diagramview to last tab
Definition projectview.cpp:183
QAction * m_first_view
Definition projectview.h:171
void diagramRemoved(DiagramView *)
QString askUserForFilePath(bool=true)
Definition projectview.cpp:330
void findElementRequired(const ElementsLocation &)
QETResult noProjectResult() const
Definition projectview.cpp:360
QAction * m_end_view
Definition projectview.h:172
Definition qetproject.h:62
Definition qetresult.h:26