Commit ca10b0dd authored by Golovanov's avatar Golovanov Committed by darrenl
Browse files

add completer for label

parent 357018b7
...@@ -15,10 +15,18 @@ class LabelDialog(QDialog): ...@@ -15,10 +15,18 @@ class LabelDialog(QDialog):
def __init__(self, text="Enter object label", parent=None, listItem=None): def __init__(self, text="Enter object label", parent=None, listItem=None):
super(LabelDialog, self).__init__(parent) super(LabelDialog, self).__init__(parent)
self.edit = QLineEdit() self.edit = QLineEdit()
self.edit.setText(text) self.edit.setText(text)
self.edit.setValidator(labelValidator()) self.edit.setValidator(labelValidator())
self.edit.editingFinished.connect(self.postProcess) self.edit.editingFinished.connect(self.postProcess)
model = QStringListModel()
model.setStringList(listItem)
completer = QCompleter()
completer.setModel(model)
self.edit.setCompleter(completer)
layout = QVBoxLayout() layout = QVBoxLayout()
layout.addWidget(self.edit) layout.addWidget(self.edit)
self.buttonBox = bb = BB(BB.Ok | BB.Cancel, Qt.Horizontal, self) self.buttonBox = bb = BB(BB.Ok | BB.Cancel, Qt.Horizontal, self)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment