36 lines
553 B
C++
Raw Normal View History

2023-02-28 14:50:28 +08:00
#pragma once
#include <QtGui/QPixmap>
#include "NodeDataModel.hpp"
using QtNodes::NodeData;
using QtNodes::NodeDataType;
/// The class can potentially incapsulate any user data which
/// need to be transferred within the Node Editor graph
class PixmapData : public NodeData
{
public:
PixmapData() {}
PixmapData(QPixmap const& pixmap)
: _pixmap(pixmap)
{}
NodeDataType
type() const override
{
// id name
return { "pixmap", "QPixmap" };
}
QPixmap
pixmap() const { return _pixmap; }
private:
QPixmap _pixmap{};
};