Set a placeholder text for cityEdit only if the user's version of Qt supports it. fixes #832
This commit is contained in:
parent
5daf71effe
commit
9851a675d5
2 changed files with 4 additions and 5 deletions
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -56,11 +56,7 @@
|
|||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="cityEdit">
|
||||
<property name="placeholderText">
|
||||
<string>Press enter to search city</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLineEdit" name="cityEdit"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QListWidget" name="resultsList"/>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue