[Solved]et the size of the QGraphicsView



  • "The red rectangle":http://postimage.org/image/gqrf29mrh/

    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);

    graph_view_->setDragMode(QGraphicsView::ScrollHandDrag);
    
    setCentralWidget(graph_view_);
    

    @

    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
    size.Thanks


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.