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

MNT: update enum-button widget's button-group to use proper clicked signal, avoid pyside6 error #1196

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nstelter-slac
Copy link
Collaborator

@nstelter-slac nstelter-slac commented Mar 13, 2025

Calling signal without overloaded int and expecting a button object back, is whats specified in qt5 docs:
https://doc.qt.io/qt-5/qbuttongroup.html#buttonClicked.

This is the same in the qt6 docs, and pyside6 even throws error if signal is not used in this correct way.

Also i think its the newer python im running with pyside6 that doesn't like using enums to index into an array, so use a map for 'class_for_type' instead.
(using the enum's '.value' should also allow for indexing into an array, but imo using the map is more readable.)

@nstelter-slac nstelter-slac added the pyside6 for adding pyside6 (qt6) support label Mar 13, 2025
signal, avoid pyside6 error

Calling signal without overloaded int and expecting a button object back,
is whats specified in qt5 docs:
https://doc.qt.io/qt-5/qbuttongroup.html#buttonClicked.

This is the same in the qt6 docs, and pyside6 even throws error if signal is not
used in this correct way.

Also seems like the newer python in running pyside6 on doesn't like using enums
to index into an array, so use a map for 'class_for_type' instead.
(using the enum's '.value' should allow for indexing into an array, but imo using the map is more readable.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pyside6 for adding pyside6 (qt6) support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant