Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-7790

QGraphicsScene should use setClipRect and not setClipShape when widget has simple rectangular shape

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P1: Critical P1: Critical
    • 4.6.2
    • 4.6.1
    • Widgets: GraphicsView
    • None
    • qt 4.6.1
    • 80e114ad0b7974894858a17153d6f54546835066

      I have a widget (rectangular in shape) which clips its children (which are also simple rectangles).

      For example if I have two widgets scrolLWidget and contentWidget::
      
       QGraphicsWidget *scrollWidget = new QGraphicsWidget();
      scrollWidget->setFlag(Qt::ItemClipsChildrenToShape,true);
      QGraphicsWidget *contentWidget = new QGraphicsWidget();
      We can add any content to this i.etext, icons etc
      
      scrollWidget->setContentWidget(contentWidget); ---->this would also set contentWidget as its child
      
      We dont apply any kind of transformations, scaling etc.We expect a simple "untransformed" rectangular clip.
      
      Lets see how QGraphicsScene handle this:
      
      In QGraphicsScenePrivate::draw(...)
      ...
       if (itemClipsChildrenToShape) {
           painter->setClipPath(item->shape(), Qt::IntersectClip); 
          }
      ...  
      
      

      this results using complex alphamasking in openVg side(anyway, I guess this is valid even for raster engine).This is definetly going to slow things up, masking is always expensive and is it really needed in this case?

      Should scene use setClipRect when the shape is simple rectangle and not go for path?

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            bjnilsen Bjørn Erik Nilsen
            kalyanreddy2005 Kalyan kondapally
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes