[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    playground/office/flake
From:       Thomas Zander <zander () kde ! org>
Date:       2006-05-29 20:19:54
Message-ID: 1148933994.593581.16395.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 546356 by zander:

Use canvasView widget


 M  +2 -2      qmake-lib-config  
 M  +11 -3     testapp/mainwindow.cpp  


--- trunk/playground/office/flake/qmake-lib-config #546355:546356
@@ -11,10 +11,10 @@
            KoInteractionStrategy.h KoShapeMoveStrategy.h \
            KoShapeRubberSelectStrategy.h KoViewConverter.h \
            KoShapeRotateStrategy.h KoShapeGroup.h KoLineBorder.h \
-           KoShapeResizeStrategy.h
+           KoShapeResizeStrategy.h KoCanvasView.h
 SOURCES += KoShape.cpp KoPathShape.cpp KoSelection.cpp \
            KoShapeManager.cpp KoShapeContainer.cpp KoRepaintManager.cpp \
            KoInteractionTool.cpp KoShapeMoveStrategy.cpp KoShapeRubberSelectStrategy.cpp \
            KoRectangleShape.cpp KoCommand.cpp KoInteractionStrategy.cpp KoTool.cpp \
            KoShapeRotateStrategy.cpp KoShapeGroup.cpp KoLineBorder.cpp \
-           KoShapeResizeStrategy.cpp
+           KoShapeResizeStrategy.cpp KoCanvasView.cpp
--- trunk/playground/office/flake/testapp/mainwindow.cpp #546355:546356
@@ -43,6 +43,7 @@
 #include <KoTextShape.h>
 #include <KoCommand.h>
 #include <KoShapeContainer.h>
+#include <KoCanvasView.h>
 
 #include "math.h"
 
@@ -56,12 +57,14 @@
     , m_snapToGrid(false)
 {
     setBackgroundRole(QPalette::Base);
+    setAutoFillBackground(true);
 
     m_shapeManager = new KoShapeManager(this, m_objects);
     setMouseTracking( true );
 
     connect( m_shapeManager, SIGNAL(selectionChanged()), this, SLOT(selectionChanged()) );
     setFocusPolicy(Qt::ClickFocus); // allow to receive keyboard input
+    setMinimumSize(500, 400);
 }
 
 // static
@@ -185,6 +188,8 @@
 {
     m_zoomHandler.setZoom(qMax(5, zoom));
     sigZoomChanged(zoom);
+    QPointF newSize = viewConverter()->normalToView(QPointF(250.0, 200.0));
+    setMinimumSize(qRound(newSize.x()), qRound(newSize.y()));
     update();
 }
 
@@ -405,14 +410,17 @@
     m_document->addView( m_canvas );
     m_document->addView( fc );
 
-    splitter->addWidget( fc );
-    splitter->addWidget(m_canvas);
+    KoCanvasView *cv1 = new KoCanvasView(splitter);
+    cv1->setCanvas(fc);
+    KoCanvasView *cv2 = new KoCanvasView(splitter);
+    cv2->setCanvas(m_canvas);
+    splitter->addWidget(cv1);
+    splitter->addWidget(cv2);
     QList<int> sizes;
     sizes << 0 << 100;
     splitter->setSizes(sizes);
 
     setCentralWidget(splitter);
-    m_canvas->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
     resize( 640, 520 );
     createActions();
     createMenus();
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic