[Kst] branches/work/kst/portto4/kst
Peter Kümmel
syntheticpp at gmx.net
Mon Aug 27 12:36:09 UTC 2012
SVN commit 1313585 by kuemmel:
add option to disable OpenGl, because in VirtualBox it crashes
M +5 -0 cmake/CMakeLists.txt
M +4 -1 cmake/modules/KstMacros.cmake
M +2 -0 src/libkstapp/applicationsettings.cpp
M +8 -0 src/libkstapp/generaltab.cpp
M +7 -0 src/libkstapp/view.cpp
--- branches/work/kst/portto4/kst/cmake/CMakeLists.txt #1313584:1313585
@@ -42,6 +42,7 @@
kst_option(string OFF all cross "Cross-compile on Linux for Windows")
kst_option(string "" all qt5 "Use Qt5 at given path")
kst_option(bool ON all qt5base_only "Only use Qt5 features available in qtbase")
+kst_option(bool ON all opengl "Use OpenGL")
message(STATUS)
@@ -136,7 +137,11 @@
use_qt5lib(Qt5Widgets)
use_qt5lib(Qt5Network)
use_qt5lib(Qt5Xml)
+ if(kst_opengl)
use_qt5lib(Qt5OpenGL)
+ else()
+ add_definitions(-DKST_NO_OPENGL)
+ endif()
add_definitions(-DQT5=1)
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DQT_NO_DEBUG")
else()
--- branches/work/kst/portto4/kst/cmake/modules/KstMacros.cmake #1313584:1313585
@@ -192,7 +192,10 @@
macro(kst_link)
target_link_libraries(${kst_name} ${ARGV})
if(kst_qt5)
- qt5_use_modules(${kst_name} Widgets Xml OpenGL Network)
+ qt5_use_modules(${kst_name} Widgets Xml Network)
+ if(kst_opengl)
+ qt5_use_modules(${kst_name} OpenGL)
+ endif()
else()
target_link_libraries(${kst_name}
${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTXML_LIBRARY} ${QT_QTOPENGL_LIBRARY} ${QT_QTSVG_LIBRARY} ${QT_QTNETWORK_LIBRARY})
--- branches/work/kst/portto4/kst/src/libkstapp/applicationsettings.cpp #1313584:1313585
@@ -16,7 +16,9 @@
#include "defaultlabelpropertiestab.h"
#include <QCoreApplication>
+#ifndef KST_NO_OPENGL
#include <QGLPixelBuffer>
+#endif
#include <QSettings>
#include <QDebug>
--- branches/work/kst/portto4/kst/src/libkstapp/generaltab.cpp #1313584:1313585
@@ -32,12 +32,20 @@
}
bool GeneralTab::useOpenGL() const {
+#ifdef KST_NO_OPENGL
+ return false;
+#else
return _useOpenGL->isChecked();
+#endif
}
void GeneralTab::setUseOpenGL(const bool useOpenGL) {
+#ifdef KST_NO_OPENGL
+ _useOpenGL->setChecked(false);
+#else
_useOpenGL->setChecked(useOpenGL);
+#endif
}
bool GeneralTab::transparentDrag() const {
--- branches/work/kst/portto4/kst/src/libkstapp/view.cpp #1313584:1313585
@@ -34,7 +34,11 @@
#include <QResizeEvent>
#include <QMenu>
#include <QWidgetAction>
+#ifdef KST_NO_OPENGL
+#define QGLWidget QWidget
+#else
#include <QGLWidget>
+#endif
#include <QGraphicsItem>
#include <QGraphicsScene>
#include <QGraphicsSceneMouseEvent>
@@ -127,6 +131,9 @@
void View::setUseOpenGL(bool useOpenGL) {
+#ifndef KST_NO_OPENGL
+ useOpenGL = false;
+#endif
//This is an expensive operation...
if (_useOpenGL == useOpenGL)
return;
More information about the Kst
mailing list