Added autocompletion to the Authors combobox.

This commit is contained in:
Raoul Snyman 2010-04-19 07:22:56 +02:00
parent 5708528ba0
commit 7e747f7cc9
2 changed files with 6 additions and 1 deletions

View File

@ -135,7 +135,7 @@ class Ui_EditSongDialog(object):
sizePolicy.setHeightForWidth(
self.AuthorsSelectionComboItem.sizePolicy().hasHeightForWidth())
self.AuthorsSelectionComboItem.setSizePolicy(sizePolicy)
self.AuthorsSelectionComboItem.setEditable(False)
self.AuthorsSelectionComboItem.setEditable(True)
self.AuthorsSelectionComboItem.setInsertPolicy(
QtGui.QComboBox.InsertAlphabetically)
self.AuthorsSelectionComboItem.setSizeAdjustPolicy(

View File

@ -122,6 +122,11 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
def loadAuthors(self):
authors = self.songmanager.get_authors()
authorsCompleter = QtGui.QCompleter(
[author.display_name for author in authors],
self.AuthorsSelectionComboItem)
authorsCompleter.setCaseSensitivity(QtCore.Qt.CaseInsensitive);
self.AuthorsSelectionComboItem.setCompleter(authorsCompleter);
self.AuthorsSelectionComboItem.clear()
for author in authors:
row = self.AuthorsSelectionComboItem.count()