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. How can I set QGraphicsScene's size ?

How can I set QGraphicsScene's size ?

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 3 Posters 2.9k 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.
  • O Offline
    O Offline
    onurcevik
    wrote on last edited by onurcevik
    #1
    This post is deleted!
    K 1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Might be a silly question but why a QGraphicsScene/View combo to only have a video played in it ? Why not just use a QVideoPlayer directly ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      O 1 Reply Last reply
      0
      • O onurcevik

        This post is deleted!

        K Offline
        K Offline
        kenchan
        wrote on last edited by
        #3

        @onurcevik
        Take a look at the docs for the setSceneRect() function for the scene and the graphics view object. You will understand their relation ship to the size of the scene.
        scene here
        viewport here
        The part of the scene you see is viewed inside the viewport of the QGraphicsView. The actual extents of the data in the scene can be larger or smaller than what you actually see through the viewport.

        O 1 Reply Last reply
        0
        • SGaistS SGaist

          Hi,

          Might be a silly question but why a QGraphicsScene/View combo to only have a video played in it ? Why not just use a QVideoPlayer directly ?

          O Offline
          O Offline
          onurcevik
          wrote on last edited by
          #4

          @SGaist Hey, I actually asked a question about this here a week ago. Basically I need to draw rectangle on playing video. But for some reason with QVideoWidget I couldn't draw anything at all. So I switched to QGraphicsScene/View.

          1 Reply Last reply
          0
          • K kenchan

            @onurcevik
            Take a look at the docs for the setSceneRect() function for the scene and the graphics view object. You will understand their relation ship to the size of the scene.
            scene here
            viewport here
            The part of the scene you see is viewed inside the viewport of the QGraphicsView. The actual extents of the data in the scene can be larger or smaller than what you actually see through the viewport.

            O Offline
            O Offline
            onurcevik
            wrote on last edited by
            #5

            @kenchan Hey I tried to set QGraphicsScene size equal to QGraphicsView's size with this code :

            scene->setSceneRect(ui->graphicsView->sceneRect());
            

            But it didn't change anything. What am I doing wrong ?

            K 1 Reply Last reply
            0
            • O onurcevik

              @kenchan Hey I tried to set QGraphicsScene size equal to QGraphicsView's size with this code :

              scene->setSceneRect(ui->graphicsView->sceneRect());
              

              But it didn't change anything. What am I doing wrong ?

              K Offline
              K Offline
              kenchan
              wrote on last edited by
              #6

              @onurcevik didn't change anything how. Since the original post was deleted I can't refer to you original post!

              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