[Kst] branches/work/kst/portto4/kst/src/libkstapp
George Staikos
staikos at kde.org
Mon May 28 20:38:38 CEST 2007
SVN commit 669188 by staikos:
add a demo of OpenGL along with a settings class for global app settings
M +8 -7 CMakeLists.txt
M +0 -3 TODO
A applicationsettings.cpp [License: GPL (v2+)]
A applicationsettings.h [License: GPL (v2+)]
M +7 -2 view.cpp
--- branches/work/kst/portto4/kst/src/libkstapp/CMakeLists.txt #669187:669188
@@ -1,23 +1,24 @@
include_directories( ${CMAKE_BINARY_DIR}/kst ${CMAKE_SOURCE_DIR}/kst/src/extdate ${CMAKE_SOURCE_DIR}/kst/src/widgets ${CMAKE_BINARY_DIR}/kst/src/widgets ${CMAKE_SOURCE_DIR}/kst/src/libkst ${CMAKE_BINARY_DIR}/kst/src/libkst ${CMAKE_SOURCE_DIR}/kst/src/libkstmath ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} )
set(kstapp_LIB_SRCS
+ applicationsettings.cpp
+ boxitem.cpp
+ ellipseitem.cpp
kstapplication.cpp
+ labelitem.cpp
+ lineitem.cpp
mainwindow.cpp
+ vectormodel.cpp
+ viewcommand.cpp
view.cpp
viewitem.cpp
- boxitem.cpp
- ellipseitem.cpp
- lineitem.cpp
- labelitem.cpp
- viewcommand.cpp
- vectormodel.cpp
)
kde4_automoc(${kstapp_LIB_SRCS})
kde4_add_library(kstapp SHARED ${kstapp_LIB_SRCS})
-target_link_libraries(kstapp kstmath)
+target_link_libraries(kstapp kstmath QtOpenGL)
set_target_properties(kstapp PROPERTIES VERSION ${KST_LIBKST_VERSION} SOVERSION 2)
install(TARGETS kstapp DESTINATION ${LIB_INSTALL_DIR} )
--- branches/work/kst/portto4/kst/src/libkstapp/TODO #669187:669188
@@ -1,11 +1,8 @@
- More shapes/items
- Actual plot item
-- OpenGL?
- SVG item?
- Use some templates/factories for CreateCommands?
- Undo/Redo for item select/focus/move and other ItemChange's
- Make Undo/Redo of move command work for selections too
- Movement of lines alone doesn't work
- Box the objects so they can't be dragged out of the visible size of scene
-- Properly namespace
-- Separate files per class
--- branches/work/kst/portto4/kst/src/libkstapp/view.cpp #669187:669188
@@ -12,24 +12,29 @@
#include "view.h"
#include "mainwindow.h"
#include "kstapplication.h"
+#include "applicationsettings.h"
#include <QDebug>
#include <QTimer>
#include <QUndoStack>
#include <QResizeEvent>
+#include <QGLWidget>
#include <QGraphicsScene>
#include <QGraphicsSceneMouseEvent>
namespace Kst {
+
View::View()
- : QGraphicsView(kstApp->mainWindow()),
- _currentPlotItem(0), _mouseMode(Default) {
+ : QGraphicsView(kstApp->mainWindow()), _currentPlotItem(0), _mouseMode(Default) {
_undoStack = new QUndoStack(this);
setScene(new QGraphicsScene(this));
scene()->installEventFilter(this);
setInteractive(true);
setRenderHints(QPainter::Antialiasing | QPainter::TextAntialiasing | QPainter::SmoothPixmapTransform);
+ if (ApplicationSettings::self()->useOpenGL()) {
+ setViewport(new QGLWidget);
+ }
}
More information about the Kst
mailing list