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

BoxLayoutHfw for PySide6 #339

Closed
jamesdbrock opened this issue Feb 25, 2024 · 6 comments
Closed

BoxLayoutHfw for PySide6 #339

jamesdbrock opened this issue Feb 25, 2024 · 6 comments

Comments

@jamesdbrock
Copy link

jamesdbrock commented Feb 25, 2024

Hi @RudolfCardinal I read your StackOverflow answer about QLabel with rich text https://stackoverflow.com/questions/14238138/heightforwidth-label/41676092#41676092 and I'm convinced that your approach is the best.

I would like to use your layouts in PySide6 and PyQt6.

https://github.com/ucam-department-of-psychiatry/camcops/blob/master/tablet_qt/layouts/

Do you know if there is a Python wrapper for your layouts published anywhere?

@RudolfCardinal
Copy link
Collaborator

Thanks (and for catching the broken link)! Yes, it's a challenge. I suspect the Qt layouts were designed mainly for "constant aspect ratio" height-for-width widgets, with height proportional to width, rather than "(approximately) constant area" ones, where height is inversely proportional to width, and it's a particular challenge for text because the relationship isn't so simple. Anyway, I'm afraid I'm not aware of any PySide or PyQt support for our versions. I presume the wrappers themselves are not likely to be too complex. However, I guess that maintaining an extension to the Python tools for an unsupported extension to Qt may be challenging in the long run. I don't know whether the Qt team would accept this kind of modification into the core product, but I imagine that'd have the highest chance of long-term integration. (Closing here but maybe a thing to raise with Qt?)

@jamesdbrock
Copy link
Author

I doubt Qt would respond. I think it would be best for someone to publish a Python library with bindings to your C++ widgets and layouts. https://doc.qt.io/qtforpython-6/shiboken6/index.html

@jamesdbrock
Copy link
Author

Your widgets and layouts are GPLv3 licensed, which means non-GPL projects cannot depend on them. Would you be willing to republish

with an LGPL license instead of GPLv3?

@RudolfCardinal
Copy link
Collaborator

@martinburchell Any complications with doing this that you can foresee? I think the original Qt code (license as quoted in our files) gives the option of GPL3 or LGPL3. Not obviously easier to split this into a separate repository. We could just change the license for this small set of files.

@RudolfCardinal
Copy link
Collaborator

Relevant files easily discoverable via find . -type f -exec egrep -l "(OPTIONAL LGPL)|(BSD LICENSE)" {} \;

@RudolfCardinal
Copy link
Collaborator

Done.

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

No branches or pull requests

2 participants