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. Change QRectF boundRect() depending on total Item

Change QRectF boundRect() depending on total Item

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

    Hi there, I have an unsolved problem until now.

    I have, let say n items say in my GraphicsScene which is arrange in particular position(like 2d lattice), and n is determined by input of user di UI.
    Until now i still configure each item with

    QRectF myItem::boundingRect() const
    {
       return QRect(0,0,25,25); //use 25, 25
    }
    

    which is as less as the items in my GraphicsScene, the item seems loss due to the small size and as I add more items my items seems coupled each other.
    Question is how can I change dynamically the boundingRect() return based on my n item(s)?

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

      Hi,

      Do you really want to change the bonding rect or make the scene show them all like in the 40000 chips example ?

      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