Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. PySide6 incorrect prototype QFontDialog.getFont()
Qt 6.11 is out! See what's new in the release blog

PySide6 incorrect prototype QFontDialog.getFont()

Scheduled Pinned Locked Moved Unsolved Qt for Python
2 Posts 2 Posters 292 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • ErriezE Offline
    ErriezE Offline
    Erriez
    wrote on last edited by
    #1

    QFontDialog function `getFont() documentation describes prototype:

    static PySide6.QtWidgets.QFontDialog.getFont([parent=None])

    with return type PyTuple which is not explained and incorrect in the example:

    Example:

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

    Reverse engineered code works:

    ok, font = QFontDialog.getFont()
    if ok:
        self.label.setFont(font)
    

    QInputDialog.getText() documentation describes return type str instead of PyTyple:

    text, ok = QInputDialog.getText(self, 'Input Dialog', 'Enter your name:')
    

    Notice the inconsistency of ok, font and text, ok.

    Am I correct that the documentation needs to be fully reviewed and updated? I could not find a QFontDialog example.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      The documentation is, at least partially, generated out of the C++ version which triggers that kind of issue. You should check the bug report system and open an issue there if none already exists about this.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved