Author: aschnell Date: Thu Jan 15 17:13:51 2009 New Revision: 54665 URL: http://svn.opensuse.org/viewcvs/yast?rev=54665&view=rev Log: - backup Modified: branches/tmp/aschnell/graph/qt-graph/src/YQGraph.cc Modified: branches/tmp/aschnell/graph/qt-graph/src/YQGraph.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/aschnell/graph/qt-graph/src/YQGraph.cc?rev=54665&r1=54664&r2=54665&view=diff ============================================================================== --- branches/tmp/aschnell/graph/qt-graph/src/YQGraph.cc (original) +++ branches/tmp/aschnell/graph/qt-graph/src/YQGraph.cc Thu Jan 15 17:13:51 2009 @@ -39,11 +39,13 @@ #include "YQi18n.h" -YQGraph::YQGraph( YWidget * parent, const string & filename, const string & layoutAlgorithm ) - : QGraphicsView( (QWidget *) parent->widgetRep() ), - YGraph( parent, filename, layoutAlgorithm ) +YQGraph::YQGraph(YWidget* parent, const string& filename, const string& layoutAlgorithm) + : QGraphicsView((QWidget*) parent->widgetRep()), + YGraph(parent, filename, layoutAlgorithm) { - setWidgetRep( this ); + setWidgetRep(this); + + yuiMilestone() << "Graph init start" << endl; setRenderHint(QPainter::Antialiasing); setRenderHint(QPainter::TextAntialiasing); @@ -60,11 +62,13 @@ } -YQGraph::YQGraph( YWidget * parent, graph_t* graph ) - : QGraphicsView( (QWidget *) parent->widgetRep() ), - YGraph( parent, graph ) +YQGraph::YQGraph(YWidget* parent, graph_t* graph) + : QGraphicsView((QWidget*) parent->widgetRep()), + YGraph(parent, graph) { - setWidgetRep( this ); + setWidgetRep(this); + + yuiMilestone() << "Graph init start" << endl; setRenderHint(QPainter::Antialiasing); setRenderHint(QPainter::TextAntialiasing); @@ -218,8 +222,6 @@ const int border = 20; QRectF size(gToQ(GD_bb(graph).LL), gToQ(GD_bb(graph).UR)); size.adjust(-border, -border, border, border); - - scene->setSceneRect(size); @@ -232,13 +234,8 @@ for (Agnode_t* node = agfstnode(graph); node != NULL; node = agnxtnode(graph, node)) { - qreal w = 72*ND_width(node); - qreal h = 72*ND_height(node); - - qreal x = ND_coord_i(node).x - w/2; - qreal y = ND_coord_i(node).y - h/2; - - QRectF rect(x, y, w, h); + QRectF rect(0.0, 0.0, 72.0*ND_width(node), 72.0*ND_height(node)); + rect.moveCenter(gToQ(ND_coord_i(node))); QGraphicsItem* item = NULL; -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org