Please nominate your Qt Champions for 2021!

[Solved]et the size of the QGraphicsView

  • "The red rectangle":

    It is a QGraphicsView under a QMainWindow

    graph_scene_ = new QGraphicsScene(this);
    graph_scene_->addItem(graph_pixmap_ = new QGraphicsPixmapItem);
    graph_view_ = new QGraphicsView(graph_scene_, this);



    I only need the size of the area surrounded by the red rectangle but not the whole
    area which could reach by the scrollBar.

  • I just find the answer, size() and viewport()->size()
    whatevever, I need to find out the different of these

Log in to reply