homescreenapp/hsdomainmodel/src/hswidgethostvisual.cpp
changeset 90 3ac3aaebaee5
parent 69 87476091b3f5
child 101 ba1b7e218624
equal deleted inserted replaced
86:e4f038c420f7 90:3ac3aaebaee5
    82 QPainterPath HsWidgetHostVisual::shape() const
    82 QPainterPath HsWidgetHostVisual::shape() const
    83 {
    83 {
    84     QPainterPath path;
    84     QPainterPath path;
    85 
    85 
    86     if (mWidget) {
    86     if (mWidget) {
    87         QRectF currRect = rect();
    87         QRectF visualRect = rect();
    88         path = mWidget->shape();
    88         path = mWidget->shape();
    89 
    89 
    90         QRectF pathRect(path.boundingRect());
    90         QRectF widgetRect(path.boundingRect());
    91 
    91         if (widgetRect.width() > visualRect.width()
    92         if (pathRect.width() > currRect.width()
    92             || widgetRect.height() > visualRect.height()) {
    93             || pathRect.height() > currRect.height()) {
    93             QPainterPath newPath;
    94             QPainterPath newPath(currRect.topLeft());
    94             newPath.addRect(visualRect);
    95             newPath.addRect(currRect);
       
    96             path = path.intersected(newPath);
    95             path = path.intersected(newPath);
       
    96         } else if ( widgetRect.isEmpty() ) {
       
    97             path.addRect(visualRect);
    97         }
    98         }
       
    99 
    98     }
   100     }
    99     return path;
   101     return path;
   100 }
   102 }
   101 void HsWidgetHostVisual::setWidget(QObject *widget)
   103 void HsWidgetHostVisual::setWidget(QObject *widget)
   102 {
   104 {