#include <MainPictureWallArea.h>
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 |
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.
CMainPictureWallArea::CMainPictureWallArea | ( | QWidget * | parent = 0 |
) |
References m_GraphicsScene, m_MouseButtonPressed, m_pImageScaling, m_ZoomFactor, setMessage(), and showImageOnWall().
CMainPictureWallArea::~CMainPictureWallArea | ( | ) | [virtual] |
References m_pImageScaling.
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
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
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.
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
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.
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
References changeZoomLevelByFactor(), IN, and OUT.
void CMainPictureWallArea::mousePressEvent | ( | QMouseEvent * | e | ) | [protected, virtual] |
void CMainPictureWallArea::mouseReleaseEvent | ( | QMouseEvent * | e | ) | [protected, virtual] |
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.
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
text |
References m_Column, m_GraphicsScene, and m_Row.
Referenced by CMainPictureWallArea(), and loadImagesFromDirectoryRecursivelySlot().
QFutureWatcher<ScaledImageInfo>* CMainPictureWallArea::m_pImageScaling [private] |
int CMainPictureWallArea::m_Row [private] |
Referenced by cleanAllResults(), setMessage(), and showImageOnWall().
int CMainPictureWallArea::m_Column [private] |
Referenced by cleanAllResults(), setMessage(), and showImageOnWall().
QGraphicsScene CMainPictureWallArea::m_GraphicsScene [private] |
Referenced by cleanAllResults(), CMainPictureWallArea(), setMessage(), and showImageOnWall().
qreal CMainPictureWallArea::m_ZoomFactor [private] |
Referenced by changeZoomLevelByFactor(), and CMainPictureWallArea().
int CMainPictureWallArea::m_MouseDeltaValueForPressedEvent [private] |
Referenced by mouseMoveEvent(), and mousePressEvent().
bool CMainPictureWallArea::m_MouseButtonPressed [private] |
Referenced by CMainPictureWallArea(), mouseMoveEvent(), mousePressEvent(), and mouseReleaseEvent().