[Kst] branches/work/kst/portto4/kst/src/libkstapp

Mike Fenton mike at staikos.net
Mon Mar 31 17:53:44 CEST 2008


SVN commit 792188 by fenton:

Fix for OpenGL Mode not properly activating.


 M  +11 -2     view.cpp  


--- branches/work/kst/portto4/kst/src/libkstapp/view.cpp #792187:792188
@@ -35,7 +35,6 @@
     _viewMode(Data),
     _mouseMode(Default),
     _layoutBoxItem(0),
-    _useOpenGL(false),
     _gridSpacing(QSizeF(20,20)),
     _snapToGridHorizontal(false),
     _snapToGridVertical(false) {
@@ -45,6 +44,16 @@
   scene()->installEventFilter(this);
   setInteractive(true);
   setRenderHints(QPainter::Antialiasing | QPainter::TextAntialiasing | QPainter::SmoothPixmapTransform);
+
+  _useOpenGL = ApplicationSettings::self()->useOpenGL();
+  if (_useOpenGL) {
+    setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
+    setViewport(new QGLWidget);
+  } else {
+    setViewportUpdateMode(QGraphicsView::MinimalViewportUpdate);
+    setViewport(0);
+  }
+
   connect(ApplicationSettings::self(), SIGNAL(modified()), this, SLOT(updateSettings()));
   updateSettings();
 }
@@ -64,6 +73,7 @@
   if (_useOpenGL == useOpenGL)
     return;
 
+  _useOpenGL = useOpenGL;
   if (useOpenGL) {
     setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
     setViewport(new QGLWidget);
@@ -318,7 +328,6 @@
 
 
 void View::updateSettings() {
-
   setUseOpenGL(ApplicationSettings::self()->useOpenGL());
 
   setShowGrid(ApplicationSettings::self()->showGrid());


More information about the Kst mailing list