CMainPictureWallArea Class Reference

#include <MainPictureWallArea.h>

List of all members.

Public Types

enum  EZoomFocus { IN, OUT }

Public Slots

void loadImagesFromDirectoryRecursivelySlot (QString directoryPath)
void changeZoomLevelByFactor (EZoomFocus zoom)
void showGoogleImageResult (QHash< QString, QString > result)
void cleanAllResults ()

Public Member Functions

 CMainPictureWallArea (QWidget *parent=0)
virtual ~CMainPictureWallArea ()

Protected Member Functions

virtual void wheelEvent (QWheelEvent *)
virtual void mousePressEvent (QMouseEvent *)
virtual void mouseReleaseEvent (QMouseEvent *)
virtual void mouseMoveEvent (QMouseEvent *)

Private Slots

void showImageOnWall (int num)
void showImageOnWall (QByteArray image, QString)

Private Member Functions

void setMessage (const QString &text)

Private Attributes

QFutureWatcher< ScaledImageInfo > * m_pImageScaling
int m_Row
int m_Column
QGraphicsScene m_GraphicsScene
qreal m_ZoomFactor
int m_MouseDeltaValueForPressedEvent
bool m_MouseButtonPressed


Detailed Description

CMainPictureWallArea class is responsible for setting images on the graphics view, rendering of images, setting reflection of those images, emits events on the respective image and handling mouse events.

CMainPictureWallArea class provides showImageOnWall() methods to create and push image object on graphics view container. This methods except bytearray data for the image or result location of QFutureWatcher class which is envoked from multiple images path which needs to processed in different thread. Once these image result is obtain.CMainPictureWallArea class places those image objects on the graphics view and set the new bounding rect for the view. This process is continu for all the images that needs to be placed inside the graphics view container.It is checked for bottom raw which has a reflection of the widget when images are places on to graphics view. if the bottom raw is third raw then one more row element is added which is reflection of the image.

CMainPictureWallArea class provides functionality on mouse events on graphics view. When mouse wheel takes palce zoom in and zoom out of the contained images is provided inside changeZoomLevelByFactor() function. Horizontal scrolling on view on mouse pressed event is also taken care mousePressEvent() method.

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

Member Enumeration Documentation

EZoomFocus provides direction of the zoom on complete view IN - zoom in OUT - zoom out

Enumerator:
IN 
OUT 


Constructor & Destructor Documentation

CMainPictureWallArea::CMainPictureWallArea ( QWidget *  parent = 0  ) 

References m_GraphicsScene, m_MouseButtonPressed, m_pImageScaling, m_ZoomFactor, setMessage(), and showImageOnWall().

Here is the call graph for this function:

CMainPictureWallArea::~CMainPictureWallArea (  )  [virtual]

References m_pImageScaling.


Member Function Documentation

void CMainPictureWallArea::loadImagesFromDirectoryRecursivelySlot ( QString  directoryPath  )  [slot]

This slot loads all the image path from the passed directoryPath. Loaded image path is sent to QFutureWatcher for loading all the images in concurrent. if diretory path does not contain any images then this function does nothing

Parameters:
directoryPath directory path to image folder

References cleanAllResults(), m_pImageScaling, mainHeight, mainWidth, MyScale(), and setMessage().

void CMainPictureWallArea::changeZoomLevelByFactor ( EZoomFocus  zoom  )  [slot]

This slots is called when the mouse wheel are scrolled for zoom in and zoom out event i.e. scalling of an graphics view. Depending upon the direction of zoom, scalling of entire view is done by +0.25 for zoom in and -0.25 for zoom out

Parameters:
zoom direction of the zoom

References IN, and m_ZoomFactor.

Referenced by wheelEvent().

void CMainPictureWallArea::showGoogleImageResult ( QHash< QString, QString >  result  )  [slot]

This slot is called when new record needs to be displayed inside the view. This slot accept URL to thumbnail view and original image URL. Thumbnail image is downloaded from the web server and send to private memeber function showImageOnWall() to attach on the view.

Parameters:
result This is key value based result is expeted, key for thumbnail view URL is "tbUrl" amd key for original image viewer is "url"

References mainHeight, mainWidth, and showImageOnWall().

void CMainPictureWallArea::cleanAllResults (  )  [slot]

This slot clear all the image item from the view. This slot delete each item from the view

References m_Column, m_GraphicsScene, m_pImageScaling, and m_Row.

Referenced by loadImagesFromDirectoryRecursivelySlot().

void CMainPictureWallArea::showImageOnWall ( int  num  )  [private, slot]

This slot is called internally when QFutureWatcher is finished image processing, scalling and result is obtained. passed integer parameter represent location of the result in QFutureWatcher object

Parameters:
num 

References CImageProxyWidget::boundingRect(), ImageHeight, ImageWidth, m_Column, m_GraphicsScene, m_pImageScaling, m_Row, ScaledImageInfo::m_ScaledImage, ScaledImageInfo::m_ScaledImagePath, mirrorImage(), CImageProxyWidget::setDefaultItemGeometry(), CustomLabel::setImagePath(), and CustomLabel::setPixmap().

Referenced by CMainPictureWallArea(), and showGoogleImageResult().

void CMainPictureWallArea::showImageOnWall ( QByteArray  image,
QString  imageMainUrl 
) [private, slot]

This slot is called internally when images has downloaded from web server. Images downlaoded from web server for this funtion are thumbnail view of the main images.

Parameters:
image Downloaded image data
URL of the main image data

References CImageProxyWidget::boundingRect(), ImageHeight, ImageWidth, m_Column, m_GraphicsScene, m_Row, mirrorImage(), scaleFromImage(), CImageProxyWidget::setDefaultItemGeometry(), CustomLabel::setImagePath(), and CustomLabel::setPixmap().

void CMainPictureWallArea::wheelEvent ( QWheelEvent *  e  )  [protected, virtual]

This overloaded function provides scalling of view on mouse wheel even

Parameters:
 

References changeZoomLevelByFactor(), IN, and OUT.

void CMainPictureWallArea::mousePressEvent ( QMouseEvent *  e  )  [protected, virtual]

Parameters:
 

References m_MouseButtonPressed, and m_MouseDeltaValueForPressedEvent.

void CMainPictureWallArea::mouseReleaseEvent ( QMouseEvent *  e  )  [protected, virtual]

Parameters:
 

References m_MouseButtonPressed.

void CMainPictureWallArea::mouseMoveEvent ( QMouseEvent *  e  )  [protected, virtual]

This overloaded function provides horizontal scrolling of the view depending upon the mouse movement and mouse press event.

Parameters:
 

References m_MouseButtonPressed, and m_MouseDeltaValueForPressedEvent.

void CMainPictureWallArea::setMessage ( const QString &  text  )  [private]

This function sets the text message on the view at available position

Parameters:
text 

References m_Column, m_GraphicsScene, and m_Row.

Referenced by CMainPictureWallArea(), and loadImagesFromDirectoryRecursivelySlot().

Here is the caller graph for this function:


Member Data Documentation

QGraphicsScene CMainPictureWallArea::m_GraphicsScene [private]

Referenced by mouseMoveEvent(), and mousePressEvent().


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