Designing a Qt + OpenGL Application in Eclipse

I am starting a C ++ project using OpenGL and Qt for UI in eclipse. I would like to create an interface in which part of the window contains a frame for rendering OpenGL, and the rest will contain other Qt widgets, such as buttons, etc.

I have not used Qt or the GUI editor in eclipse before, and I wonder what would be the best approach? Should I create a user interface using manual coding or would it be easier to use the GUI designer for eclipse - I quickly looked through it and it seems that the OpenGL widget was not built in.

thanks

+3
source share
3 answers

If you use Qt Designer (which I think is available through Eclipse Integration), you can put the base QWidget in the layout and then “push” this widget into a QGLWidget. For this:

  • Add a QWidget to the desired location in the layout
  • Right click widget
  • Select Promote.
  • Enter QGLWidget as the class name and as the title
  • Hit Add
  • Select QGLWidget from the list of advanced widgets at the top of the dialog box.
  • Promote hit

Thus, you do not need to go through the filler route and create an additional layer.

+7
source

Why aren't you using Qt Eclipse Integration ? It works flawlessly and allows you to edit user interfaces directly from Eclipse.

0
source

I had the same issue when using Qt Designer. I used a simple frame as a placeholder for an OpenGL widget, then in the main window designer I manually created an OpenGL widget and assigned it to a placeholder frame (as a child).

The main advantage here is that you see where the OpenGL widget should be when developing your interface. The main disadvantage is that some coding is still required to configure the GUI.

0
source

Source: https://habr.com/ru/post/1392183/


All Articles