Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    [Solved]et the size of the QGraphicsView

    General and Desktop
    1
    2
    1047
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      stereomatching last edited by

      "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.

      1 Reply Last reply Reply Quote 0
      • S
        stereomatching last edited by

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

        1 Reply Last reply Reply Quote 0
        • First post
          Last post