rows sortable + columns rearrangable + horizontalHeaderStretchLastSection -> True

This commit is contained in:
Paul S 2021-07-01 18:33:19 +02:00
parent de44023116
commit 7e2272017f
4 changed files with 14 additions and 1 deletions

View file

@ -1,5 +1,11 @@
# Changelog GarageCalc1
## [0.4.2] - 2021-07-01
## Added
- Tabelle "Gegenstände": Zeilen sind sortierbar (-> Klick auf Spaltenköpfe)
- Tabelle "Gegenstände": Spalten sind anordenbar
- Beide Tabellen: Rechte Spalte wächst dynamisch ans Ende
## [0.4.1] - 2021-07-01
## Added
- Dynamisches Layout

View file

@ -55,6 +55,9 @@ class TableWidget(QTableWidget):
self.setSelectionBehavior(QTableWidget.SelectItems)
#self.setSelectionBehavior(QTableWidget.SelectRows)
self.setAlternatingRowColors(True)
self.setSortingEnabled(True)
self.horizontalHeader().setSectionsMovable(True)
self.horizontalHeader().setStretchLastSection(True)
# Context-menu
self.setContextMenuPolicy(Qt.CustomContextMenu)
@ -67,6 +70,7 @@ class TableWidget(QTableWidget):
self.headers.customContextMenuRequested.connect(self.on_rowheadercontext_menu)
self.headers.setSelectionMode(QAbstractItemView.SingleSelection)
self.headers.sectionClicked.connect(self.select_row)
self.headers.setSectionsMovable(True)
self.row_selected = False

View file

@ -28,7 +28,7 @@ from utils import show_about, resource_path
from clsTableWidget import TableWidget
# Local globals
APP_VERSION = "v0.4.1"
APP_VERSION = "v0.4.2"
DIR_APPDATA = os.getenv('LOCALAPPDATA')

View file

@ -55,6 +55,9 @@
<height>58</height>
</size>
</property>
<attribute name="horizontalHeaderStretchLastSection">
<bool>true</bool>
</attribute>
<row>
<property name="text">
<string>Garage</string>