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

Differences between QFontDialog.getFont() in PyQt vs. PySide #417

Open
mdsandell opened this issue Jul 4, 2024 · 1 comment
Open

Differences between QFontDialog.getFont() in PyQt vs. PySide #417

mdsandell opened this issue Jul 4, 2024 · 1 comment

Comments

@mdsandell
Copy link

It appears that in PyQt4 and 5, QFontDialog.getFont returns a tuple of (font, ok), but in PySide 1 and 2, that result is reversed to (ok, font).

Here's how I'm working around it for now:

result = QFontDialog.getFont(self.docFont, self, "Select Font")
if Qt.IsPyQt4 or Qt.IsPyQt5:
    font, ok = result
else:
    ok, font = result

I couldn't find anything documented about this difference in behavior other than literally comparing the method signatures in the docs for the libraries.

@mottosso
Copy link
Owner

We could offer a QtCompat.getFont() alternative for this, PR welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants