src/hbcore/gui/hbfadeitem.cpp
changeset 5 627c4a0fd0e7
parent 0 16d8024aca5e
child 7 923ff622b8b9
equal deleted inserted replaced
3:11d3954df52a 5:627c4a0fd0e7
    39 
    39 
    40 class HbFadeItemPrivate : public HbWidgetPrivate
    40 class HbFadeItemPrivate : public HbWidgetPrivate
    41 {
    41 {
    42     Q_DECLARE_PUBLIC(HbFadeItem)
    42     Q_DECLARE_PUBLIC(HbFadeItem)
    43 
    43 
    44     public:
    44 public:
    45     HbFadeItemPrivate( );
    45     HbFadeItemPrivate();
    46     virtual ~HbFadeItemPrivate();
    46     virtual ~HbFadeItemPrivate();
    47     void init();
    47     void init();
    48 
    48 
    49     mutable QRectF mRect;
    49     mutable QRectF mRect;
    50 
    50 
    73     // This is needed to be able to block moving the focus to items behind background item by
    73     // This is needed to be able to block moving the focus to items behind background item by
    74     // clicking on them.
    74     // clicking on them.
    75     q->setFlag(QGraphicsItem::ItemIsFocusable);
    75     q->setFlag(QGraphicsItem::ItemIsFocusable);
    76 }
    76 }
    77 
    77 
    78 HbFadeItem::HbFadeItem( QGraphicsItem *parent ) : HbWidget(*new HbFadeItemPrivate, parent)
    78 HbFadeItem::HbFadeItem(QGraphicsItem *parent) : HbWidget(*new HbFadeItemPrivate, parent)
    79 {
    79 {
    80     Q_D(HbFadeItem);
    80     Q_D(HbFadeItem);
    81     d->q_ptr = this;
    81     d->q_ptr = this;
    82     d->init();
    82     d->init();
    83 }
    83 }
    90 }
    90 }
    91 
    91 
    92 QRectF HbFadeItem::boundingRect() const
    92 QRectF HbFadeItem::boundingRect() const
    93 {
    93 {
    94     Q_D(const HbFadeItem);
    94     Q_D(const HbFadeItem);
    95     if(!d->mRect.isValid()){
    95     if (!d->mRect.isValid()) {
    96         // set size so that it is big enough
    96         // set size so that it is big enough
    97         // to cover the screen both landscape and portrait mode
    97         // to cover the screen both landscape and portrait mode
    98         const QSizeF screenSize = HbDeviceProfile::profile(this).logicalSize();
    98         const QSizeF screenSize = HbDeviceProfile::profile(this).logicalSize();
    99         qreal dim = qMax(screenSize.width(), screenSize.height());
    99         qreal dim = qMax(screenSize.width(), screenSize.height());
   100         d->mRect.adjust(0,0,dim,dim);
   100         d->mRect.adjust(0, 0, dim, dim);
   101     }
   101     }
   102     return d->mRect;
   102     return d->mRect;
   103 }
   103 }
   104 
   104 
   105 bool HbFadeItem::sceneEvent(QEvent *event)
   105 bool HbFadeItem::sceneEvent(QEvent *event)