Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Language Bindings
  4. Making a QWidget fill a QGraphicsScene (PySide)
Forum Updated to NodeBB v4.3 + New Features

Making a QWidget fill a QGraphicsScene (PySide)

Scheduled Pinned Locked Moved Language Bindings
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.
  • T Offline
    T Offline
    timcarr
    wrote on last edited by
    #1

    In my application I have a QGraphicsView with another QGraphicsView within it (added with addWidget). The smaller QGraphicsView is a map (positioned and sized to a portion of the screen). When the user presses a keyboard shortcut I want the map to fill my entire window (a QMainWindow) I attempted to use setCentralWidget to set the map view to fill the screen, but I only get a blank box that fills the screen (it works fine if I don't add the widget to my QGraphicsScene).
    My current (working) implementation is simply resizing the map to fill QGraphicsScene that it is in, I'm only concerned that everything else in my parent QGraphics scene will still drain resources. I'm also not sure that a QStackedLayout would be the route to go, since the map still needs to be part of my QGraphicsScene. I'm wondering if there is a better (or more standard) solution than my current one.

    1 Reply Last reply
    0
    • T Offline
      T Offline
      timcarr
      wrote on last edited by
      #2

      Just for future reference to anyone who runs across this I ended up going with my current solution. QGraphicsScene is very optimized and seems to do a good job of not bothering with redrawing obscured objects. This approach also allowed me to do some other things visually that would have been much more difficult to implement otherwise.

      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