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
1 answer

QMenu context menu initial size too small and w/o content in QtOpenGL.QGLWidget

I am using PyQt 4.8.6 bindings for Python 2.7.9. I would like to create a context menu inside QtOpenGL.QGLWidget: class OpenGLWidget(QtOpenGL.QGLWidget): def __init__(self, parent=None): QtOpenGL.QGLWidget.__init__(self, parent) …
lskrinjar
  • 5,483
  • 7
  • 29
  • 54
0
votes
0 answers

QHBoxLayout addwidget() order and two qglwidget share texture object

I created two QGLwidget objects: slicerCanvas* slicerX_; secCan* secWid_; secWid_ = new secCan(this); //slicerX_ load data and create texture object share with secWid_ slicerX_ = new slicerCanvas(this,secWid_); and in the main window, I use…
FeizCNU
  • 73
  • 7
0
votes
1 answer

glActiveTexture in Qt and QGLWidget?

I have a small application on OpenGL+GLEW. Now, I am trying to rewrite it with QT(instead of GLEW). But I have a problem. IDE writes: 'glActiveTexture' was not declared in this scope glActiveTexture(TextureUnit); …
Denis
  • 719
  • 2
  • 8
  • 23
0
votes
2 answers

How to remove QOpenGLContext::swapBuffers() called without corresponding makeCurrent()

How can I stop this warning in Qt 5.4.1 in Debug/Release mode. QOpenGLContext::swapBuffers() called without corresponding makeCurrent() It only appears in debug mode, but release mode is fine with VS2010. It appears in both modes (Debug & Release)…
maxpayne
  • 1,111
  • 2
  • 21
  • 41
0
votes
2 answers

How do I get qGLWidget to display in Visual Studio

I am building a qt interface using Visual-Studio with qt5 add-in. The interface would have an OpenGL viewer on one side and a series of control buttons on the other. Rightnow, I have built the necessary UI window with an empty QWidget and a…
Ken Jiang
  • 21
  • 2
0
votes
1 answer

pyQt4 Events (like resizeEvent) are not trickling down to QGLWidget renderer inside QGraphicsView

I am trying to use the QGraphicsView/QGraphicsScene classes with a QGLWidget doing the bulk of rendering (I will need HW acceleration later down the road). My QGraphicsView(s) is tiled in a QGridLayout, itself inside a QDockWidget derived window. I…
thefog
  • 181
  • 1
  • 4
  • 13
0
votes
1 answer

access violatoin when my program has two different QGLWidgets

I have two different QGLWidgets(GLViwer and TextureViwer),and I add them into two QHboxLayout glviewer = GLViewer::getInstance(); //QGLWidget singleton, display 3d model texViewer = TextureViewer::getInstance();//display selected…
cloudending
  • 95
  • 1
  • 10
0
votes
1 answer

Qt connection QTableWidget and QGLWidget

I am new in Qt and i stacked in a task. I created a QGLWidget and i try to connect it with a QTablewidget. I want to take a variable from QTableWidget which i want to use in order to plot in the QGLWidget. The problem is that there are two classes,…
George
  • 1
  • 1
0
votes
1 answer

QGLWidget context destruction

I have a class named Mesh which wraps and OpenGL object, with VBO, texture, etc. This class inherits from QObject and its parent is set to my QGLWidget. So as soon I close the widget it will get deleted by QObject system. But I have a problem…
Nazar554
  • 4,105
  • 3
  • 27
  • 38
0
votes
0 answers

QT - QTimer with multiple QGLWidgets

I have an application with two QGLWidgets that are updated by the same timer, running at 60Hz. Strangely, the maximum fps I reach is exactly 30Hz. If I add a third QGLWidget (note that this third one is updated by an additional timer) I achieve 20…
Marc
  • 767
  • 1
  • 10
  • 23
0
votes
2 answers

Seeking advice on using QGLWidget in Qt4

I'm new here, and have a question about opengl in Qt4, which I've been learning over the last few months. Particularly, I'm seeking advice on the best way to compose a scene in a good object-oriented fashion using the QGLWidget. I'd ideally like…
talldan
  • 70
  • 7
0
votes
1 answer

QGLWidget - faster grabFrameBuffer

I have a kind of streaming application, which should capture the content of a window. In the window a QGLWidget draws the stuff. At the moment I am using widget.grabFrameBuffer in every draw cycle (has to be real time). The app uses 100% CPU and…
user1347198
0
votes
1 answer

How to fix fustrum cut while zooming using glScalef in QGLWidget

I'm working on a simple image viewer using QGLWidget by drawing two triangles and then render them with a texture. The program allows users to zoom the image by scroll down/up then it changes the zoom factor using glScalef. so far it works great…
azer89
  • 1,529
  • 1
  • 15
  • 29
0
votes
1 answer

QPainter drawText() in QGLWidget draw long Chinese text with English upside down

I use codes below to draw text in QGLWidget, but when the text is long and mixed Chinese(or Japanese) with English, then the text becomes upside down. Anyone knows why? PS1: When I change QGLWidget to QWidget, everything is OK. PS2: My Qt version is…
Loong
  • 83
  • 11
0
votes
1 answer

Mouse events blocked because of QGL View

I created a simple project to show the problem I have in a bigger application. So, I create a mainwindow with 2 buttons. I create a class which inherit from QWidget with 2 buttons and a QGL view. The problem is that, apparently and for some reason I…
SteveTJS
  • 635
  • 17
  • 32