Skip to content

Commit 435c4e9

Browse files
committed
Remove platform specific members
- Windows only QtCore.QWinEventNotifier - Windows only QtAxContainer module - Windows only QtWinExtras module - Linux/X11 only QtX11Extras module
1 parent 0f25307 commit 435c4e9

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

CAVEATS.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,3 +435,49 @@ is directly using enums on Qt class names. If you used `self.EnumName` or other
435435
methods of accessing the enum objects the `--partial` check may find them. This is
436436
unable to automatically fix your code but shows you possible code that you will
437437
need to manually fix.
438+
439+
440+
#### Platform specific members
441+
442+
There are several platform specific Qt members that could be exposed by Qt.py.
443+
Qt.py is targeted at exposing members common across all supported Qt versions
444+
and platforms, so we are not including them by default.
445+
446+
- `QtCore.QWinEventNotifier`
447+
- `QtAxContainer.QAxBase` Available as `QAxContainer` in PyQt5/6.
448+
- `QtAxContainer.QAxObject` Available as `QAxContainer` in PyQt5/6.
449+
- `QtAxContainer.QAxWidget` Available as `QAxContainer` in PyQt5/6.
450+
451+
452+
##### Workaround
453+
454+
They can be added to Qt.py using QtSiteConfig.
455+
456+
457+
```python
458+
import sys
459+
460+
461+
def update_members(members):
462+
# Add windows only `QWinEventNotifier` class
463+
if sys.platform == "win32":
464+
members["QtCore"].append("QWinEventNotifier")
465+
466+
# Add the windows only QtAxContainer class
467+
members["QtAxContainer"] = [
468+
"QAxBase"
469+
"QAxObject"
470+
"QAxWidget"
471+
]
472+
473+
def update_misplaced_members(members):
474+
if sys.platform != "win32":
475+
return
476+
477+
# Correctly map the Windows only QtAxContainer misplaced in PyQtX.
478+
for binding in ("PyQt6", "PyQt5"):
479+
members[binding].setdefault("__misplaced__", []).append("QAxContainer")
480+
members[binding]["QAxContainer.QAxBase"] = "QtAxContainer.QAxBase"
481+
members[binding]["QAxContainer.QAxObject"] = "QtAxContainer.QAxObject"
482+
members[binding]["QAxContainer.QAxWidget"] = "QtAxContainer.QAxWidget"
483+
```

0 commit comments

Comments
 (0)