Commit cb9c6c13 authored by Erwan Demairy's avatar Erwan Demairy

The dtkVisualizationDataManager is able to display an icon.

parent d45482fe
......@@ -27,7 +27,9 @@ int main(int argc, char **argv)
application.setOrganizationName("inria");
application.setOrganizationDomain("fr");
dtkVisualizationWidgetsDataManager* manager = dtkVisualizationWidgetsDataManager::instance();
dtkVisualizationWidgetsDataManager *manager = dtkVisualizationWidgetsDataManager::instance();
dtkVisualizationWidgetsDataSerie *data = new dtkVisualizationWidgetsDataSerie;
manager->addData(data, Qt::red);
manager->show();
manager->raise();
......
......@@ -123,7 +123,7 @@ dtkVisualizationWidgetsDataManagerItem *dtkVisualizationWidgetsDataManagerPrivat
bool multiple_images = (data_serie->count() > 1);
dtkVisualizationWidgetsDataManagerItem *item = new dtkVisualizationWidgetsDataManagerItem(color, *data_serie->pixmap(), this, multiple_images);
auto item = new dtkVisualizationWidgetsDataManagerItem(color, data_serie->pixmap(), this, multiple_images);
connect(item, &dtkVisualizationWidgetsDataManagerItem::destroy, [=] () {
this->contents->layout()->removeWidget(item);
......@@ -163,7 +163,7 @@ dtkVisualizationWidgetsDataManagerItem *dtkVisualizationWidgetsDataManagerPrivat
// Meta data computation
// ///////////////////////////////////////////////////////////////////
dtkVisualizationWidgetsDataManagerData *data = new dtkVisualizationWidgetsDataManagerData(this);
auto data = new dtkVisualizationWidgetsDataManagerData(this);
data->reference = item;
// data->data["Dimension X"] = o->GetDimensions()[0];
// data->data["Dimension Y"] = o->GetDimensions()[1];
......@@ -205,12 +205,12 @@ dtkVisualizationWidgetsDataManager *dtkVisualizationWidgetsDataManager::instance
return s_instance;
}
void dtkVisualizationWidgetsDataManager::addImage(dtkVisualizationWidgetsDataSeriePtr images_serie, const QColor& color)
void dtkVisualizationWidgetsDataManager::addData(dtkVisualizationWidgetsDataSeriePtr data_serie, const QColor& color)
{
dtkVisualizationWidgetsDataManagerItem *item = d->create(images_serie, color);
dtkVisualizationWidgetsDataManagerItem *item = d->create(data_serie, color);
item->id = d->item_counter++;
d->images_series.insert(item, images_serie);
d->images_series.insert(item, data_serie);
d->contents->layout()->addWidget(item);
}
......
......@@ -34,10 +34,10 @@ signals:
void expand(void);
public:
QSize sizeHint(void) const;
QSize sizeHint(void) const override;
public slots:
void addImage(dtkVisualizationWidgetsDataSeriePtr, const QColor&);
void addData(dtkVisualizationWidgetsDataSeriePtr, const QColor&);
public slots:
void present(dtkVisualizationWidgetsDataManagerItem *);
......
//
// Created by Erwan Demairy on 28/08/201935.
//
#include "dtkVisualizationWidgetsDataSerie.h"
#include <QApplication>
#include <QStyle>
QPixmap *dtkVisualizationWidgetsDataSerie::pixmap() {
return nullptr;
QPixmap dtkVisualizationWidgetsDataSerie::pixmap() {
QStyle *style = QApplication::style();
QIcon icon = style->standardIcon(QStyle::SP_DesktopIcon );
return icon.pixmap(50,50);
}
long dtkVisualizationWidgetsDataSerie::count() {
......
......@@ -11,7 +11,7 @@
class dtkVisualizationWidgetsDataSerie: public QObject {
Q_OBJECT
public:
QPixmap* pixmap();
QPixmap pixmap();
long count();
};
using dtkVisualizationWidgetsDataSeriePtr = QPointer<dtkVisualizationWidgetsDataSerie>;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment