Bug report #18068

QGIS-dev crashes after PyQt5 QComboBox.clear()

Added by Ondrej Remes about 2 years ago. Updated about 1 year ago.

Status:Closed
Priority:High
Assignee:-
Category:Python bindings / sipify
Affected QGIS version:2.99(master) Regression?:No
Operating System:Windows 10 64bit professional Easy fix?:No
Pull Request or Patch supplied:No Resolution:no timely feedback
Crashes QGIS or corrupts data:Yes Copied to github as #:25964

Description

Hello, when i can clear item list in QComboBox used in custom attribute form, Qgis crashes without debug informations! Same situation occurs when i can remove items by QComboBox.removeItem() calling.

vloz_kere.ui (12.5 KB) Ondrej Remes, 2018-02-10 09:11 AM

History

#1 Updated by Nyall Dawson about 2 years ago

  • Status changed from Open to Feedback

Can you share the form?

#2 Updated by Ondrej Remes about 2 years ago

okey, in attachment.

#3 Updated by Alessandro Pasotti about 2 years ago

Cannot reproduce on master/linux with Qt 5.9.3

#4 Updated by Ondrej Remes about 2 years ago

I'm sending part of code:

def vloz_kere(dialog, layer, feature):
  global myDialog
  myDialog = dialog
  fTAXON = dialog.findChild(QComboBox, "TAXON")
    fTAXON.editTextChanged.connect(refresh_combo)

def refresh_combo():
    fTAXON = myDialog.findChild(QComboBox, "TAXON")
    if fTAXON.count() is None or fTAXON.count() == 0 :
        pass
    else:
        fTAXON.clear() 
    for key, value in druh.items():
        if str(fTAXON.currentText()) in value:
            fTAXON.addItem(value)

I try add condition for first use (fTAXON.count() is None or 0) but problem is not finished. Qgis frozes and be shutdown with no debug infrormations.

#5 Updated by Ondrej Remes about 2 years ago

The problem occurs after start attribute form when i try type something in combobox, cursor is freeze for 3 - 4 seconds and the application crashes.

#6 Updated by Denis Rouzaud about 2 years ago

  • Assignee deleted (Denis Rouzaud)

#7 Updated by Giovanni Manghi about 2 years ago

  • Status changed from Feedback to Open
  • Affected QGIS version changed from master to 2.99(master)
  • Crashes QGIS or corrupts data changed from No to Yes

#8 Updated by Jürgen Fischer about 1 year ago

  • Status changed from Open to Feedback

Please test with QGIS 3.4 - QGIS 2.18 reached it's end of life.

#9 Updated by Nyall Dawson about 1 year ago

  • Resolution set to no timely feedback
  • Status changed from Feedback to Closed

Also available in: Atom PDF