Skip to content

Commit

Permalink
Merge pull request #2643 from SasView/no_empty_lines_in_data_explorer
Browse files Browse the repository at this point in the history
Empty lines in data explorer
  • Loading branch information
krzywon authored Sep 21, 2023
2 parents af54d02 + 0af91f7 commit d4e3a80
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions src/sas/qtgui/MainWindow/CategoryManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,9 @@ def onSearch(self):
input_to_check = str(self.txtSearch.text())

# redefine the proxy model
self.model_proxy.filterRegularExpression = QtCore.QRegularExpression(input_to_check,
QtCore.Qt.CaseInsensitive, QtCore.QRegularExpression.FixedString)
self.model_proxy.setFilterRegularExpression(QtCore.QRegularExpression(input_to_check,
QtCore.QRegularExpression.CaseInsensitiveOption |
QtCore.QRegularExpression.PatternOption.NoPatternOption))

def onModify(self):
"""
Expand Down
4 changes: 2 additions & 2 deletions src/sas/qtgui/MainWindow/DataExplorer.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def __init__(self, parent=None, guimanager=None, manager=None):
self.theory_model.itemChanged.connect(self.onFileListChanged)

# Don't show "empty" rows with data objects
self.data_proxy.filterRegularExpression = "[^()]"
self.data_proxy.setFilterRegularExpression(QtCore.QRegularExpression(".+"))

# Create a window to allow the display name to change
self.nameChangeBox = ChangeName(self)
Expand All @@ -141,7 +141,7 @@ def __init__(self, parent=None, guimanager=None, manager=None):
self.theory_proxy.setSourceModel(self.theory_model)

# Don't show "empty" rows with data objects
self.theory_proxy.filterRegularExpression = "[^()]"
self.theory_proxy.setFilterRegularExpression(QtCore.QRegularExpression(".+"))

# Theory model view
self.freezeView.setModel(self.theory_proxy)
Expand Down
4 changes: 2 additions & 2 deletions src/sas/qtgui/MainWindow/UnitTesting/DataExplorerTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def testDefaults(self, form):
assert form.model.columnCount() == 0
assert isinstance(form.data_proxy, QSortFilterProxyModel)
assert form.data_proxy.sourceModel() == form.model
assert "[^()]" == str(form.data_proxy.filterRegExp().pattern())
assert ".+" == str(form.data_proxy.filterRegExp().pattern())
assert isinstance(form.treeView, QTreeView)

# Models - theory
Expand All @@ -121,7 +121,7 @@ def testDefaults(self, form):
assert form.theory_model.columnCount() == 0
assert isinstance(form.theory_proxy, QSortFilterProxyModel)
assert form.theory_proxy.sourceModel() == form.theory_model
assert "[^()]" == str(form.theory_proxy.filterRegExp().pattern())
assert ".+" == str(form.theory_proxy.filterRegExp().pattern())
assert isinstance(form.freezeView, QTreeView)

def testWidgets(self, form):
Expand Down

0 comments on commit d4e3a80

Please sign in to comment.