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

QFont.StyleStrategy values convert to int when bitwise or'd

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 6.5.0, 6.4.2
    • 1.2.2, 1.2.x
    • PySide
    • e5976250c (dev), 7e5c6241a (6.4)

    Description

      The following code will fail because QFont.setStyleStrategy cannot take an int.

       

       

      from PySide2 import QtGui, QtWidgets
      
      app = QtWidget.QApplication([])
      
      fdb = QtGui.QFontDatabase()
      font = fdb.font("Arial", "Regular", app.font().pointSize() + 1)
      
      
      # Works
      font.setStyleStrategy(QtGui.QFont.PreferAntialias)
      # Works
      font.setStyleStrategy(QtGui.QFont.PreferQuality)
      
      # Breaks
      font.setStyleStrategy(QtGui.QFont.PreferAntialias | QtGui.QFont.PreferQuality)

      The bitwise OR of PreferAntialias and PreferQuality returns the int 192.

       

      To get it to work I think I can just instantiate a QFont.StyleStrategy with the result of the OR but it would be nice if this op could be implemented.

       

      Attachments

        Issue Links

          For Gerrit Dashboard: PYSIDE-628
          # Subject Branch Project Status CR V

          Activity

            People

              ctismer Christian Tismer
              ahuge Alex Hughes
              Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes