Commit 3b3a19a5 authored by KLOCZKO Thibaud's avatar KLOCZKO Thibaud
Browse files

Add management of a QStringList through meta container.

parent 3c1ce998
...@@ -22,6 +22,8 @@ ...@@ -22,6 +22,8 @@
#include <dtkCore/dtkArray> #include <dtkCore/dtkArray>
#include <dtkLog> #include <dtkLog>
#include <QtCore>
// ///////////////////////////////////////////////////////////////// // /////////////////////////////////////////////////////////////////
// dtkComposerNodeMetaContainerPrivate interface // dtkComposerNodeMetaContainerPrivate interface
// ///////////////////////////////////////////////////////////////// // /////////////////////////////////////////////////////////////////
...@@ -62,6 +64,7 @@ void dtkComposerNodeMetaContainer::run(void) ...@@ -62,6 +64,7 @@ void dtkComposerNodeMetaContainer::run(void)
if (!d->receiver_value.isEmpty()) { if (!d->receiver_value.isEmpty()) {
int type = d->receiver_value.data().type(); int type = d->receiver_value.data().type();
QStringList *slist;
switch (type) { switch (type) {
case QMetaType::Int: case QMetaType::Int:
...@@ -95,6 +98,15 @@ void dtkComposerNodeMetaContainer::run(void) ...@@ -95,6 +98,15 @@ void dtkComposerNodeMetaContainer::run(void)
var_container = dtkMetaType::variantFromValue(new dtkArray<double>(size, d->receiver_value.data<double>())); var_container = dtkMetaType::variantFromValue(new dtkArray<double>(size, d->receiver_value.data<double>()));
break; break;
case QMetaType::QString:
slist = new QStringList;
slist->reserve(size);
for(int i = 0; i < size; ++i) {
slist->append(d->receiver_value.data<QString>());
};
var_container = dtkMetaType::variantFromValue(slist);
break;
default: default:
var_container = dtkMetaType::variantFromValue(new dtkArray<QVariant>(size, d->receiver_value.data())); var_container = dtkMetaType::variantFromValue(new dtkArray<QVariant>(size, d->receiver_value.data()));
break; break;
......
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