Skip to content

Commit

Permalink
fix advanced search
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhrisca committed Sep 13, 2023
1 parent aa1f29b commit a40d522
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions src/asammdf/gui/dialogs/advanced_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ def __init__(
self.matches.setColumnWidth(self.SourceNameColumn, 170)
self.matches.setColumnWidth(self.SourcePathColumn, 170)

self.setWindowFlag(QtCore.Qt.WindowMaximizeButtonHint, True)

self.showMaximized()

def search_text_changed(self):
Expand All @@ -128,19 +130,21 @@ def search_text_changed(self):
# it takes ~1 minute for 60000 previous search results

self.matches.hide()
self.matches.itemDoubleClicked.disconnect()
self.matches.header().sectionResized.disconnect()
self.matches.setParent(None)

self.matches = QtWidgets.QTreeWidget(self.tab)
self.matches.setObjectName("matches")
self.matches.setHeaderLabels(
[
"Comment",
"Source path",
"Source name",
"Unit",
"Index",
"Group",
"Name",
"Group",
"Index",
"Unit",
"Source name",
"Source path",
"Comment",
]
)

Expand Down Expand Up @@ -451,6 +455,9 @@ def _selection_double_clicked(self, item):
root = self.selection.invisibleRootItem()
(item.parent() or root).removeChild(item)

@QtCore.Slot(int, int, int, result=None)
def section_resized(self, index, old_size, new_size):
self.selection.setColumnWidth(index, new_size)
self.matches.setColumnWidth(index, new_size)
if self.selection.columnWidth(index) != new_size:
self.selection.setColumnWidth(index, new_size)
if self.matches.columnWidth(index) != new_size:
self.matches.setColumnWidth(index, new_size)

0 comments on commit a40d522

Please sign in to comment.