# How to create USD from QOpenGLWidget/OpenGL

**URL:** <https://forum.aousd.org/t/how-to-create-usd-from-qopenglwidget-opengl/522>\
**Category:** USD\
**Created:** [August 30, 2023, 12:45pm UTC](https://forum.aousd.org/t/how-to-create-usd-from-qopenglwidget-opengl/522 "2023-08-30T12:45:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![emeitz](https://avatars.discourse-cdn.com/v4/letter/e/aca169/32.png) [@emeitz](https://forum.aousd.org/u/emeitz)\
**Post date:** [August 30, 2023, 12:45pm UTC](https://forum.aousd.org/t/how-to-create-usd-from-qopenglwidget-opengl/522/1 "2023-08-30T12:45:49Z")

</div>

Hello,

I have a QOpenGLWidget in the Qt library and I was wondering if anyone has seen documentation or any examples as to how I can go from this object which contains all sorts of spheres, lighting etc. information and make it into a USD file? I might have to go through the Qt object and build the USD manually, but I feel like OpenGL/Qt are common enough frameworks that there might be some existing pipeline that I’ve missed. If someone could point me in the right direction that would be great!

Thanks

---

<div class="post-metadata">

**Author:** ![spiff](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.aousd.org/spiff/32/22_2.png) [@spiff](https://forum.aousd.org/u/spiff)\
**Post date:** [October 18, 2023, 6:15pm UTC](https://forum.aousd.org/t/how-to-create-usd-from-qopenglwidget-opengl/522/2 "2023-10-18T18:15:36Z")

</div>

Hi @emeitz, and welcome to the community! Sorry this slipped by, and I’m afraid I’m not aware of any existing Qt-to-USD converter. I also believe that QOpenGLWidget has been deprecated, and we are going to need to migrate `usdview` off of it, at some point.

---

<div class="post-metadata">

**Author:** ![BigRoyNL](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.aousd.org/bigroynl/32/413_2.png) [@BigRoyNL](https://forum.aousd.org/u/BigRoyNL)\
**Post date:** [October 19, 2023, 3:05pm UTC](https://forum.aousd.org/t/how-to-create-usd-from-qopenglwidget-opengl/522/3 "2023-10-19T15:05:53Z")

</div>

Not entirely sure that is correct. Going based off of [this](https://doc.qt.io/qt-6/opengl-changes-qt6.html) there’s indeed some deprecated Qt OpenGL things being removed - but it also specifically mentions that [QOpenGLWidgets class was moved](https://doc.qt.io/qt-6/opengl-changes-qt6.html#the-qopenglwidgets-class) and thus hints at being the ‘new style’ to use.

Mentioned [here](https://stackoverflow.com/a/58420620) which also links to older version changes for Qt:

> The Qt OpenGL module (which contain classes that start with “QGL”) is now deprecated in favor of the Qt GUI module (which contain classes that start with “QOpenGL”). QGLWidget can now be replaced by QOpenGLWidget.

It seems that [usdview uses `QGLWidget`](https://github.com/PixarAnimationStudios/OpenUSD/blob/release/pxr/usdImaging/usdviewq/stageView.py#L667) so it indeed would need refactoring, yes. But that’d make:

- `QGLWidget` deprecated and already removed in recent Qt
- `QOpenGLWidget` its successor?
