Qt OpenGL 示例

多个3D对象散布在屏幕上的截图

这些示例说明了如何使用 Qt OpenGL 模块。

Qt 支持与 OpenGL 实现的集成,使开发者能够将硬件加速的 3D 图形与更传统的用户界面结合显示。

这些示例演示了在 Qt 应用程序中利用 Qt OpenGL 的基本技术。

2D Painting Example

“2D 绘图”示例展示了如何将 QPainter 和 QOpenGLWidget 结合使用,在支持的硬件上显示经过加速的 2D 图形。

Cube OpenGL ES 2.0 example

演示了如何根据用户输入手动旋转一个带有纹理的 3D 立方体。

Hello GL2 Example

“Hello GL2”示例演示了 Qt OpenGL 相关类的基本用法。

Hello GLES3 Example

通过 QOpenGLExtraFunctions 演示 OpenGL ES 3.0 函数。

OpenGL Window Example

本示例展示了如何创建一个基于 QWindow 的最简应用程序,以便使用 OpenGL。

QOpenGLWidget Stereoscopic Rendering Example

本示例展示了如何创建一个支持立体渲染的、基于 QOpenGLWidget 的最简应用程序。

Textures Example

“纹理”示例演示了如何在同时使用 Qt OpenGL 和 Qt 显示图形的应用程序中,将 Qt 的图像类用作纹理。

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.