Commit 26bb8d5b authored by Pierre-Antoine Rouby's avatar Pierre-Antoine Rouby
Browse files

Network: Set table column resize as stretch.

Showing with 6 additions and 1 deletion
+6 -1
...@@ -8,7 +8,7 @@ from PyQt5.QtCore import ( ...@@ -8,7 +8,7 @@ from PyQt5.QtCore import (
from PyQt5.QtWidgets import ( from PyQt5.QtWidgets import (
QTableView, QItemDelegate, QComboBox, QLineEdit, QHBoxLayout, QSlider, QTableView, QItemDelegate, QComboBox, QLineEdit, QHBoxLayout, QSlider,
QPushButton, QCheckBox, QStyledItemDelegate, QStyleOptionButton, QStyle, QPushButton, QCheckBox, QStyledItemDelegate, QStyleOptionButton, QStyle,
QApplication, QToolBar, QAction, QApplication, QToolBar, QAction, QHeaderView, QAbstractItemView,
) )
from Model.River import RiverNode, RiverReach, River from Model.River import RiverNode, RiverReach, River
...@@ -44,6 +44,9 @@ class NetworkWindow(ASubMainWindow): ...@@ -44,6 +44,9 @@ class NetworkWindow(ASubMainWindow):
table.setModel(self.nodes_model) table.setModel(self.nodes_model)
#table.resizeColumnsToContents() #table.resizeColumnsToContents()
table.setSelectionBehavior(QAbstractItemView.SelectRows)
table.horizontalHeader().setSectionResizeMode(QHeaderView.Stretch)
# Edges table # Edges table
self.reachs_model = GraphTableModel( self.reachs_model = GraphTableModel(
...@@ -64,6 +67,8 @@ class NetworkWindow(ASubMainWindow): ...@@ -64,6 +67,8 @@ class NetworkWindow(ASubMainWindow):
table.setItemDelegateForColumn(1, self.delegate_true_false_combobox) table.setItemDelegateForColumn(1, self.delegate_true_false_combobox)
table.setItemDelegateForColumn(2, self.delegate_combobox) table.setItemDelegateForColumn(2, self.delegate_combobox)
table.setItemDelegateForColumn(3, self.delegate_combobox) table.setItemDelegateForColumn(3, self.delegate_combobox)
table.setSelectionBehavior(QAbstractItemView.SelectRows)
table.horizontalHeader().setSectionResizeMode(QHeaderView.Stretch)
#table.resizeColumnsToContents() #table.resizeColumnsToContents()
# Connection # Connection
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment