Questions tagged [qtopengl]

The QtOpenGL module offers classes that provide a C++ interface to OpenGL in Qt applications.

OpenGL is a standard API for rendering 3D graphics. OpenGL only deals with 3D rendering and provides little or no support for GUI programming issues. The user interface for an OpenGL application must be created with another toolkit, such as Motif on the X platform, Microsoft Foundation Classes (MFC) under Windows, or Qt on both platforms.

Note: OpenGL is a trademark of Silicon Graphics, Inc. in the United States and other countries.

The Qt OpenGL module makes it easy to use OpenGL in Qt applications. It provides an OpenGL widget class that can be used just like any other Qt widget, except that it opens an OpenGL display buffer where you can use the OpenGL API to render the contents.

Reference: http://qt-project.org/doc/qt-4.8/qtopengl.html

98 questions
2
votes
1 answer

Qt 5.5.1: Cannot find -lGL

I have developed an GUI application on Qt 5.3.1. I am using Qt Creator 3.1.2 (based on Qt 5.3.1) to build my GUI application and am able to build and deploy my application successfully. I wanted to update my qt creator and for that I have installed…
user12345
  • 661
  • 8
  • 34
2
votes
0 answers

Multiple Vertex Array Objects: Proper way to display multiple primitives?

I'm having a hard time getting multiple vertex array objects to render multiple primitives. Nearly all the OpenGL tutorials I've found online show using only a single VAO, so I'm not sure what I might be doing wrong. I'm using Qt-OpenGL and trying…
Tahsin M
  • 129
  • 2
  • 7
2
votes
0 answers

Qt Rectangle over QQuickItem not rendered properly

I have a painful issue in QT5 using QQuickItem. I had to draw a 3D model using pure openGL in QML, so I created my own custom QQuickItem. Untill now everything works as expected: the 3D model is beautifully displayed in QML. The problem appears when…
Ispas Claudiu
  • 1,890
  • 2
  • 28
  • 54
2
votes
2 answers

Multi-texturing using QOpenGLTexture and QOpenGLFrameBufferObject

I’m trying to port a previous project to the new Qt5 OpenGL classes. I want to render to a texture using an FBO. The previous code utilized multiple textures which I attaching to the FBO on-demand. So, I would attach a certain texture object,…
informer2000
  • 399
  • 6
  • 20
2
votes
0 answers

How to fix QTGLWidget using QTimer to decrease rendering time?

I am currently using QtOpenGL for my program. My program plots dots in the 3D space. These dots could be any number between one to several thousand. I am using the function, 'glusphere', for drawing the sphere to represent each dot. With this, each…
1
vote
2 answers

QPainter effects were removed when rendering a QOpenGLWidget into a QPixmap

I have a QOpenGLWidget that does some OpenGL rendering and some non-OpenGL rendering using a QPainter. The widget looks OK but when I try to create a screenshot of the widget by rendering it into a QPixmap, suddenly all effects that are painted…
ali mostafavi
  • 91
  • 1
  • 7
1
vote
1 answer

Qt + OpenGL. Example from Qt documentation doesnt't work

I'm trying to use Qt and OpenGL for my educational project. First step that I've done - I found the openglwindow example in Qt documentation and just copied it to understand how this stuff should work. This example: example with explanations And all…
vadyaov
  • 13
  • 3
1
vote
0 answers

Alleviating input latency for implementation of QOpenGLWidget

I am implementing a custom QOpenGLWidget in Qt6 and have overridden paintGL() and mouseMoveEvent() to render a triangle that follows the movement of the mouse. However, I notice that the triangle is always lagging a frame or more "behind" the…
Mr. Developerdude
  • 9,118
  • 10
  • 57
  • 95
1
vote
1 answer

QOpenGLWidgets do not draw anything in application but draw normally in RenderDoc Frame Capture

I made a Qt Application to preview 3D model. I use QOpenGLWidget to draw the triangles, with the core profile OpenGL v3.3. The shader compiler does not output any errors, and application run successfully, and everything seems like work. Here are the…
Kpure1000
  • 11
  • 3
1
vote
0 answers

Couldn't render OpenGLES context in Qt

I am trying to use OpenGLES in a desktop platform. I have a class whose name is GraphicsViewer which is derived from QOpenGLWidget. When I set the QSurfaceFormat::renderableType to QSurfaceFormat::OpenGLES, I get the following errors and nothing is…
iammetehan
  • 11
  • 3
1
vote
0 answers

QOpenGLWidget does not show on wayland: Protocol error

I was trying to make some tests with the QOpenGLWidget class (Qt6), and I wrote the following main.cpp: #include #include int main(int argc, char* argv[]) { QApplication app(argc, argv); QOpenGLWidget…
1
vote
1 answer

Embedding a QOpenGLWidget via addWidget in QGraphicsScene

Some time ago I created a subclass of QGraphicsView that I called MultiWidget. Its purpose was to hold some other widgets I use, which I added with addWidget to the QGraphicsScene associated to my MultiWidget. The idea was, that MultiWidget should…
Jürgen Böhm
  • 389
  • 3
  • 11
1
vote
0 answers

How to cap framerate to 60fps in QT opengl

I used to cap the render framerate in GLFW using the function. glfwSwapInterval(1); Now i am building a Opengl project in QT using the Qt opengl features. in the main function i set the global value. QGLFormat format; …
Summit
  • 2,112
  • 2
  • 12
  • 36
1
vote
2 answers

QOpenGLWidget crushes on shown

I embedded a QOpenGLWidget in a QMainWindow instance w. Compilation is OK. But when debugging, the program crushes at w.show(). The error dialog says: Exception thrown at 0x000007FEE5AF4469 (d3d11sdklayers.dll) in TestQtOpenGL.exe: 0xC0000005:…
Cosmo
  • 836
  • 1
  • 12
  • 27
1
vote
1 answer

Qtopengl, why can not draw two cubes using different vbo

I am using opengl in QT, and want to draw a colored cube and a whte cube(simulating a light source). I use two different shader program and two different vbo. But, I find that I can draw only one cube. What to do about…
Mengyu Chen
  • 137
  • 6