QComboBox.findData() compatible with pyside

This commit is contained in:
Dmitri Bogomolov 2018-02-23 15:42:50 +02:00
parent 59049f8e8b
commit 39fe1b8e9f
Signed by untrusted user: g1itch
GPG Key ID: 720A756F18DEED13

View File

@ -99,10 +99,11 @@ def createSupportMessage(myapp):
return return
myapp.ui.lineEditSubject.setText(SUPPORT_SUBJECT) myapp.ui.lineEditSubject.setText(SUPPORT_SUBJECT)
addrIndex = myapp.ui.comboBoxSendFrom.findData( # addrIndex = myapp.ui.comboBoxSendFrom.findData(
address, QtCore.Qt.UserRole, # address, QtCore.Qt.UserRole,
QtCore.Qt.MatchFixedString | QtCore.Qt.MatchCaseSensitive # QtCore.Qt.MatchFixedString | QtCore.Qt.MatchCaseSensitive
) # )
addrIndex = myapp.ui.comboBoxSendFrom.findData(address)
if addrIndex == -1: # something is very wrong if addrIndex == -1: # something is very wrong
return return
myapp.ui.comboBoxSendFrom.setCurrentIndex(addrIndex) myapp.ui.comboBoxSendFrom.setCurrentIndex(addrIndex)