Skip to content

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

@mdsandell

Description

@mdsandell

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions