Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [Solved]et the size of the QGraphicsView

[Solved]et the size of the QGraphicsView

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 1.1k Views
  • 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 Offline
    S Offline
    stereomatching
    wrote on last edited by
    #1

    "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
    0
    • S Offline
      S Offline
      stereomatching
      wrote on last edited by
      #2

      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
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved