void RefImage::insertImage(QPixmap pixmap, QString name) { m_imageItem = new ManipulableItem(pixmap, name, this); setImageCached(true); connect(imageItem(),SIGNAL(destroyed()),this,SLOT(removeFromCache())); connect(imageItem(),SIGNAL(infoChanged()),this,SIGNAL(infoChanged())); emit newImage(imageItem()); }
void RefImage::saveImage(QDir directory, QString name) { if ( (isImageCached()) && (!isImageOnDisk()) ) { if (imageItem()->saveImage(directory, name)) { QFileInfo fileInfo(directory,imageItem()->name()); setUri(QUrl::fromLocalFile(fileInfo.filePath())); } } }
void RefImage::loadImage() { // qDebug() << "Image Cached:" << imageCached; if (!isImageCached()) { if (isImageLocal() || isImageOnDisk()) { imageFromFile(); } else { downloadImage(); } } else emit newImage(imageItem()); setInView(true); }
void BackgroundStateNone::fitInView (GraphicsView &view) { LOG4CPP_INFO_S ((*mainCat)) << "BackgroundStateNone::fitInView"; view.fitInView (imageItem ().boundingRect()); }
void RefImage::setImageMetadata() { if (isMetadataStored()) if (isImageCached()) imageItem()->setMetadata(m_storedMetadata); }
void RefImage::storeMetadata() { m_storedMetadata = imageItem()->metadata(); setMetadataStored(true); }