Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Game Development
  4. QGraphicsView question
Qt 6.11 is out! See what's new in the release blog

QGraphicsView question

Scheduled Pinned Locked Moved Game Development
2 Posts 1 Posters 1.5k Views 1 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.
  • D Offline
    D Offline
    Dynamite101
    wrote on last edited by
    #1

    I'm at the beginning stages of making a game and i have an issue with the QGraphicsView class. For some reason when i set the size of my QGraphicsScene, the view is never large enough to contain it without using scrollbars. You can understand i don't want scrollbars in my game. I disabled the scrollbars but the size of the view still isn't showing the whole scene. It's missing like a good 100 pixels in both height and width. I tried scaling the view, and even though the size is now equal to the scene, the scene and all its items disappear. Scaling doesn't seem to be the answer. Any way of correcting this?

    Thanks

    1 Reply Last reply
    0
    • D Offline
      D Offline
      Dynamite101
      wrote on last edited by
      #2

      I managed to find the solution. Sorry I'm still pretty new to programming and don't fully know how inheritance works. The QGraphicsView is a grandchild (?) of the QWidget. So i was looking at the wrong methods in the QGraphicsView reference. If i call the QWidget's resize method for the view it resizes the view like i want.

      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