mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
BC: Edit: Fix sort command and scale column.
This commit is contained in:
1 parent
2f0b5b2e31
commit
63d7541062
3 files changed
+6
-1
No files matched your search
@@ -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):
|
||||
|
||||
Reference in new issue
Block a user