Commit 618e82f5 authored by Stefan Nikolaus's avatar Stefan Nikolaus
Browse files

KoRTree - Allow generic types, not just pointers. The type has to provide

	  operator< and operator== due to the internal usage.
	- Swap the args of insert(). As in Qt, the key (QRectF) comes first now.

svn path=/trunk/koffice/; revision=562628
parent 24174f02
......@@ -81,7 +81,7 @@ void KoShapeManager::add( KoShape *shape )
if( ! dynamic_cast<KoShapeGroup*>( shape ))
{
QRectF br( shape->boundingRect() );
m_tree.insert( shape, br );
m_tree.insert( br, shape );
}
shape->repaint();
}
......@@ -198,7 +198,7 @@ void KoShapeManager::updateTree()
{
m_tree.remove( shape );
QRectF br( shape->boundingRect() );
m_tree.insert( shape, br );
m_tree.insert( br, shape );
}
m_aggregate4update.clear();
}
......
......@@ -141,7 +141,7 @@ private:
QList<KoShape *> m_shapes;
KoSelection * m_selection;
KoCanvasBase * m_canvas;
KoRTree<KoShape> m_tree;
KoRTree<KoShape *> m_tree;
QSet<KoShape *> m_aggregate4update;
};
......
This diff is collapsed.
......@@ -64,7 +64,7 @@ void Canvas::insert( QRectF & rect )
m_out << "i " << rect.left() << " " << rect.top() << " " << rect.width() << " " << rect.height() << "\n";
Data * data = new Data( rect );
m_rects.insert( data );
m_rtree.insert( data, rect );
m_rtree.insert( rect, data );
update();
}
......
......@@ -90,7 +90,7 @@ private:
QList<Data*> m_found;
QRectF m_insertRect;
bool m_buttonPressed;
KoRTree<Data> m_rtree;
KoRTree<Data*> m_rtree;
Tool * m_tool;
CreateTool m_createTool;
SelectTool m_selectTool;
......
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