#include <ImageProxyWidget.h>
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 |
CImageProxyWidget::CImageProxyWidget | ( | QGraphicsItem * | parent = 0 , |
|
Qt::WindowFlags | wFlags = 0 | |||
) |
References animationFinished(), m_pTimeLineForImageZoomAnimation, stateChanged(), and updateStep().
CImageProxyWidget::~CImageProxyWidget | ( | ) | [virtual] |
References m_pTimeLineForImageZoomAnimation.
QRectF CImageProxyWidget::boundingRect | ( | ) | const |
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.
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.
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.
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.
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.
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
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.
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.
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.
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
Referenced by animationFinished().
void CImageProxyWidget::imageZoomedOut | ( | ) | [signal] |
This singal is emiited when zoom out event occurs on the widget
Referenced by animationFinished(), and updateStep().
QTimeLine* CImageProxyWidget::m_pTimeLineForImageZoomAnimation [private] |
Referenced by animationFinished(), CImageProxyWidget(), hoverLeaveEvent(), mousePressEvent(), stateChanged(), updateStep(), zoomIn(), zoomOut(), and ~CImageProxyWidget().
bool CImageProxyWidget::popupShown [private] |
Referenced by hoverLeaveEvent(), mousePressEvent(), zoomIn(), and zoomOut().
QRectF CImageProxyWidget::m_ItemGeometry [private] |
Referenced by animationFinished(), and setDefaultItemGeometry().