diff options
Diffstat (limited to 'examples/widgets/rhi/simplerhiwidget/main.py')
-rw-r--r-- | examples/widgets/rhi/simplerhiwidget/main.py | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/examples/widgets/rhi/simplerhiwidget/main.py b/examples/widgets/rhi/simplerhiwidget/main.py new file mode 100644 index 000000000..59be81ddc --- /dev/null +++ b/examples/widgets/rhi/simplerhiwidget/main.py @@ -0,0 +1,35 @@ +# Copyright (C) 2024 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +"""PySide6 port of the Qt Simple RHI Widget Example example from Qt v6.x""" + +import sys + +from PySide6.QtWidgets import QApplication, QVBoxLayout, QWidget + +from examplewidget import ExampleRhiWidget +import rc_simplerhiwidget # noqa F:401 + + +class Widget(QWidget): + + def __init__(self, parent=None): + super().__init__(parent) + layout = QVBoxLayout(self) + self._rhi_widget = ExampleRhiWidget(self) + layout.addWidget(self._rhi_widget) + + def closeEvent(self, e): + self._rhi_widget.releaseResources() + e.accept() + + +if __name__ == "__main__": + app = QApplication(sys.argv) + + w = Widget() + w.resize(1280, 720) + w.show() + exit_code = app.exec() + del w + sys.exit(exit_code) |