Skip to content

Commit 8a74ab5

Browse files
committed
Finally solved the adjustSize() issue to properly size the main window
1 parent aa15e3e commit 8a74ab5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

bidscoin/bidseditor.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -519,8 +519,10 @@ def set_tab_bidsmap(self, dataformat: str):
519519
header = samples_table.horizontalHeader()
520520
header.setVisible(True)
521521
header.setSectionResizeMode(QHeaderView.ResizeMode.ResizeToContents)
522-
header.setSectionResizeMode(1, QHeaderView.ResizeMode.Stretch)
522+
header.setSectionResizeMode(1, QHeaderView.ResizeMode.Interactive)
523523
header.setSectionResizeMode(3, QHeaderView.ResizeMode.Stretch)
524+
self.fill_samples_table(dataformat)
525+
samples_table.resizeColumnsToContents()
524526

525527
layout = QVBoxLayout()
526528
layout.addWidget(participant_label)
@@ -532,8 +534,6 @@ def set_tab_bidsmap(self, dataformat: str):
532534
tab.setLayout(layout)
533535
self.tabwidget.addTab(tab, f"{dataformat} mappings")
534536

535-
self.fill_samples_table(dataformat)
536-
537537
def set_tab_options(self):
538538
"""Set the options tab"""
539539

@@ -637,6 +637,7 @@ def fill_participant_table(self, dataformat: str):
637637
participant_table.setCellWidget(n, 2, edit_button)
638638
participant_table.setItem(n+1, 0, MyQTableItem())
639639
participant_table.setItem(n+1, 1, MyQTableItem())
640+
participant_table.resizeColumnsToContents()
640641

641642
participant_table.show()
642643
participant_table.blockSignals(False)
@@ -826,7 +827,6 @@ def open_editwindow(self, provenance: Path=Path(), datatype: str=''):
826827
self.editwindow_opened = str(provenance)
827828
editwindow.done_edit.connect(self.fill_samples_table)
828829
editwindow.finished.connect(self.release_editwindow)
829-
self.adjustSize()
830830
editwindow.show()
831831
return
832832
LOGGER.error(f"Could not find [{datatype}] {provenance} run-item")

0 commit comments

Comments
 (0)