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

QSlider TickPosition enum no longer supports operands | and &

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • Not Evaluated
    • None
    • 6.7.1, 6.7.2
    • PySide
    • None
    • Python 3.12.2 (CPython)
      Windows 10
    • Windows

    Description

      I cannot compare the tick position enums with the bitwise operators & and | anymore after upgrading from 6.6.1 to 6.7.2

      Minimal Reproducible example:

      from PySide6.QtWidgets import QSlider
      
      if __name__ == "__main__":
          ticks = QSlider.TickPosition.TicksBothSides #0x3
          if ticks & QSlider.TickPosition.TicksAbove: #0x1
              print("TicksAbove")
          if ticks & QSlider.TickPosition.TicksBelow: #0x2
              print("TicksBelow")
      

      Gives the error:

      Traceback (most recent call last):
        File "\qslider-Tickpos_min_repr.py", line 7, in <module>
          if ticks & QSlider.TickPosition.TicksAbove:
             ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      TypeError: unsupported operand type(s) for &: 'TickPosition' and 'TickPosition'
      

      I feel like this should be possible.

      Attachments

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

        Activity

          People

            crmaurei Cristian Maureira-Fredes
            exxec Raphael Kriegl
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes