Commit ad2d6025 authored by Halla Rempt's avatar Halla Rempt
Browse files

Fix for Karbon startup problem (all KoCanvasBase based canvases now

have a resource provider, but we still check whether it's 0, and fix
a few spello's in the dox.

svn path=/trunk/koffice/; revision=602092
parent 285b5a1d
......@@ -47,7 +47,7 @@ class KoCanvasBase {
public:
KoCanvasBase() {};
KoCanvasBase() { m_resourceProvider = new KoCanvasResourceProvider(0); }
virtual ~KoCanvasBase() {};
public:
......
......@@ -101,33 +101,43 @@ public:
* Like the KoShape class, this object is a visible class with
* a position and a size. It can paint itself as well if you implement
* the paintComponent() method.
*
* <p>The most important feature of this class is that you can make
* other KoShape classes to be children of this container.
*
* <p>The effect of grouping those objects is that their position
* is relative to the position of the container. Move the container and
* all children move with it.
*
* <p>Each child can optionally be said to be 'clipped' by the container.
* This feature will give the effect that even if the child has a size and
* position outside the container, it will not be shown. This is especially useful
* for showing cutouts of content, like images, without changing the actual content.
*
* <p>For so called clipped children any modification made to the container is
* propagated to the child. This includes rotation as well as scaling and shearing.
* propagated to the child. This includes rotation as well as scaling
* and shearing.
*
* <p>Maintaining the list of children can be done using the supplied methods
* addChild() and removeChild(). However, they only forward their requests to the
* data model KoGraphicsContainerModel and if you provide a custom implementation
* of that model any means can be used to maintain a list of children, as long as
* you will take care to register them with the appropriate object manager.
*
* <p>An example usage where a custom model might be useful is when you have a
* container for text areas which are split into columns. If you resize the container
* and the width of the individual columns gets too small, the model can choose to
* remove a child or add one when the width allows another column.
*/
class FLAKE_EXPORT KoShapeContainer : public KoShape {
public:
/**
* Default constructor; uses simple internal model.
*/
KoShapeContainer();
/**
* Constructor with custom model to be used for maintaining the list of children.
* @param model the custom model to be used for maintaining the list of children.
......
......@@ -66,6 +66,7 @@ public:
* @param shapes the new shapes to manage.
*/
void setShapes( const QList<KoShape *> &shapes );
/// returns the list of maintained shapes
const QList<KoShape *> & shapes() const { return m_shapes; }
......@@ -74,6 +75,7 @@ public:
* @param shape the shape to add
*/
void add(KoShape *shape);
/**
* Remove a KoShape from this manager
* @param shape the shape to remove
......@@ -117,7 +119,7 @@ public:
* @param omitHiddenShapes if true, only visible shapes are considered
*/
QList<KoShape *> shapesAt( const QRectF &rect, bool omitHiddenShapes = false );
/**
* Request a repaint to be queued.
* The repaint will be restricted to the parameters rectangle, which is expected to be
......@@ -134,7 +136,7 @@ public:
/**
* Update the tree for finding the shapes.
* This will remove the shape form the tree and will reinsert it again.
* This will remove the shape from the tree and will reinsert it again.
* The update to the tree will be posponed until it is needed so that successive calles
* will be merged into one.
* @param shape the shape to updated its position in the tree.
......@@ -143,8 +145,8 @@ public:
protected:
/**
* Update the tree when there are shapes in m_aggregate4update. This is done so not all
* updates to the tree are done when they are asked for but when they are needed.
* Update the tree when there are shapes in m_aggregate4update. This is done so not all
* updates to the tree are done when they are asked for but when they are needed.
*/
void updateTree();
......
......@@ -21,22 +21,26 @@
#include <QLabel>
#include <klocale.h>
#include <kdebug.h>
#include "KoTool.h"
#include "KoCanvasBase.h"
#include "KoViewConverter.h"
#include "KoPointerEvent.h"
#include "KoCanvasResourceProvider.h"
KoTool::KoTool(KoCanvasBase *canvas )
: m_canvas(canvas)
, m_optionWidget( 0 )
, m_previousCursor(Qt::ArrowCursor)
{
if(m_canvas) { // canvas can be NULL e.g. see kofficeui/KoToolManager.cpp DummyTool():KoTool(0){}
connect( m_canvas->resourceProvider(),
SIGNAL( sigResourceChanged(const KoCanvasResource & res) ),
this,
SLOT( resourceChanged( const KoCanvasResource & res ) ) );
if(m_canvas) {
KoCanvasResourceProvider * crp = m_canvas->resourceProvider();
if (crp)
connect( m_canvas->resourceProvider(),
SIGNAL( sigResourceChanged(const KoCanvasResource & ) ),
this,
SLOT( resourceChanged( const KoCanvasResource & ) ) );
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment