简体   繁体   English

使用no-angle和-no-opengl编译Qt时会发生什么?

[英]What happens when Qt is compiled with no-angle and -no-opengl?

Recently I tried to compile my Qt static libraries with both -no-angle and -no-opengl . 最近我尝试用-no-angle-no-opengl编译我的Qt静态库。 I first thought that it would not compile. 我首先想到它不会编译。 But unexpectedly, Qt (5.7) compiled just fine. 但出乎意料的是,Qt(5.7)编译得很好。 I could also compile my application (using many QtWidgets). 我也可以编译我的应用程序(使用许多QtWidgets)。

To my surprise I could not see any difference with my Angle based Qt app. 令我惊讶的是,我发现基于角度的Qt应用程序没有任何区别。 No lags, no glitches, my QtCharts were displaying as always. 没有滞后,没有故障,我的QtCharts一如既往地展示。

I could not find any definitive answer on the web. 我在网上找不到任何明确的答案。 but I have two guesses: 但我有两个猜测:

  • I was not really using any hardware acceleration after all. 毕竟我并没有真正使用任何硬件加速。
  • There is a mysterious fallback mechanism. 有一种神秘的后备机制。

What is going on here ? 这里发生了什么 ?

What happens? 怎么了? In your case nothing. 在你的情况下没有。 Qt widgets don't use OpenGL behind your back. Qt小部件不会在你背后使用OpenGL。 You have to explicitly force its use in a given widget stack by using the QOpenGlWidget as the top level widget. 您必须使用QOpenGlWidget作为顶级窗口小部件,在给定的窗口小部件堆栈中显式强制使用它。 By default, you're using the CPU-based raster rendering backend - as you noted, it performs quite well. 默认情况下,您使用的是基于CPU的光栅渲染后端 - 如您所述,它表现非常好。

Compiling Qt without angle and OpenGL support is a good way to make your application smaller if you don't use OpenGL :) 如果你不使用OpenGL,编译没有角度和OpenGL支持的Qt是一个很好的方法,可以减少你的应用程序:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM