[SOLVED]Graphicsview how to
Hello
I’m trying to use the graphicsview and graphics scene.
Only a simpel test to build from but even this doesn’t work
I use qt desigener and puts the g_view on the mainwindow and I’m trying to set the scene in the constructor.
But nothing happens.
Here is some code.
- m_graphScen->setSceneRect(0,0,790,290);
- m_graphScen->addText("Hello, world!");
- // a blue background
- // a gradient background
- m_graphScen->setBackgroundBrush(gradient);
- QPainterPath path;
- path.moveTo(10, 30);
- path.cubicTo(80, 0, 50, 50, 80, 80);
- ui->m_graphView->setFixedSize(800,300);
- ui->m_graphView->setScene(m_graphScen);
The problem wasn’t here.
It was the calling to this method that was the problem
0 replies
You must log in to post a reply. Not a member yet? Register here!
