Skip to content

Commit 2eb22d9

Browse files
committedOct 25, 2018
[BUGFIX][DbManager] SQL Layer: fix unique combo setting in QGIS 3
When opening Update SQL layer, the unique combobox is not well set specifically with oracle. It's a forward porting of #7872 Funded by Ifremer
1 parent 0bd1b7a commit 2eb22d9

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed
 

‎python/plugins/db_manager/dlg_sql_layer_window.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,8 @@ def __init__(self, iface, layer, parent=None):
177177
item.setCheckState(Qt.Checked)
178178
else:
179179
keyColumn = uri.keyColumn()
180-
for item in self.uniqueModel.findItems("*", Qt.MatchWildcard):
181-
if item.data() == keyColumn:
182-
self.uniqueCombo.setCurrentIndex(self.uniqueModel.indexFromItem(item).row())
180+
if self.uniqueModel.findItems(keyColumn):
181+
self.uniqueCombo.setEditText(keyColumn)
183182

184183
# Finally layer name, filter and selectAtId
185184
self.layerNameEdit.setText(layer.name())

0 commit comments

Comments
 (0)
Please sign in to comment.