Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-755

QFontDialog.getFont(...) wrong documentation on order of tuple returned

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • None
    • 5.11.0
    • Documentation, PySide
    • None

    Description

      In the documentation for QFontDialog.getFont(...) static methods, these functions show an example that indicates the tuple is returned as (ok, font), when in fact the code returns a tuple of (font, ok)

      (ok, font) = QFontDialog.getFont(self)

      The "Return type" while accurate, is also not clear what is returned in the PyTuple - and one has to resort to the (incorrect, see above) example code:

      Parameters:	parent – PySide2.QtWidgets.QWidget
      Return type:	PyTuple

      Additionally, the description body talks about the 'ok' parameter, and whether or not it is null or not - which is specific to the C++ implementation, given that Python just returns ok in the PyTuple returned.

      Both variants of getFont are affected by this.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            crmaurei Cristian Maureira-Fredes
            kkyzivat Keith Kyzivat
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes