Example #1
0
void CloudImageProvider::loadfinished(QNetworkReply *reply)
{
    qWarning()<<"Download finished*******";

    QByteArray Data = reply->readAll();
//    qWarning() << "data="<<xmlData.left(200);
                QImage image;
                image.loadFromData(Data);

                QString key = toKey( reply->url().toString());
//                qWarning()<<key<<" <- "<<reply->url().toString();
                cache[key] = image;

//                qWarning()<<"pre image save:"+workDir+"imgcache/"+key+".jpg";
                image.save(workDir+"imgcache/"+key+".jpg");
//                qWarning()<<"post image save";




//    reply->manager()->deleteLater();
    reply->deleteLater();

    emit cacheUpdated();
}
Example #2
0
//=========================================================================
BubbleChartView::BubbleChartView(BlastTaxDataProviders *_dataProviders, QWidget *parent, bool setRank)
    : DataGraphicsView(NULL, parent)
{
    flags |= DGF_BUBBLES | DGF_RANKS;
    config = new BubbleChartParameters();

    if ( setRank && mainWindow->getRank() == TR_NORANK )
        mainWindow->setRank(TR_SPECIES);

    if ( _dataProviders == NULL )
        _dataProviders = new BlastTaxDataProviders();

    taxDataProvider = new ChartDataProvider(_dataProviders, this);

    connect((ChartDataProvider *)taxDataProvider, SIGNAL(taxVisibilityChanged(quint32)), this, SLOT(onTaxVisibilityChanged(quint32)));
    connect((ChartDataProvider *)taxDataProvider, SIGNAL(cacheUpdated()), this, SLOT(onDataChanged()));

    QGraphicsScene *s = new QGraphicsScene(this);
    s->setItemIndexMethod(QGraphicsScene::NoIndex);
    setCacheMode(CacheBackground);
    setViewportUpdateMode(BoundingRectViewportUpdate);
    setRenderHint(QPainter::Antialiasing);
    setTransformationAnchor(AnchorUnderMouse);
    setMinimumSize(400, 200);
    setAlignment(Qt::AlignCenter);
    setScene(s);

    setChartRectSize(800, 800);

    propertiesAction = popupMenu.addAction("Properties...");
    connect(propertiesAction, SIGNAL(triggered(bool)), this, SLOT(showPropertiesDialog()));

    if ( _dataProviders->size() > 0 )
    {
        prepareScene();
        showChart();
    }
    onTaxRankChanged(mainWindow->getRank());
}
Example #3
0
void Cache::makeCallback(QVariant callback, bool status, QVariant url)
{
    //qDebug() << "makecallback: " << callback;
    emit cacheUpdated(/*QVariant::fromValue(*/callback/*)*/, QVariant(status), url);
}