@MrAWD
Using PyCharm as the IDE results in the same behaviour: although the program runs fine the editor claims Qt.LeftButton is an "unresolved attribute reference" and you cannot "follow" it to find any further information.
At Qt6 PySide6 enum Flags were moved from all appearing in the "global" Qt class and being implemented in Shiboken to being true Python enums in a specific class like Qt.MouseButton. You are supposed to change over your existing code to use the new definitions.
However Doing a Smooth Transition from the Old Enums explains
Changing all the enum code to suddenly use the new syntax is cumbersome and error-prone, because such necessary changes are not easy to find. Therefore a forgiveness mode was developed:
The forgiveness mode allows you to continue using the old constructs but translates them silently into the new ones. If you for example write
[...]
you get in reality a construct that mimics the following code which is the recommended way of writing Flags and Enums:
[...]
This has the effect that you can initially ignore the difference between old and new enums, as long as the new enums are properties of classes.
See also https://doc.qt.io/qtforpython-6/considerations.html#enums-behavior-in-pyside and https://doc.qt.io/qtforpython-6/developer/enumfeatures_doc.html#the-set-of-enum-features.
I have not looked into it further, but whatever that forgiveness mode does it must be enough to make the code work correctly when run but must create the definition or whatever "dynamically at runtime" such that IDEs like PyCharm or your Eclipse do not evaluate it, know nothing about it and hence complain it is "undefined".
Note that this is a PySide6 feature only: if try the code under PyQt6 I get the AttributeError on Qt.RightButton.
To help you spot all the changed definitions and upgrade you could either (a) use the links above to tell PySide6 not to do the forgiveness mode and hence error at runtime like PyQt6 does or (b) in the solution at Migrating to Qt6/PyQt6: what are all the deprecated short-form names in Qt5? someone has written a script:
I wrote a script to extract all the short-form and corresponding fully qualified enum names from the PyQt6 installation. It then does the conversions automatically:
Similarly there is PyQtEnumConverter 1.0.
Although these are PyQt-specific you might either adapt them or take inspiration from their code to achieve similar for PySide.