Qt-interest Archive, November 2006
Newbie problem with QGraphicsView
Message 1 in thread
Hi everyone,
i added a qgraphicsview to a qwidget and now i try to add a line to the scene but the program just hangs using the following code:
QBrush brush(QColor("black"));
QPen pen(brush, 1.0);
//QGraphicsScene scene;
QGraphicsScene *scene = _diagramWidget->scene();
QLineF xLine(0.0, 0.0, 100.0, 0.0);
QGraphicsLineItem *x = scene->addLine(xLine);
x->setPen(pen);
//_diagramWidget->setScene(&scene);
_diagramWidget->show();
As i am completely new to qgraphicsview and such i am happy for any help. BTW: i want to use qgraphicsview to draw a diagram. Maybe there are better/easier ways to accomplish this?
Thanks
Chris
Christian Rengstl M.A.
Klinik und Poliklinik fÃr Innere Medizin II
Kardiologie - Forschung
UniversitÃtsklinikum Regensburg
B3 1.388
Franz-Josef-Strauss-Allee 11
93053 Regensburg
Tel.: +49-941-944-7230
--
[ signature omitted ]