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

REG->6.2.0: QIcon.addPixmap(str) no longer works

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • None
    • 6.2
    • PySide
    • None
    • All
    • 3aab0899ef4f966d3a37c0e95b0e7d0f047de3e0 (pyside/pyside-setup/dev) 1e6b06cec98f4467acfa25a95fbbcf240c3ddcf6 (pyside/pyside-setup/6.2)

    Description

      Calling QIcon.addPixmap(str) no longer works, producing:

      TypeError: 'QIcon.addPixmap' called with wrong argument types:
      QIcon.addPixmap(str)
      Supported signatures:
      QIcon.addPixmap(Union[QPixmap,QImage, str],
      QIcon.Mode =QIcon.Mode.Normal,
      QIcon.State =QIcon.State.Off)

      This was caused by "pathlib: support all cases which are found in the examples"
      10abd17ffb8826e4aa5861f89642c46c47b641a8 https://codereview.qt-project.org/c/pyside/pyside-setup/+/358423 which changed QPixmap(QString)
      to take a path-like, breaking the implicit conversion from strings.

      A workaround is to call addPixmap(QPixmap(str)).

      Further classes where the constructors were modified to take a PathLike which could be relevant for implicit conversions: QDir, QFileInfo, QPixmap, QImage.
      Ditto QFile, but that is not used for conversions.

      Attachments

        Issue Links

          Activity

            People

              ctismer Christian Tismer
              kleint Friedemann Kleint
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: