mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
BC: Add graph display.
This commit is contained in:
1 parent
d95e69ba9b
commit
d13130c9a7
3 files changed
+32
-5
No files matched your search
@@ -19,7 +19,7 @@ from PyQt5.QtWidgets import (
|
||||
QDialogButtonBox, QPushButton, QLineEdit,
|
||||
QFileDialog, QTableView, QAbstractItemView,
|
||||
QUndoStack, QShortcut, QAction, QItemDelegate,
|
||||
QComboBox,
|
||||
QComboBox, QVBoxLayout, QHeaderView
|
||||
)
|
||||
|
||||
from View.BoundaryCondition.BCUndoCommand import (
|
||||
@@ -37,6 +37,7 @@ from View.BoundaryCondition.Table import (
|
||||
TableModel, ComboBoxDelegate
|
||||
)
|
||||
|
||||
from View.Network.GraphWidget import GraphWidget
|
||||
from View.BoundaryCondition.translate import *
|
||||
from View.BoundaryCondition.Edit.Window import EditBoundaryConditionWindow
|
||||
|
||||
@@ -54,6 +55,7 @@ class BoundaryConditionWindow(ASubMainWindow, ListedSubWindow):
|
||||
|
||||
self.setup_sc()
|
||||
self.setup_table()
|
||||
self.setup_graph()
|
||||
self.setup_connections()
|
||||
|
||||
self.ui.setWindowTitle(title)
|
||||
@@ -91,8 +93,18 @@ class BoundaryConditionWindow(ASubMainWindow, ListedSubWindow):
|
||||
)
|
||||
|
||||
table.setSelectionBehavior(QAbstractItemView.SelectRows)
|
||||
table.horizontalHeader().setSectionResizeMode(QHeaderView.Stretch)
|
||||
table.setAlternatingRowColors(True)
|
||||
|
||||
def setup_graph(self):
|
||||
self.graph_widget = GraphWidget(
|
||||
self._study.river,
|
||||
min_size=None, size=(200,200),
|
||||
only_display=True,
|
||||
parent=self
|
||||
)
|
||||
self.graph_layout = self.find(QVBoxLayout, "verticalLayout")
|
||||
self.graph_layout.addWidget(self.graph_widget)
|
||||
|
||||
def setup_connections(self):
|
||||
self.find(QAction, "action_add").triggered.connect(self.add)
|
||||
|
||||
Reference in new issue
Block a user