FreeCAD Qt5 plan for deprecated WebKit?
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: FreeCAD Qt5 plan for deprecated WebKit?
Thanks Werner! I'm looking forward to trying this out soon.
You've probably seen this already, but in case not: "QGLPixelBuffer is deprecated and implemented by using a hidden QGLWidget and a QOpenGLFramebufferObject. For offscreen rendering to a texture, switch to using QOpenGLFramebufferObject directly to improve performance." QOpenGLFramebufferObject looks like it's mainly intended for making textures, so will probably need to be configured differently than default (add depth buffer, I guess change target from texture2d to renderbuffer [somehow]). -Ian-
You've probably seen this already, but in case not: "QGLPixelBuffer is deprecated and implemented by using a hidden QGLWidget and a QOpenGLFramebufferObject. For offscreen rendering to a texture, switch to using QOpenGLFramebufferObject directly to improve performance." QOpenGLFramebufferObject looks like it's mainly intended for making textures, so will probably need to be configured differently than default (add depth buffer, I guess change target from texture2d to renderbuffer [somehow]). -Ian-
Re: FreeCAD Qt5 plan for deprecated WebKit?
Yes. QOpenGLFramebufferObject is already used as alternative for the missing/not working QGLPixelBuffer but fails when transparencies are set. But as wrote in the EDIT I found the class QOffscreenSurface which apparently internally uses pixel buffer. I will give this a try.You've probably seen this already, ...
Re: FreeCAD Qt5 plan for deprecated WebKit?
Hi Werner! Great!
HTH.
Cheers,
Mateusz
In my initial testing I have found that commenting some lines did help. I do not know which one causes this (GL_DEPTH_TEST probably) or what a proper fix is. (Have not tested on your branch yet. Need one hour to finish building) EDIT: This is in QuarterWidget.cppwmayer wrote: Currently there are some open points:
[*]Get the 3d view working again
Code: Select all
std::clock_t begin = std::clock();
if(!initialized) {
- glEnable(GL_DEPTH_TEST);
+// glEnable(GL_DEPTH_TEST);
this->getSoRenderManager()->reinitialize();
initialized = true;
}
getSoRenderManager()->activate();
- glEnable(GL_DEPTH_TEST);
- glMatrixMode(GL_PROJECTION);
+// glEnable(GL_DEPTH_TEST);
+// glMatrixMode(GL_PROJECTION);
I have been playing with this: Migration to QOpenGLWidgetwmayer wrote: [*]Find a replacement for qglColor
[*]Find a replacement for QGLWidget::renderText
HTH.
Cheers,
Mateusz
Re: FreeCAD Qt5 plan for deprecated WebKit?
Gave this a shot with clang on macOS but it fails to compile - probably an easy fix but haven't had a chance to dig into it and won't until this evening but here is the pertinent information.wmayer wrote:Now to the QOpenGL* port:
I have moved this branch https://github.com/wwmayer/FreeCAD/tree/qtopengl
If someone wants to test you have to set the option BUILD_QT5 of course and additionally the option FREECAD_USE_QTOPENGL_WIDGET which is off by default.
Code: Select all
/Users/blacey/Projects/FreeCAD-MacOS-CI/src/Gui/Flag.cpp:154:6: error: member access into incomplete type 'QOpenGLFunctions'
f->glClearColor(c.redF(), c.greenF(), c.blueF(), c.alphaF());
^
/usr/local/Cellar/qt@5.6/5.6.2/lib/QtGui.framework/Headers/qopenglcontext.h:68:7: note: forward declaration of 'QOpenGLFunctions'
class QOpenGLFunctions;
^
/Users/blacey/Projects/FreeCAD-MacOS-CI/src/Gui/Flag.cpp:168:6: error: member access into incomplete type 'QOpenGLFunctions'
f->glBlendColor(c.redF(), c.greenF(), c.blueF(), c.alphaF());
^
/usr/local/Cellar/qt@5.6/5.6.2/lib/QtGui.framework/Headers/qopenglcontext.h:68:7: note: forward declaration of 'QOpenGLFunctions'
class QOpenGLFunctions;
^
2 errors generated.
make[2]: *** [src/Gui/CMakeFiles/FreeCADGui.dir/Flag.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [src/Gui/CMakeFiles/FreeCADGui.dir/all] Error 2
make: *** [all] Error 2
Re: FreeCAD Qt5 plan for deprecated WebKit?
I wanted to test this for a while now:
P.S. Looking good and thanks.
P.S. Looking good and thanks.
Re: FreeCAD Qt5 plan for deprecated WebKit?
blacey wrote: Gave this a shot with clang on macOS but it fails to compile
Code: Select all
diff --git a/src/Gui/Flag.cpp b/src/Gui/Flag.cpp
index f3fb4ce46..6ddffe73a 100644
--- a/src/Gui/Flag.cpp
+++ b/src/Gui/Flag.cpp
@@ -30,6 +30,10 @@
#include <Inventor/SbVec2s.h>
#include "View3DInventorViewer.h"
+#if defined(HAVE_QT5_OPENGL)
+#include <QOpenGLFunctions>
+#endif
+
#include "Flag.h"
using namespace Gui;
Cheers,
Mateusz
Re: FreeCAD Qt5 plan for deprecated WebKit?
Damn! I added the lineGave this a shot with clang on macOS but it fails to compile - probably an easy fix but haven't had a chance to dig into it and won't until this evening but here is the pertinent information.
Code: Select all
#include <QOpenGLFunctions>
Code: Select all
#ifndef QUARTER_QTOPENGL_H
#define QUARTER_QTOPENGL_H
/* QtOpenGL.h. Generated from QtOpenGL.h.cmake by cmake. */
#cmakedefine HAVE_QT5_OPENGL
#if defined(HAVE_QT5_OPENGL)
#include <QOpenGLContext>
#include <QSurfaceFormat>
#include <QOpenGLWidget>
#include <QOpenGLFramebufferObject>
#include <QOpenGLVersionProfile>
#include <QOpenGLFunctions>
typedef QOpenGLContext QtGLContext;
typedef QSurfaceFormat QtGLFormat;
typedef QOpenGLWidget QtGLWidget;
typedef QOpenGLFramebufferObject QtGLFramebufferObject;
typedef QOpenGLFramebufferObjectFormat QtGLFramebufferObjectFormat;
#else // HAVE_QT5_OPENGL
#include <QGLContext>
#include <QGLFormat>
#include <QGLWidget>
#include <QGLPixelBuffer>
#include <QGLFramebufferObject>
typedef QGLContext QtGLContext;
typedef QGLFormat QtGLFormat;
typedef QGLWidget QtGLWidget;
typedef QGLPixelBuffer QtGLPixelBuffer;
typedef QGLFramebufferObject QtGLFramebufferObject;
typedef QGLFramebufferObjectFormat QtGLFramebufferObjectFormat;
#endif // HAVE_QT5_OPENGL
#endif //QUARTER_QTOPENGL_H
Re: FreeCAD Qt5 plan for deprecated WebKit?
Thanks a lot! This is a big step forward since the 3d viewer basically works again. However, there are two problems:In my initial testing I have found that commenting some lines did help. I do not know which one causes this (GL_DEPTH_TEST probably) or what a proper fix is. (Have not tested on your branch yet. Need one hour to finish building) EDIT: This is in QuarterWidget.cpp
- When resizing the 3d viewer it flickers heavily
- In debug mode it creates a lot of error messages: Coin error in SoNode::GLRenderS(): GL error: 'GL_INVALID_OPERATION', nodetype: Separator (set envvar COIN_GLERROR_DEBUGGING=1 and re-run to get more information)
I have pushed a new commit to the opengl branch.
Re: FreeCAD Qt5 plan for deprecated WebKit?
@wmayer, I just returned home and pulled your latest OpenGL branch and it works well on macOS. I do not see the the 3d viewer flicker or the coin errors. I am using the following:wmayer wrote: Thanks a lot! This is a big step forward since the 3d viewer basically works again. However, there are two problems:And now the ported Image view can coexist with the 3d viewer.
- When resizing the 3d viewer it flickers heavily
- In debug mode it creates a lot of error messages: Coin error in SoNode::GLRenderS(): GL error: 'GL_INVALID_OPERATION', nodetype: Separator (set envvar COIN_GLERROR_DEBUGGING=1 and re-run to get more information)
I have pushed a new commit to the opengl branch.
- Qt 5.6.2
- Shiboken2-dev SHA e11fa17ea35fbe3c8999400f582e8a5d632dade5 - https://codereview.qt-project.org/gitwe ... de5;sf=tgz
- Pyside2-dev SHA b262da528e2d6346c528f523d15e8e067ddd7a17 - https://codereview.qt-project.org/gitwe ... a17;sf=tgz
- Coin 4.0.0-dev SHA 035e53e53730c5cc96bfdb5ea9131ce57bffb2d3 - https://bitbucket.org/Coin3D/coin/get/0 ... ffb2d3.tgz
Here is a short video of it in action NOTE: - I was compiling in the background so performance wasn't the best.
I agree this is a bit step forward
Code: Select all
OS: Mac OS X
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.10460 (Git)
Build type: DEBUG
Branch: qtopengl
Hash: af120636c7d386193fa226a875334369c7f7e506
Python version: 2.7.13
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.1.0
Re: FreeCAD Qt5 plan for deprecated WebKit?
I guess that the flickering and the GL errors are related somehow. When I resize the 3d window I can see the flickering and in the output window hundreds of these errors are printed. So maybe on your system everything seems to be fine.I do not see the the 3d viewer flicker or the coin errors. I am using the following:
And can you confirm that it finally fixes issue #1401?