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. Why does QGraphicsView::fitInView uses a hard coded margin?
Forum Updated to NodeBB v4.3 + New Features

Why does QGraphicsView::fitInView uses a hard coded margin?

Scheduled Pinned Locked Moved General and Desktop
qgraphicsview
2 Posts 2 Posters 752 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.
  • A Offline
    A Offline
    Asperamanca
    wrote on last edited by Asperamanca
    #1

    A lot of time has been spent using fitInView, and things never looked quite right.

    And this code within fitInView is the reason:
    int margin = 2; QRectF viewRect = viewport()->rect().adjusted(margin, margin, -margin, -margin);

    Why would anyone put a hard coded margin with an arbitrary value and no way to override it in such a function? Any good reasons?

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

      Hi,

      Pretty good question. You should bring it to the interest mailing list or the #qt IRC channel.

      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

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved