Questions tagged [qglwidget]

The QGLWidget class, part of the Qt framework, is a widget for rendering OpenGL graphics.

QGLWidget provides functionality for displaying OpenGL graphics integrated into a Qt application. It is very simple to use. You inherit from it and use the subclass like any other QWidget, except that you have the choice between using QPainter and standard OpenGL rendering commands.

Note: This class is part of the legacy Qt OpenGL module and, like the other QGL classes, should be avoided in the new applications. Instead, starting from Qt 5.4, prefer using QOpenGLWidget and the QOpenGL classes.

Documentation can be found here (Qt4) and here (Qt5).

186 questions
0
votes
0 answers

What is the proper order of initialization of OpenGL inside a QT GraphicsScene?

The following QT sample is straightforward : I'm trying to find out why the texture shows up only if the application gets timed by a the MessageBox. I'm using QT4.8.1 and tried it both under linux and VS2008. #include "ui_qtgltest.h" #include…
Flint
  • 1,483
  • 1
  • 14
  • 24
0
votes
0 answers

How to use a complex OpenGL as background in QGraphicsScene?

I'm trying to create a display with a complex OpenGL image and some spinboxes on the image. Using http://doc.qt.digia.com/qq/qq26-openglcanvas.html I'm able to have a two layers object (inheriting from QGraphicsScene) with a simple OpenGL image as…
user1235648
0
votes
0 answers

QGLWidget bindTexture for dynamic text consuming more memory

I have a situation where in, I need to print dymanic text(updated every 20 ms) on openGL window. I am using QGLWidget, where paintGL method is implemented using native openGL commands. I tried using renderText, but found problem with positioning…
Keen Learner
  • 145
  • 1
  • 11
0
votes
0 answers

Qt application lags and xorg uses a lot of CPU

I've encountered some problems with my Qt application which is very slow and laggy. Originally it was developed on another machine than I am using now, and it seemed to work fine there. Now, I can see that the CPU load of the xorg process is quite…
Marc
  • 637
  • 1
  • 10
  • 21
0
votes
1 answer

How do I exactly update an objects position in OpenGL using Qt's QGLWidget?

I'm trying to move a cube drawn wit OpenGL in a QGLWidget. Here is part of the code: void Hologram::paintGL() { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); drawBox(); } void Hologram::drawBox() { for (int i = 0; i < 6; i++) { …
Marc
  • 637
  • 1
  • 10
  • 21
0
votes
1 answer

Perspective with fixed aspect ratio (1:1) in OpenGL and Qt5 (QGLWidget)

I'm trying to render a cube into a QGLWidgetput inside a QSplitter. I'd like it to have a 1:1 ratio so it is a cube and keeps that ratio regardless of window dimensions. I haven't been able to get this to work, though. No matter what I do, the cube…
Brokensoul .
  • 53
  • 1
  • 7
0
votes
2 answers

A cube is rendered as a square in QGLWidget

I've been trying to render a cube in a QGLWidget, but it comes out wrong. No matter how I rotate it, it looks like a flat square. It's like it didn't notice the Z coordinates of its vertices. Just before I added clearing of the GL_DEPTH_BUFFER_BIT,…
Brokensoul .
  • 53
  • 1
  • 7
0
votes
1 answer

Multiple QGLWidgets and gluUnProject

I have a QMainWindow containing two QGLWidgets. The widgets use the default constructor and do not share a context. The widgets both display two dimensional data and allow for clicking and dragging. This works using gluUnproject and works well on…
0
votes
4 answers

gl_lines and gl_clear in QGLWidget

I got a problem with drawing on a QGLWidget. I have several quads on the widget which I can move around when pressing some keys. As long as I just draw quads, everything works fine but now I want to add some lines using: …
Da Mks
  • 31
  • 4
0
votes
2 answers

Methods that call QGLContext::makeCurrent()

I am trying to use QGLWidget in our App. I have cretaed a derived class from QGLWidget . I am updating the Texture(using glTexSubImage2D) from a seperate thread and drwaing the texture(using glTexCoord2i ..) in paintGL from GUI thread. The problem I…
Ven
  • 247
  • 1
  • 5
  • 17
0
votes
1 answer

pyqt : Why QGLWidget influenced by maya event?

openGL with maya I made a openGL View with QGLWidget. It has a problem when work with Maya. As you see in video, when I click and move on a modelPanel within Maya, the QGLWidget get broken. And I found that the marquee rectangle is shown on my…
Hyun-geun Kim
  • 799
  • 3
  • 17
  • 35
0
votes
2 answers

rendering and color picking in QGLWidget : how to cope with both

I'm wondering if there's a better solution than this: I have a rendering code and a color picking code, I already shared everything that could be shared between these two codes (VBOs, etc..) and my code looks like: void paintGL() { label1: …
Johnny Pauling
  • 10,391
  • 14
  • 57
  • 104
0
votes
1 answer

QGLWidget - how to structure a program with overpainting

This should be simple: I'm using a QGLWidget to draw some openGL graphics and I want to be able to write something on the openGL graphics rendered, so I'm using overpainting as in the Qt demo with QPainter. Here are my two working choices of…
Johnny Pauling
  • 10,391
  • 14
  • 57
  • 104
0
votes
1 answer

How do I pass QMainWindow resize events down to a QGLWidget contained in the QMainWindow?

Initially, I followed the structure of http://qt-project.org/wiki/How_to_use_OpenGL_Core_Profile_with_Qt. I created a vanilla Visual Studio 2010 Qt application project, clicked on the .ui file to start Qt Designer, inserted a QWidget and promoted it…
Walt Donovan
  • 347
  • 1
  • 10
0
votes
3 answers

Get rid of glut functions for solid objects drawing in a Qt QGlWidget

I need to draw sphere, cylinders and cones in 3D inside a QGlWidget. Now I'm using the glutSolidSphere, glutSolidCone and that awful trick of gluQuadric for drawing cylinders. I just want to use only one framework for 3D drawing -in this case Qt-…
linello
  • 7,476
  • 14
  • 53
  • 98
1 2 3
12
13