窗口需要QT OpenGL for Desktop吗? [英] QT OpenGL for Desktop required for windowing?
问题描述
我不确定是否在不支持OpenGL的情况下编译QT 5.2.1.我一直以为希望做图形的应用程序需要OpenGL,但是当我阅读文档时,也谈到了桌面功能上的2D.如果我不打算使用任何图形,而只想使用QT的窗口框架,我是否仍需要该桌面支持? 以某种方式将其作为必需的可选组件是没有意义的,但是我真的不知道是否需要它,因为我不知道该支持将用于什么目的.
I'm a bit unsure about compiling QT 5.2.1 without OpenGL support. I always thought that OpenGL would be needed for application which wish to do graphics, but when I read the documentation there is talk about 2D on Desktop functionality as well. If I don't plan to use any graphics and just want to make use of the windowing framework of QT, do I still need that desktop suport? Somehow this wouldn't make sense to allow it as an optional component it were required but I don't really know if it is required anyway, because I don't know what this support would be used for.
所以主要问题是,如果我只想实现一个使用Windows和窗口小部件的常规桌面应用程序,则不需要使用OpenGL支持进行编译,对吗?
So the primary question is, if I just want to implement a regular desktop application which uses windows and widgets, I don't need to compile with OpenGL support, right?
到目前为止,我已经将wxWidgets用作跨平台库,并且不需要接触OpenGL,因此我将以相同的方式使用QT.
I have used wxWidgets as my cross platform library so far, and never needed to touch OpenGL, so I would use QT in the same way.
推荐答案
如果我只想实现一个使用Windows和窗口小部件的常规桌面应用程序,则不需要使用OpenGL支持进行编译,对吗?
if I just want to implement a regular desktop application which uses windows and widgets, I don't need to compile with OpenGL support, right?
我认为答案是肯定的.尽管在应用程序级别,例如此线程从Qt 5开始专门调用不再使用栅格子系统-graphicssystem raster
的图形子系统,您可以设置窗口的表面类型到RasterSurface
,允许使用QBackingStore
(非OpenGL绘图上下文)在没有OpenGL支持的情况下使用栅格进行渲染; 其API文档对此进行了确认. QWindow
的文档也会对此进行简要介绍. /p>
I think the answer is yes; although at the app level, like this thread specifically calls out, from Qt 5 onwards setting the graphic subsystem to raster -graphicssystem raster
is deprecated, you can set the window's surface type to RasterSurface
, which allows rendering using raster without OpenGL support using QBackingStore
(a non-OpenGL drawing context); its API doc confirms this. QWindow
's documentation also briefs this.
如果我不打算使用任何图形而只想使用QT的窗口框架,我是否仍需要桌面支持?
If I don't plan to use any graphics and just want to make use of the windowing framework of QT, do I still need that desktop suport?
是的,如果您需要 QML和Qt5的QtQuick 2呈现器或专门使用OpenGL 的QtGui,它是Qt图形系统的核心部分.不,如果您没有这些,便可以做到.这个Qt 5 光栅窗口示例确实做到了这一点;您会注意到项目文件中没有提及OpenGL.
Yes, if you need QML and Qt5's QtQuick 2 render or QtGui which exclusively use OpenGL and is a core part of the Qt's graphics system. No, if you can do it without any of those. This Qt 5 Raster Window sample does exactly that; you can notice that the project file has no mention of OpenGL in it.
这篇关于窗口需要QT OpenGL for Desktop吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!