This also seems to do the job for the most part. When you actually do a completion it replaces the text in the line edit so more work might be needed or special handling on the line edit side would have to be implemented
def __init__(self, parent=None):
self.terms = []
def setTerms(self, terms):
self.model().setStringList(terms)
def splitPath(self, path):
raw_values = str(path).split(",")
values = [val.strip() for val in raw_values if val.strip()]
if len(raw_values) != len(values):
return [path]
return [values[-1]]
class QdTermCompleter(QtGui.QCompleter):
def __init__(self, parent=None):
QtGui.QCompleter.__init__(self, [], parent)
self.terms = []
def setTerms(self, terms):
self.model().setStringList(terms)
def splitPath(self, path):
raw_values = str(path).split(",")
values = [val.strip() for val in raw_values if val.strip()]
if len(raw_values) != len(values):
return [path]
return [values[-1]]
To copy to clipboard, switch view to plain text mode
Bookmarks