diff options
Diffstat (limited to 'examples/3d/simple3d/simple3d.py')
-rw-r--r-- | examples/3d/simple3d/simple3d.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/examples/3d/simple3d/simple3d.py b/examples/3d/simple3d/simple3d.py index ab6dc0ca0..15bd1600b 100644 --- a/examples/3d/simple3d/simple3d.py +++ b/examples/3d/simple3d/simple3d.py @@ -42,11 +42,12 @@ """PySide6 port of the qt3d/simple-cpp example from Qt v5.x""" import sys -from PySide6.QtCore import(Property, QObject, QPropertyAnimation, Signal) +from PySide6.QtCore import (Property, QObject, QPropertyAnimation, Signal) from PySide6.QtGui import (QGuiApplication, QMatrix4x4, QQuaternion, QVector3D) from PySide6.Qt3DCore import (Qt3DCore) from PySide6.Qt3DExtras import (Qt3DExtras) + class OrbitTransformController(QObject): def __init__(self, parent): super().__init__(parent) @@ -91,6 +92,7 @@ class OrbitTransformController(QObject): angle = Property(float, getAngle, setAngle, notify=angleChanged) radius = Property(float, getRadius, setRadius, notify=radiusChanged) + class Window(Qt3DExtras.Qt3DWindow): def __init__(self): super().__init__() @@ -155,6 +157,7 @@ class Window(Qt3DExtras.Qt3DWindow): self.sphereEntity.addComponent(self.sphereTransform) self.sphereEntity.addComponent(self.material) + if __name__ == '__main__': app = QGuiApplication(sys.argv) view = Window() |