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

QskComboBox‘s problem #422

Open
hestrro opened this issue Sep 26, 2024 · 3 comments
Open

QskComboBox‘s problem #422

hestrro opened this issue Sep 26, 2024 · 3 comments
Assignees
Labels
Milestone

Comments

@hestrro
Copy link

hestrro commented Sep 26, 2024

comboBox1->setPopupOpen(true);The program crashed when I set it to true
examples\bin\gallery.exe crashed.
You can test it on gallery

@uwerat
Copy link
Owner

uwerat commented Sep 26, 2024

QskCombBox::openPopup creates a QskMenu, that has to be a top level item ( having the contentItem of the window as parentItem ). In situations, where the combo box has not been added to the scene it does not have a window and window()->contentItem() will crash.

To avoid the crash a simple check denying the call for this situation is good enough. However a user might expect, that the popup will be opened as soon as the combo box becomes visible. For this we would need to introduce some sort of flag, that indicates to do a delayed open.

For the moment you could overload QskComboBox::itemChange and do the setPopupOpen call there. Depending on your application you could also do a QTimer::singleShot to delay the opening.

@hestrro
Copy link
Author

hestrro commented Sep 26, 2024

I understand now, thank you

@uwerat
Copy link
Owner

uwerat commented Sep 26, 2024

Added the check and a related warning. A proper fix will b done later

@uwerat uwerat added the bug label Sep 26, 2024
@uwerat uwerat added this to the Qskinny 0.0.x milestone Sep 26, 2024
@uwerat uwerat self-assigned this Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants