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. QGraphicsView reach outside scene
Forum Updated to NodeBB v4.3 + New Features

QGraphicsView reach outside scene

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 285 Views 2 Watching
  • 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.
  • A Offline
    A Offline
    amsantosr
    wrote on last edited by amsantosr
    #1

    Hi,
    I have a QGraphicsScene which I have added some rectangles. The QGraphicsView is able to display them with the horizontal and vertical scrollbars such that the view can only scroll to the leftmost/rightmost uppermost/lowermost rectangle. but i want the QGraphicsView to be able to scroll a distance far from the leftmost/rightmost, etc. How do I achieve that?

    Pl45m4P 1 Reply Last reply
    0
    • A amsantosr

      Hi,
      I have a QGraphicsScene which I have added some rectangles. The QGraphicsView is able to display them with the horizontal and vertical scrollbars such that the view can only scroll to the leftmost/rightmost uppermost/lowermost rectangle. but i want the QGraphicsView to be able to scroll a distance far from the leftmost/rightmost, etc. How do I achieve that?

      Pl45m4P Offline
      Pl45m4P Offline
      Pl45m4
      wrote on last edited by Pl45m4
      #2

      @amsantosr

      You need to enlarge your QGraphicsScene. The QGraphicsView just the view of a specific part of your scene.

      If you increase your scene's width and height, you can scroll to empty areas (where you dont have any rectangles)


      If debugging is the process of removing software bugs, then programming must be the process of putting them in.

      ~E. W. Dijkstra

      1 Reply Last reply
      1
      • A Offline
        A Offline
        amsantosr
        wrote on last edited by
        #3

        Yes that worked, by using setSceneRect.
        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