QElectroTech 0.100.0-dev
Loading...
Searching...
No Matches
terminalstriptreedockwidget.h
Go to the documentation of this file.
1/*
2 Copyright 2006-2024 The QElectroTech Team
3 This file is part of QElectroTech.
4
5 QElectroTech is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 2 of the License, or
8 (at your option) any later version.
9
10 QElectroTech is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
17*/
18#ifndef TERMINALSTRIPTREEDOCKWIDGET_H
19#define TERMINALSTRIPTREEDOCKWIDGET_H
20
21#include <QDockWidget>
22#include <QPointer>
23
24class QETProject;
25class QTreeWidgetItem;
26class TerminalStrip;
27class RealTerminal;
28
29namespace Ui {
31}
32
33class TerminalStripTreeDockWidget : public QDockWidget
34{
35 Q_OBJECT
36 private:
45 //Role used for data in QTreeWidgetItem
46 static constexpr int UUID_USER_ROLE{Qt::UserRole + 1};
47
48 public:
49 explicit TerminalStripTreeDockWidget(QETProject *project, QWidget *parent = nullptr);
51
52 void reload();
53 bool currentIsStrip() const;
55 QString currentInstallation() const;
56 QString currentLocation() const;
58 QSharedPointer<RealTerminal> currentRealTerminal() const;
59
60 signals:
62
63 private slots:
64 void on_m_tree_view_currentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous);
65
66 private:
67 void buildTree();
68 QTreeWidgetItem* addTerminalStrip(TerminalStrip *terminal_strip);
69 void addFreeTerminal();
70 void setCurrentStrip(TerminalStrip *strip);
71
72 private:
73 Ui::TerminalStripTreeDockWidget *ui;
74 QPointer<QETProject> m_project;
75 QPointer<TerminalStrip> m_current_strip;
76
77 QHash<QTreeWidgetItem *, TerminalStrip *> m_item_strip_H;
78 QHash<QUuid, QSharedPointer<RealTerminal>> m_uuid_terminal_H;
79 QHash<QUuid, QPointer<TerminalStrip>> m_uuid_strip_H;
80 QVector<QMetaObject::Connection> m_strip_changed_connection;
82};
83
84#endif // TERMINALSTRIPTREEDOCKWIDGET_H
Definition qetproject.h:62
The RealTerminal class Represent a real terminal. A real terminal can be a drawn terminal in a folio ...
Definition realterminal.h:43
The TerminalStrip class This class hold all the datas and configurations of a terminal strip (but the...
Definition terminalstrip.h:45
Definition terminalstriptreedockwidget.h:34
QHash< QUuid, QPointer< TerminalStrip > > m_uuid_strip_H
Definition terminalstriptreedockwidget.h:79
QPointer< QETProject > m_project
Definition terminalstriptreedockwidget.h:74
TerminalStrip * currentStrip() const
TerminalStripTreeDockWidget::currentStrip.
Definition terminalstriptreedockwidget.cpp:97
void buildTree()
TerminalStripTreeDockWidget::buildTree.
Definition terminalstriptreedockwidget.cpp:206
QSharedPointer< RealTerminal > currentRealTerminal() const
TerminalStripTreeDockWidget::currentRealTerminal.
Definition terminalstriptreedockwidget.cpp:155
void addFreeTerminal()
TerminalStripTreeDockWidget::addFreeTerminal.
Definition terminalstriptreedockwidget.cpp:308
bool m_current_is_free_terminal
Definition terminalstriptreedockwidget.h:81
QPointer< TerminalStrip > m_current_strip
Definition terminalstriptreedockwidget.h:75
TreeWidgetType
Definition terminalstriptreedockwidget.h:37
@ Installation
Definition terminalstriptreedockwidget.h:41
@ Root
Definition terminalstriptreedockwidget.h:38
@ Strip
Definition terminalstriptreedockwidget.h:43
@ Terminal
Definition terminalstriptreedockwidget.h:39
@ Location
Definition terminalstriptreedockwidget.h:42
@ FreeTerminal
Definition terminalstriptreedockwidget.h:40
QHash< QTreeWidgetItem *, TerminalStrip * > m_item_strip_H
Definition terminalstriptreedockwidget.h:77
QString currentInstallation() const
TerminalStripTreeDockWidget::currentInstallation.
Definition terminalstriptreedockwidget.cpp:105
QTreeWidgetItem * addTerminalStrip(TerminalStrip *terminal_strip)
Definition terminalstriptreedockwidget.cpp:231
void reload()
TerminalStripTreeDockWidget::reload.
Definition terminalstriptreedockwidget.cpp:54
static constexpr int UUID_USER_ROLE
Definition terminalstriptreedockwidget.h:46
void on_m_tree_view_currentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous)
TerminalStripTreeDockWidget::on_m_tree_view_currentItemChanged.
Definition terminalstriptreedockwidget.cpp:170
bool currentIsStrip() const
TerminalStripTreeDockWidget::currentIsStrip.
Definition terminalstriptreedockwidget.cpp:88
void currentStripChanged(TerminalStrip *strip)
Ui::TerminalStripTreeDockWidget * ui
Definition terminalstriptreedockwidget.h:73
QString currentLocation() const
TerminalStripTreeDockWidget::currentLocation.
Definition terminalstriptreedockwidget.cpp:128
void setCurrentStrip(TerminalStrip *strip)
Definition terminalstriptreedockwidget.cpp:339
QHash< QUuid, QSharedPointer< RealTerminal > > m_uuid_terminal_H
Definition terminalstriptreedockwidget.h:78
QVector< QMetaObject::Connection > m_strip_changed_connection
Definition terminalstriptreedockwidget.h:80
void setSelectedStrip(TerminalStrip *strip)
TerminalStripTreeDockWidget::setSelectedStrip.
Definition terminalstriptreedockwidget.cpp:147
~TerminalStripTreeDockWidget()
Definition terminalstriptreedockwidget.cpp:46
Definition autonumberingdockwidget.h:26