仅使用标准C ++的图形? [英] Graphics using Standard C++ only?
问题描述
我只想知道Standard C ++是否允许GUI编程?
I just want to know whether Standard C++ allows GUI programming?
这有两个方面:
- 像窗口,对话框,按钮等UI的窗口小部件
- 绘制圆形,矩形,样条等图形
我一直在使用Qt作为UI&没有看到任何人在C ++只做GUI。
I have been using Qt for my UI & haven't seen anybody doing GUI in C++ only.
PS:我只关心C ++语言,我知道Java允许GUI编程!
PS: I am concerned with C++ language only, I know that Java allows GUI programming!
UPDATE: A new question was added here: How frameworks like Qt create GUI, if C++ has no functionality for that?
推荐答案
不,这是不可能的。 C ++可以在许多设备上工作,其中一些设备根本没有这种功能。
No, this isn't possible. C++ works on many devices, some of which simply don't have that capability.
Qt可以做到这一点,通常是因为它运行的操作系统提供的功能。它通常暴露为一组C函数,在实践中意味着它们可以通过Qt中的C ++代码调用。操作系统内部使用什么,谁知道。
Qt can do this, usually because the Operating Systems on which it runs do offer that functionality. It's usually exposed as a set of C functions, which in practice means they're callable by the C++ code in Qt. What the OS uses internally, who knows. It may even leave some of the work to the GPU nowadays.
在某些嵌入式系统上,Qt只是获取了一个指向屏幕内存的指针,并且执行了所有的像素操作本身。这不是一个解决方案,当你必须与多个应用程序共享屏幕,但对于单功能设备,它绝对有效。
And on some embedded systems, Qt just gets a pointer to the screen memory, and does all the pixel manipulations itself. That's not a solution when you have to share the screen with multiple applications, but for single-function devices it definitely works.
这篇关于仅使用标准C ++的图形?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!