Fix header row heights too large

This commit is contained in:
Keith Edmunds 2024-12-13 12:45:42 +00:00
parent 642e8523a2
commit ba32473f06
2 changed files with 19 additions and 1 deletions

View File

@ -377,7 +377,7 @@ class PlaylistModel(QAbstractTableModel):
else:
return QVariant(self.header_text(rat))
else:
return QVariant()
return QVariant("")
if column == Col.START_TIME.value:
start_time = rat.forecast_start_time

View File

@ -214,6 +214,24 @@ class PlaylistDelegate(QStyledItemDelegate):
doc.setDefaultFont(option.font)
doc.setDocumentMargin(0)
doc.setHtml(option.text)
# For debugging +++
# Calculate sizes
# document_size = doc.documentLayout().documentSize()
# ideal_width = doc.idealWidth()
# height = document_size.height()
# rect_width = option.rect.width()
# text = option.text
# # Debug output
# print(f"Index: {index.row()}, {index.column()}")
# print(f"Text: {text}")
# print(f"Option.rect width: {rect_width}")
# print(f"Document idealWidth: {ideal_width}")
# print(f"Document height: {height}")
# print(f"---")
# --- For debugging
return QSize(int(doc.idealWidth()), int(doc.size().height()))
def setEditorData(self, editor, index):