Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid crash with read only QgsCheckableComboBox #47330

Merged
merged 2 commits into from Feb 13, 2022

Conversation

m-kuhn
Copy link
Member

@m-kuhn m-kuhn commented Feb 13, 2022

Reported in the mailing list by @ghtmtt

Hi all,

I'm using a QgsCheckableComboBox in an UI of a plugin. If I use the flag
setEditable = False, bot from UI or from code, QGIS simply explodes
(3.16 from package, 3.23 compiled on a Debian sid OS).

What is strange, at least for me, is that even by using in a python
console the following code, QGIS explodes:

c = QgsCheckableComboBox()
c.setEditable(False)
c.show()

while without the c.setEditable(False) no problem and also the following
code is working nice:

c = QComboBox()
c.setEditable(False)
c.show()

Not sure if it is something related to my system. Should I file a ticket?

Thanks!

The Qt docs say https://doc.qt.io/qt-5/qcombobox.html#lineEdit

Returns the line edit used to edit items in the combobox, or nullptr if there is no line edit.

Only editable combo boxes have a line edit.

@github-actions github-actions bot added this to the 3.24.0 milestone Feb 13, 2022
@nyalldawson
Copy link
Collaborator

Is this easy to catch in a test?

@m-kuhn m-kuhn changed the title Avoid crash with in-editable QgsCheckableComboBox Avoid crash with read only QgsCheckableComboBox Feb 13, 2022
@m-kuhn
Copy link
Member Author

m-kuhn commented Feb 13, 2022

Should be safe to bypass the extra patch release

@nyalldawson
Copy link
Collaborator

unrelated CI failure

@ghtmtt
Copy link
Contributor

ghtmtt commented Feb 14, 2022

thanks @m-kuhn for the fix!

@m-kuhn m-kuhn deleted the combobox_crash branch February 14, 2022 07:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants