Qt OpenGLScene 工作示例 [英] Qt OpenGLScene working example

查看:81
本文介绍了Qt OpenGLScene 工作示例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 OpenGLScene 作为 openGL 的包装器,并且我已经开始使用 我在互联网上找到的最简单的例子.我刚刚从他们有 zip 的链接中复制了所有内容.

I'm using an OpenGLScene as a wrapper of the openGL, and I've started with the most simple example of that I've found on the internet. I've just copied everything from the link where they have a zip.

我编译并运行了程序,显然这个警告总是出现(在缺陷方法中):

I compiled and run the program, and apparently this warning is always coming up (in the drawbackground method):

if (painter->paintEngine()->type()
                != QPaintEngine::OpenGL) {
            qWarning("OpenGLScene: drawBackground needs a "
                     "QGLWidget to be set as viewport on the "
                     "graphics view");
            return;

有谁知道为什么(我在 Mac 上)?有没有人有更稳定"的例子?此警告是否相关?

Does anyone knows why (I'm on a Mac)? Does anyone has a more "stable" example? Is this warning relevant?

基本上,我想知道为什么会出现此警告,以及如何摆脱它...

Basically, I would like to know why this warning is appearing, and how can I get rid of it...

我真的不知道从哪里开始.我已经尝试了几个简单的事情(例如使 QGLWidget 成为当前的上下文),但我对 Qt 的了解不够多,无法理解调用缺陷方法的时间和方式.

I don't really know where to start. I've tried several simple things (making the QGLWidget current Context for instance), but I don't know enough Qt to understand the when and how is the drawbackground method called.

推荐答案

Qt OpenGLScene 工作示例

Qt OpenGLScene working example

"Boxes" 在 Qt 4 中的演示.启动 qtdemo, 选择演示->框.或者在线阅读全部内容.或者阅读 overpainting 的文档,HelloGL 或任何其他 OpenGL 示例.

"Boxes" demo in Qt 4. Launch qtdemo, select demonstration->boxes. Or read it all online. Either that or read documentation for overpainting, HelloGL or any other OpenGL example.

我正在尝试使用 Qt 对 OpenGL 进行包装".使用 Qt 作为 GUI,使用 OpenGL 作为可视化

I'm trying to have a "wrapper" to OpenGL using Qt. Using Qt as GUI, and OpenGL as visualization

QGLWidget

这篇关于Qt OpenGLScene 工作示例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆