Beispiel #1
0
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());
}
Beispiel #2
0
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()));
        }
    }
}
Beispiel #3
0
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());
}
Beispiel #5
0
void RefImage::setImageMetadata()
{
    if (isMetadataStored())
        if (isImageCached())
            imageItem()->setMetadata(m_storedMetadata);
}
Beispiel #6
0
void RefImage::storeMetadata()
{
    m_storedMetadata = imageItem()->metadata();
    setMetadataStored(true);
}