定义按钮在OpenGL窗口 [英] Defining buttons in OpenGL-window
问题描述
我的问题是,如果有可能一个OpenGL窗口上显示的按钮。正如你可以在图片中看到我在主窗口中两个较小的创建。正确的灰色角落被指定为按钮(标有红色矩形)。这是我使用Qt之前创建。现在我看到的Qt总是在窗口边框创建按钮。是否有可能把我的按钮在这个红色的矩形?
我使用的是Mac电脑。
My question is, if it is possible to display buttons on an opengl-window. As you can see on the picture I have created in the main window two smaller ones. The right grey corner is designated for the buttons(marked with a red rectangle). This I created before using Qt. Now I see that Qt is always creating the buttons at the border of the window. Is it possible to place my buttons in this red rectangle? I am using a mac.
推荐答案
是的。在code,设置含有小部件作为其构造部件包含的家长或使用调用setParent()
它已经被构造之后。
Yes. In code, set the containing widget as the parent of the contained widget in its constructor or use setParent()
after it has already been constructed.
这篇关于定义按钮在OpenGL窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!