CImageProxyWidget Class Reference

#include <ImageProxyWidget.h>

List of all members.

Signals

void imageZoomedIn ()
void imageZoomedOut ()

Public Member Functions

 CImageProxyWidget (QGraphicsItem *parent=0, Qt::WindowFlags wFlags=0)
virtual ~CImageProxyWidget ()
QRectF boundingRect () const
void setDefaultItemGeometry (const QRectF &geometry)

Protected Member Functions

void paintWindowFrame (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
void hoverLeaveEvent (QGraphicsSceneHoverEvent *event)
void mousePressEvent (QGraphicsSceneMouseEvent *event)
void closeEvent (QCloseEvent *event)

Private Slots

void updateStep (int step)
void stateChanged (QTimeLine::State)
void zoomIn ()
void zoomOut ()
void animationFinished ()

Private Attributes

QTimeLine * m_pTimeLineForImageZoomAnimation
bool popupShown
QRectF m_ItemGeometry


Detailed Description

CImageProxyWidget class is responsible for all the animation inside graphics window. CImageProxyWidget class is container class for CustomLabel class. CImageProxyWidget provides overloaded functions for certain mouse events like mouse pressed event on item. CImageProxyWidget class provides functionality to zoom in and zoom out of an image on mouse pressed event.

Author:
vishwajeet <vishwajeet.dusane@gmail.com>

Constructor & Destructor Documentation

CImageProxyWidget::CImageProxyWidget ( QGraphicsItem *  parent = 0,
Qt::WindowFlags  wFlags = 0 
)

CImageProxyWidget::~CImageProxyWidget (  )  [virtual]


Member Function Documentation

QRectF CImageProxyWidget::boundingRect (  )  const

Returns:
bounding rect of an set widget

Referenced by CMainPictureWallArea::showImageOnWall(), and updateStep().

void CImageProxyWidget::setDefaultItemGeometry ( const QRectF &  geometry  ) 

This function set the default geometry of an item. that is thumbnail view geometry of and item.This geometry is used when item is zoomed out and needs to be placed in the same position from where it has statrted animating.

Parameters:
geometry default thumbnail geometry of an item

References m_ItemGeometry.

Referenced by CMainPictureWallArea::showImageOnWall().

void CImageProxyWidget::paintWindowFrame ( QPainter *  painter,
const QStyleOptionGraphicsItem *  option,
QWidget *  widget 
) [protected]

This function is responsible for image widget displayed inside graphics view without frame. If this function is disabled then image widget will be displayed with default frame around it. As this functoion just blocks parent paintWindowFrame call and avoid painting of the same frame. As widget set on this proxyWidget is QDialog, this function is getting call. When widget that has Qt::FramelessWindowHint option set then paint() method will be called for every paint event. But setting up Qt::FramelessWindowHint option on widget leads to overlapping of 1 widget to other on zoom in and zoom out event.

Parameters:
painter 
option 
widget 

void CImageProxyWidget::hoverLeaveEvent ( QGraphicsSceneHoverEvent *  event  )  [protected]

This overloaded function gets called whenever mouse leaves the widget area. This function takes care of zoomed in images to put back to its original place when mouse leaves from the widget area.

Parameters:
event 

References m_pTimeLineForImageZoomAnimation, popupShown, and zoomOut().

void CImageProxyWidget::mousePressEvent ( QGraphicsSceneMouseEvent *  event  )  [protected]

This overloaded function gets called whenever mouse press event occurs on the widget. This function is resonsible for starting zoom in effect on the pressed widget.

Parameters:
event 

References m_pTimeLineForImageZoomAnimation, popupShown, zoomIn(), and zoomOut().

void CImageProxyWidget::closeEvent ( QCloseEvent *  event  )  [protected]

This overloaded function gets called whenever there is widget close events occurs. This class is responsible for ignoring such a event on widget.

Parameters:
event 

void CImageProxyWidget::updateStep ( int  step  )  [private, slot]

This slot is called on regular intervals by QTimeLine class object. This slot provides a zoom in and zoom out animation on the pressed widget

Parameters:
step is the current frame number that needs to be displayed.

References boundingRect(), imageZoomedOut(), and m_pTimeLineForImageZoomAnimation.

Referenced by CImageProxyWidget().

void CImageProxyWidget::stateChanged ( QTimeLine::State  state  )  [private, slot]

This slot is called whenever there is state chenges in zoom in and zoom out animation. State of the animation is weather it is running,paused or not running. When the state of the animation is changed then this function does cache on the contents of the widget.

Parameters:
state of the animation

References m_pTimeLineForImageZoomAnimation.

Referenced by CImageProxyWidget().

void CImageProxyWidget::zoomIn (  )  [private, slot]

This slot is called for zoom in animation on the widget. This slot will start animation in forward direction.

See also:
zoomOut

References m_pTimeLineForImageZoomAnimation, and popupShown.

Referenced by mousePressEvent().

void CImageProxyWidget::zoomOut (  )  [private, slot]

This slot is called for zoom out animation on the widget. This slot will start animation in backword direction.

See also:
zoomIn

References m_pTimeLineForImageZoomAnimation, and popupShown.

Referenced by hoverLeaveEvent(), and mousePressEvent().

void CImageProxyWidget::animationFinished (  )  [private, slot]

This slot emits imageZoomedIn() and imageZoomedOut() signals depending upon the animation type i.e. zoomIn() ot zoomOut()

References imageZoomedIn(), imageZoomedOut(), m_ItemGeometry, and m_pTimeLineForImageZoomAnimation.

Referenced by CImageProxyWidget().

void CImageProxyWidget::imageZoomedIn (  )  [signal]

This singal is emiited when zoom in event occurs on the widget

See also:
imageZoomedOut()

Referenced by animationFinished().

void CImageProxyWidget::imageZoomedOut (  )  [signal]

This singal is emiited when zoom out event occurs on the widget

See also:
imageZoomedIn()

Referenced by animationFinished(), and updateStep().


Member Data Documentation


The documentation for this class was generated from the following files:

Generated on Mon Apr 27 15:25:35 2009 for PictureWall by  doxygen 1.5.6