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] To find visible portion(QRect) of qgraphicsscene in qgraphicsview
QtWS25 Last Chance

[SOLVED] To find visible portion(QRect) of qgraphicsscene in qgraphicsview

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 3.2k 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.
  • N Offline
    N Offline
    niks1989
    wrote on last edited by
    #1

    i need to find visible scene's rect in view..!!

    is there any way to get this

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi, do you mean something like "sceneRect":http://qt-project.org/doc/qt-4.8/qgraphicsview.html#sceneRect-prop ?

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

      1 Reply Last reply
      0
      • T Offline
        T Offline
        TarunRajSingh
        wrote on last edited by
        #3

        @mapToScene(this->viewport()->rect());@

        This will give you visible scene rect in scene cordinates as QPolygon,if you want QRectF

        try
        @mapToScene(this->viewport()->rect()).boundingRect();@

        1 Reply Last reply
        0
        • N Offline
          N Offline
          niks1989
          wrote on last edited by
          #4

          thanx tarunRajsingh

          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