Results 1 to 2 of 2

Thread: How can i set the display range of a QGraphicItemGroup?

  1. #1
    Join Date
    Feb 2018
    Posts
    4
    Thanks
    1

    Default How can i set the display range of a QGraphicItemGroup?

    I want to just show the display area.

    To do that, I have tried the override the QGraphicsItemGroup::boundingRect(). However, nothing have happened. And i find this in QT docs, maybe this is the reason why doesn't work.

    The boundingRect() function of QGraphicsItemGroup returns the bounding rectangle of all items in the item group.

    Also, i know i can change the size of QGraphicsView to make it work. However i put the View as CentralWidget, as i also need to display other object in the View, i can not change the size of the View.

    How can i set the display range of a QGraphicItemGroup?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How can i set the display range of a QGraphicItemGroup?

    Not sure what you mean, do you want to clip contents of an item? After setting boundingRect() for an item (e.g. your group) you can set the QGraphicsItem::ItemClipsChildrenToShape flag on it to make it clip its children to its own shape.

    As for the view, have a look at QGraphicsView::fitInView().
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. range widget?
    By TorAn in forum Qt Programming
    Replies: 1
    Last Post: 4th May 2016, 09:01
  2. QDoubleVlaidator range
    By johnmauer in forum Qt Programming
    Replies: 1
    Last Post: 20th October 2010, 17:08
  3. Out of range detection
    By zgulser in forum Qt Programming
    Replies: 2
    Last Post: 6th February 2009, 10:32
  4. QLineEdit set min max range?
    By whitefurrows in forum Qt Programming
    Replies: 29
    Last Post: 11th June 2006, 00:51
  5. Elements out of Range!!
    By Kapil in forum Newbie
    Replies: 9
    Last Post: 3rd April 2006, 11:28

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.