在Eclipse中设计一个Qt + OpenGL应用程序 [英] Designing a Qt + OpenGL application in Eclipse
问题描述
我在eclipse中使用OpenGL和Qt为UI启动一个C ++项目。我想创建一个UI,其中窗口的一部分包含一个用于OpenGL渲染的框架,其余的将包含其他Qt小部件,如按钮等。
我没有在eclipse中使用Qt或GUI编辑器,我想知道最好的方法是什么?我应该通过手工编码创建UI,或者更容易使用eclipse的GUI设计器 - 我有一个快速的看看这里,似乎没有一个内置的OpenGL小部件。
感谢
如果您使用Qt Designer(我认为可以通过Eclipse集成)放置一个基本的QWidget在布局,然后提升该小部件到一个QGLWidget。要执行此操作:
- 将QWidget添加到布局中所需的位置
- 右键单击
- 选择促销至
- 输入QGLWidget作为类名和标题 >点击添加
- 从对话框顶部的宣传窗口小部件列表中选择QGLWidget
- >
这样,您不必通过占位符路径创建额外的图层。 p>
I'm starting a C++ project using OpenGL and Qt for the UI in eclipse. I would like to create a UI where a portion of the window contains a frame for OpenGL rendering and the rest would contain other Qt widgets such as buttons and so on.
I haven't used Qt or the GUI editor in eclipse before and I'm wondering what the best approach would be? Should I create the UI by hand coding or would it be easier to use eclipse's GUI designer - I had a quick look at this and there doesn't seem to be an OpenGL widget built in.
Thanks
If you are using Qt Designer (which I think is available via Eclipse Integration), you can place a base QWidget in the layout and then "promote" that widget to a QGLWidget. To do this:
- Add the QWidget to the desired place in the layout
- Right-click on the widget
- Select "Promote To"
- Enter QGLWidget as the class name and as the header
- Hit Add
- Select the QGLWidget from the list of promoted widgets at the top of the dialog
- Hit Promote
This way you don't have to go through the placeholder route and create an additional layer.
这篇关于在Eclipse中设计一个Qt + OpenGL应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!