qglwidget

Fastest Method to compute Linear interpolation between 2 points in QT using OpenGL

£可爱£侵袭症+ 提交于 2019-12-13 05:51:06
问题 I'm trying to interpolate a triangle with the help of vertex coordinates. a |\ | \ | \ | \ b|_ _ _ \c I'm interpolating the vertices in this order (b,a),(a,c)and (c,b). Here the a,b and c are the 3 dimensional coordinates with a color value. a = (x1,y1,z1,c1); b = (x2,y2,z2,c2); c = (x3,y3,z3,c3); Structure used to compute the calculation: struct pointsInterpolateStruct{ QList<double> x,y,z; QList<double> r, g, b, clr; void clear() { x.clear(); y.clear(); z.clear(); r.clear(); g.clear(); b

QGlWidget fullscreen no menu

孤人 提交于 2019-12-12 18:25:25
问题 I have an app that is a single QGlwidget with a right-click QMenu created when needed. The data is drawn in an overridden paintEvent() But in fullscreen mode the menu isn't displayed. Am I better having a QGraphicsScene as the parent window and a QGlWidget as the sole child? 回答1: There is this bug report on Qt's bug list which seems related to your issue. The bug describes it as a possible driver issue with NVidia cards. It also looks like there is a workaround. 来源: https://stackoverflow.com

Cut QGLWidget?

僤鯓⒐⒋嵵緔 提交于 2019-12-12 01:51:48
问题 Is it possible to cut a QGLWidget? I mean I would like to cut it so i get access to the gui below. It sounds strange, but it would be a lot of work for me to divide my QGLWidget into two. I hope you understand what i mean. Thank you 回答1: I don't fully understand what you mean by "cut" and GUI below. In Qt with layout mechanisms properly used a widget consumes the area it covers and there are no widgets beneath it. Do you want to render multiple views into a single QGLWidget? This is easily

QOpenGLWidget not drawing array

北城以北 提交于 2019-12-11 10:49:18
问题 you´re my last resort for this question because Im out of ideas. So first of all I have already done some openGL stuff but not with the Qt Libraries. And since I HAVE to do it with Qt Libraries because of the Qt Android compiler, theres no way around for me. So I was trying to draw some vertex coordinates like in normal openGL. Save points in float array etc.. So I hoppyfully made the right vao, vbo.. shader.. but it won´t draw anything. paintGL() only draws something if its hardcoded with

How to show QGLWidget in full screen?

假装没事ソ 提交于 2019-12-11 10:34:04
问题 I have a QGLWidget as part of the UI of my application. It is NOT a central widget , there are a lot of others widgets around it. I want to show it full screen on user clicks the button. Similar functionality like on youtube video flash player. I have tried to use showFullScreen with no effect. I have read how-to-fullscreen-a-qglwidget and fullscreen-widget, but they suggest using showFullScreen. Qt documentation states that for using showFullScreen widget must be an independent window. So I

Coordinate transformations and projection issues

ぃ、小莉子 提交于 2019-12-11 07:16:10
问题 I've been trying for a while to get my mouse coordinates converted into 3D space coordinates in an OpenGL scene. Currently, my projections are a little bit of a mess (I think), and it doesn't seem to fully take my "camera" into account when I move around a scene. To check this, I draw a line. My resize function: void oglWidget::resizeGL(int width, int height) { if (height == 0) { height = 1; } pMatrix.setToIdentity(); pMatrix.perspective(fov, (float) width / (float) height, -1, 1); glViewport

Mouse events blocked because of QGL View

岁酱吖の 提交于 2019-12-10 12:28:13
问题 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 don't find, the creation of this QGL view blocks some events of the views, particularly mouse events. In the code below, the mouse hover events on the buttons and the main widget of class 1 are not detected (the cursor has to change from Arrow to

QGLWidget appears black in Windows 7

浪尽此生 提交于 2019-12-07 12:23:07
问题 I wrote and tested some code in a Windows XP (Qt 4.7.2) using Visual Studio 2010 and then I tried on another machine with Windows 7 installed. The program opens a QDialog and creates a QGLWidget where I show webcam images (with some processing). While in Windows XP the images are shown correctly, at the moment that I test the program in a Windows 7 machine, the QGLWidget turns black and no image is shown. It is strange, though, that when I move around the window and it gets out of the borders

Sharing OpenGL VAO/VBO/etc. via QGLWidget

我的未来我决定 提交于 2019-12-07 09:18:26
问题 I am using a 3 layer hierarchy of QGLWidgets to share shaders and vertex data between 5 OpenGL viewports in my CAD-like app. The root context is used for compiling application-wide shaders, the per document context is used to share model vertex data, and the viewport contexts are the ones that actually do the rendering (and also contain grid vertex data and other per viewport stuff). The shader sharing seems to work fine, and so does the grid drawing, but when it comes to sharing vertex data

calling Qt's QGraphicsView::setViewport with a custom QGLWidget

做~自己de王妃 提交于 2019-12-07 08:35:44
问题 I've derived from QGLWidget before, like so: class MyGLWidget : public QGLWidget { public: // stuff... virtual void initializeGL() { /* my custom OpenGL initialization routine */ } // more stuff... }; However, I find that if I try to initialize a QGraphicsView with my custom QGLWidget as the viewport, initializeGL doesn't get called (setting a breakpoint within the Qt library, neither does QGLWidget::initializeGL() when created plain). // initializeGL, resizeGL, paintGL not called ui