diff options
author | Blaine | 2020-06-18 14:17:51 +0530 |
---|---|---|
committer | Blaine | 2020-06-18 14:17:51 +0530 |
commit | 4d1cb634fb37302e96cab95dafbd8f14f2bec852 (patch) | |
tree | 7bc29eff7c61440cf6045725d1dbc646c3055cb9 | |
parent | 79b0690d4ae7d9f8853aa90ba0cdbe58af7c1c4d (diff) | |
download | Chemical-PFD-4d1cb634fb37302e96cab95dafbd8f14f2bec852.tar.gz Chemical-PFD-4d1cb634fb37302e96cab95dafbd8f14f2bec852.tar.bz2 Chemical-PFD-4d1cb634fb37302e96cab95dafbd8f14f2bec852.zip |
implement header inclusive bottom line
-rw-r--r-- | src/main/python/utils/streamTable.py | 15 | ||||
-rw-r--r-- | src/main/resources/base/app.qss | 4 |
2 files changed, 15 insertions, 4 deletions
diff --git a/src/main/python/utils/streamTable.py b/src/main/python/utils/streamTable.py index acccdee..7dfc27f 100644 --- a/src/main/python/utils/streamTable.py +++ b/src/main/python/utils/streamTable.py @@ -93,6 +93,7 @@ class streamTable(QTableView): self.model.updateEvent.connect(self.resizeHandler) self.setItemDelegateForRow(0, drawBorderDelegate(self)) + self.borderThickness[0] = True def mousePressEvent(self, event): if event.button() == Qt.RightButton: @@ -109,11 +110,12 @@ class streamTable(QTableView): def changeRowBorder(self, row): if self.borderThickness[row]: - self.borderThickness[row] = False + self.borderThickness.pop(row) self.setItemDelegateForRow(row, QStyledItemDelegate(self)) else: self.borderThickness[row] = True self.setItemDelegateForRow(row, drawBorderDelegate(self)) + self.verticalHeader().repaint() def labelChange(self, index): newName, bool = QInputDialog.getText(self, "Change Property Name", "Enter new name", @@ -180,4 +182,13 @@ class verticalHeader(QHeaderView): def mouseDoubleClickEvent(self, event): index = self.logicalIndexAt(event.pos()) self.labelChangeRequested.emit(index) - return super().mouseDoubleClickEvent(event)
\ No newline at end of file + return super().mouseDoubleClickEvent(event) + + def paintSection(self, painter, option, index): + painter.save() + super(verticalHeader, self).paintSection(painter, option, index) + painter.restore() + if self.parentWidget().borderThickness[index]: + rect = option + painter.drawLine(rect.bottomLeft(), rect.bottomRight()) + painter.setPen(QPen(Qt.black, 1, Qt.SolidLine))
\ No newline at end of file diff --git a/src/main/resources/base/app.qss b/src/main/resources/base/app.qss index d7b25b4..1d21ab4 100644 --- a/src/main/resources/base/app.qss +++ b/src/main/resources/base/app.qss @@ -275,9 +275,9 @@ QHeaderView::section { background-color: white; } -QHeaderView::section:first{ +/* QHeaderView::section:first{ border-bottom: 1px solid black; -} +} */ QTableView { border: none; |