Files
nodeeditor/examples/example2/TextSourceDataModel.cpp
T

51 lines
736 B
C++
Raw Normal View History

2016-05-31 23:22:03 +02:00
#include "TextSourceDataModel.hpp"
// For some reason CMake could not generate moc-files correctly
// without having a cpp for an QObject from hpp.
TextSourceDataModel::
TextSourceDataModel()
: _lineEdit(new QLineEdit("Default Text"))
{
//
}
unsigned int
TextSourceDataModel::
2016-06-05 22:16:43 +02:00
nPorts(PortType portType) const
2016-05-31 23:22:03 +02:00
{
unsigned int result = 1;
switch (portType)
{
case PortType::IN:
result = 0;
break;
case PortType::OUT:
result = 1;
default:
break;
}
return result;
}
NodeDataType
TextSourceDataModel::
dataType(PortType, PortIndex) const
{
return TextData().type();
}
2016-05-31 23:22:03 +02:00
std::shared_ptr<NodeData>
TextSourceDataModel::
outData(PortIndex)
2016-05-31 23:22:03 +02:00
{
return std::make_shared<TextData>();
}