ui/widgets/glxzoomwidget/src/glxzoomwidget.cpp
changeset 45 863223ea6961
parent 44 aa2fa096cbfb
child 50 a0f57508af73
child 55 fb37077c270f
equal deleted inserted replaced
44:aa2fa096cbfb 45:863223ea6961
    72     if(model)
    72     if(model)
    73     {
    73     {
    74         mModel = model;
    74         mModel = model;
    75         retreiveFocusedImage(); //Update mZoomItem with focused Image
    75         retreiveFocusedImage(); //Update mZoomItem with focused Image
    76         connect( mModel, SIGNAL( dataChanged(QModelIndex,QModelIndex) ), this, SLOT( dataChanged(QModelIndex,QModelIndex) ) );
    76         connect( mModel, SIGNAL( dataChanged(QModelIndex,QModelIndex) ), this, SLOT( dataChanged(QModelIndex,QModelIndex) ) );
       
    77         connect( mModel, SIGNAL( destroyed() ), this, SLOT( modelDestroyed() ) );
    77     }
    78     }
    78 }
    79 }
    79 
    80 
    80 void GlxZoomWidget::setWindowSize(QSize windowSize)
    81 void GlxZoomWidget::setWindowSize(QSize windowSize)
    81 {
    82 {
    97 
    98 
    98 void GlxZoomWidget::cleanUp()
    99 void GlxZoomWidget::cleanUp()
    99 {
   100 {
   100     if(mModel) {
   101     if(mModel) {
   101         disconnect( mModel, SIGNAL( dataChanged(QModelIndex,QModelIndex) ), this, SLOT( dataChanged(QModelIndex,QModelIndex) ) );
   102         disconnect( mModel, SIGNAL( dataChanged(QModelIndex,QModelIndex) ), this, SLOT( dataChanged(QModelIndex,QModelIndex) ) );
       
   103         disconnect( mModel, SIGNAL( destroyed() ), this, SLOT( modelDestroyed() ) );
   102         mModel = NULL;
   104         mModel = NULL;
   103     }
   105     }
   104     if(mImageDecoder) {
   106     if(mImageDecoder) {
   105         mImageDecoder->resetDecoder();
   107         mImageDecoder->resetDecoder();
   106     }
   108     }
   383         finalizeWidgetTransform();
   385         finalizeWidgetTransform();
   384         }
   386         }
   385     }
   387     }
   386 }
   388 }
   387 
   389 
       
   390 void GlxZoomWidget::modelDestroyed()
       
   391 {
       
   392     mModel = NULL ;    
       
   393 }
       
   394 
       
   395 void GlxZoomWidget::indexChanged()
       
   396     {
       
   397     retreiveFocusedImage();
       
   398     }
       
   399 
   388 void GlxZoomWidget::decodedImageAvailable()
   400 void GlxZoomWidget::decodedImageAvailable()
   389 {
   401 {
   390     //new bitmap with better resolution is available
   402     //new bitmap with better resolution is available
   391     //so set it to the item
   403     //so set it to the item
   392     QPixmap decodedPixmap = mImageDecoder->getPixmap();
   404     QPixmap decodedPixmap = mImageDecoder->getPixmap();