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. How to hide child items when resizing custom QGraphicsItem
Qt 6.11 is out! See what's new in the release blog

How to hide child items when resizing custom QGraphicsItem

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 747 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.
  • T Offline
    T Offline
    Tigran84
    wrote on last edited by Tigran84
    #1

    I have custom QGraphicsItem which contain other QGraphicsItems. When I resizing parent item I want to hide remaining parts which are not inside in my custom item rectangle.
    https://imagebin.ca/v/3MnHgq6ldGCM (image example of my custom item ) full project code is in github https://github.com/tigran1984/Qt_example

    A 1 Reply Last reply
    0
    • T Tigran84

      I have custom QGraphicsItem which contain other QGraphicsItems. When I resizing parent item I want to hide remaining parts which are not inside in my custom item rectangle.
      https://imagebin.ca/v/3MnHgq6ldGCM (image example of my custom item ) full project code is in github https://github.com/tigran1984/Qt_example

      A Offline
      A Offline
      Asperamanca
      wrote on last edited by
      #2

      @Tigran84
      Try

      setFlag(QGraphicsItem::ItemClipsChildrenToShape, true);
      
      T 1 Reply Last reply
      2
      • A Asperamanca

        @Tigran84
        Try

        setFlag(QGraphicsItem::ItemClipsChildrenToShape, true);
        
        T Offline
        T Offline
        Tigran84
        wrote on last edited by
        #3

        @Asperamanca thanks a lot

        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