Hello all!
I am trying to resize a QGraphicsItem when I resize the app window but its not working.
How could I do that?
//Tool Box 3
graphicsViewFluxoCaixa->setScene(graphicsSceneFluxoCaixa);
boxInvestimento3->setLayout(gridLayoutInvestimento5);
gridLayoutInvestimento5->addWidget(graphicsViewFluxoCaixa);
//graphicsViewFluxoCaixa->adjustSize();
//graphicsViewFluxoCaixa->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
//graphicsViewFluxoCaixa->fitInView(graphicsSceneFluxoCaixa->itemsBoundingRect(), Qt::IgnoreAspectRatio);
caneta.setWidth(4);
linhaTempo->setPen(caneta);
graphicsSceneFluxoCaixa->addItem(linhaTempo);
graphicsViewFluxoCaixa->adjustSize();
graphicsViewFluxoCaixa
->setBackgroundBrush
(QBrush(Qt
::red));
//Tool Box 3
QGridLayout *gridLayoutInvestimento5 = new QGridLayout(boxInvestimento3);
QGraphicsView *graphicsViewFluxoCaixa = new QGraphicsView(boxInvestimento3);
QGraphicsScene *graphicsSceneFluxoCaixa = new QGraphicsScene(graphicsViewFluxoCaixa);
graphicsViewFluxoCaixa->setScene(graphicsSceneFluxoCaixa);
boxInvestimento3->setLayout(gridLayoutInvestimento5);
gridLayoutInvestimento5->addWidget(graphicsViewFluxoCaixa);
//graphicsViewFluxoCaixa->adjustSize();
//graphicsViewFluxoCaixa->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
//graphicsViewFluxoCaixa->fitInView(graphicsSceneFluxoCaixa->itemsBoundingRect(), Qt::IgnoreAspectRatio);
QPen caneta(Qt::black);
caneta.setWidth(4);
QGraphicsLineItem *linhaTempo = new QGraphicsLineItem(0,0,graphicsViewFluxoCaixa->width(),0);
linhaTempo->setPen(caneta);
graphicsSceneFluxoCaixa->addItem(linhaTempo);
graphicsViewFluxoCaixa->adjustSize();
graphicsViewFluxoCaixa->setBackgroundBrush(QBrush(Qt::red));
To copy to clipboard, switch view to plain text mode
Thanks a lot.
Bookmarks