Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

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

    General and Desktop
    3
    4
    2952
    Loading More Posts
    • 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
      niks1989 last edited by

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

      is there any way to get this

      1 Reply Last reply Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        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 Reply Quote 0
        • T
          TarunRajSingh last edited by

          @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 Reply Quote 0
          • N
            niks1989 last edited by

            thanx tarunRajsingh

            1 Reply Last reply Reply Quote 0
            • First post
              Last post