+ when creating picture check whether pbuffer is supported

This commit is contained in:
wmayer 2014-12-09 14:18:44 +01:00
parent 5da5be2eea
commit d4a5249b4b
3 changed files with 9 additions and 3 deletions

View File

@ -30,6 +30,7 @@
# include <QDateTime>
# include <QImage>
# include <QGLFramebufferObject>
# include <QGLPixelBuffer>
#endif
#include "Thumbnail.h"
@ -86,8 +87,9 @@ void Thumbnail::SaveDocFile (Base::Writer &writer) const
if (!this->viewer)
return;
QImage img;
bool pbuffer = QGLPixelBuffer::hasOpenGLPbuffers();
if (App::GetApplication().GetParameterGroupByPath
("User parameter:BaseApp/Preferences/Document")->GetBool("DisablePBuffers",false)) {
("User parameter:BaseApp/Preferences/Document")->GetBool("DisablePBuffers",!pbuffer)) {
this->createThumbnailFromFramebuffer(img);
}
else {

View File

@ -35,6 +35,7 @@
# include <QFileDialog>
# include <QGLFormat>
# include <QGLWidget>
# include <QGLPixelBuffer>
# include <QPainter>
# include <QPrinter>
# include <QPrintDialog>
@ -532,8 +533,9 @@ void View3DInventor::print(QPrinter* printer)
QPainter p(printer);
QRect rect = printer->pageRect();
bool pbuffer = QGLPixelBuffer::hasOpenGLPbuffers();
if (App::GetApplication().GetParameterGroupByPath
("User parameter:BaseApp/Preferences/Document")->GetBool("DisablePBuffers",false)) {
("User parameter:BaseApp/Preferences/Document")->GetBool("DisablePBuffers",!pbuffer)) {
previewFromFramebuffer(rect, img);
}
else {

View File

@ -29,6 +29,7 @@
# include <QColor>
# include <QImage>
# include <QGLFramebufferObject>
# include <QGLPixelBuffer>
# include <Inventor/SbViewVolume.h>
# include <Inventor/nodes/SoCamera.h>
#endif
@ -696,8 +697,9 @@ Py::Object View3DInventorPy::saveImage(const Py::Tuple& args)
bg.setNamedColor(colname);
QImage img;
bool pbuffer = QGLPixelBuffer::hasOpenGLPbuffers();
if (App::GetApplication().GetParameterGroupByPath
("User parameter:BaseApp/Preferences/Document")->GetBool("DisablePBuffers",false)) {
("User parameter:BaseApp/Preferences/Document")->GetBool("DisablePBuffers",!pbuffer)) {
createImageFromFramebuffer(w, h, bg, img);
}
else {