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

    • Type: Bug
    • Status: Reported
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 1.2.2, 1.2.x, dev
    • Fix Version/s: None
    • Component/s: PySide
    • Labels:

      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

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

          Activity

            People

            • Assignee:
              ctismer Christian Tismer
              Reporter:
              ahuge Alex Hughes
            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:

                Gerrit Reviews

                There are no open Gerrit changes