Hi,
In my Qt Application I am dynamically creating QGraphicsView(s) and adding them inside a QGridLayout. When I add first view inside grid, the view covers all the available space inside grid. Then I add second view and there are now two equally sized views inside grid. Then I add third view and there are now three equally sized views inside grid. And so on.
How can I get updated size of first view?
Below is my trial but I think this is not working.
//Definition of viewsPerRow
static const int viewsPerRow = 3;
void window::newViewRequested()
{
QGraphicsView *view = new QGraphicsView;
view->setVisible(true);
viewVector.push_back(view);
for(int i = viewGrid->count(); i < viewVector.count(); i++)
{
viewGrid->addWidget(view,i / viewsPerRow ,i % viewsPerRow);
}
qDebug()<<viewGrid->cellRect(0,0);
}