mirror of https://gitlab.com/pamhyr/pamhyr2
BC: Edit: Fix sort command and scale column.
parent
2f0b5b2e31
commit
63d7541062
|
|
@ -50,6 +50,9 @@ class TableModel(QAbstractTableModel):
|
|||
return len(self._headers)
|
||||
|
||||
def data(self, index, role):
|
||||
if role == Qt.TextAlignmentRole:
|
||||
return Qt.AlignHCenter | Qt.AlignVCenter
|
||||
|
||||
if role != Qt.ItemDataRole.DisplayRole:
|
||||
return QVariant()
|
||||
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ class SortCommand(QUndoCommand):
|
|||
def redo(self):
|
||||
self._data.sort(
|
||||
_reverse=self._reverse,
|
||||
key=lambda x: x.name
|
||||
key=lambda x: x[0]
|
||||
)
|
||||
if self._indexes is None:
|
||||
self._indexes = list(
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ from PyQt5.QtWidgets import (
|
|||
QDialogButtonBox, QPushButton, QLineEdit,
|
||||
QFileDialog, QTableView, QAbstractItemView,
|
||||
QUndoStack, QShortcut, QAction, QItemDelegate,
|
||||
QHeaderView,
|
||||
)
|
||||
|
||||
from View.Plot.MplCanvas import MplCanvas
|
||||
|
|
@ -69,6 +70,7 @@ class EditBoundaryConditionWindow(ASubMainWindow, ListedSubWindow):
|
|||
)
|
||||
table.setModel(self._table)
|
||||
table.setSelectionBehavior(QAbstractItemView.SelectRows)
|
||||
table.horizontalHeader().setSectionResizeMode(QHeaderView.Stretch)
|
||||
table.setAlternatingRowColors(True)
|
||||
|
||||
def setup_plot(self):
|
||||
|
|
|
|||
Loading…
Reference in New Issue