Change QRectF boundRect() depending on total Item



  • 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)?


  • Lifetime Qt Champion

    Hi,

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


Log in to reply