Set a placeholder text for cityEdit only if the user's version of Qt supports it. fixes #832

This commit is contained in:
Clément Schreiner 2012-03-25 10:33:49 +02:00
commit 9851a675d5
2 changed files with 4 additions and 5 deletions

View file

@ -41,6 +41,9 @@ class QueryDialog(QDialog):
self.connect(self.ui.citiesList, SIGNAL('itemDoubleClicked(QListWidgetItem*)'), self.removeCity)
self.connect(self.ui.buttonBox, SIGNAL('accepted()'), self.okButton)
if hasattr(self.ui.cityEdit, "setPlaceholderText"):
self.ui.cityEdit.setPlaceholderText("Press enter to search city")
def keyPressEvent(self, event):
"""
Disable handler <Enter> and <Escape> to prevent closing the window.