修改了LayerStyle的materialStyles的类型,添加了深拷贝构造函数
parent
7c7cd02d71
commit
94b16ac536
|
@ -45,6 +45,15 @@ QWidget* StrokeElementLayerStyle::getListDisplayWidget() const
|
|||
return w;
|
||||
}
|
||||
|
||||
StrokeElementLayerStyle::StrokeElementLayerStyle(StrokeElementLayerStyle& other)
|
||||
{
|
||||
materialStyles = std::vector<std::shared_ptr<Renderer::MaterialStyleStroke>>(other.materialStyles.size());
|
||||
for (size_t i = 0; i < other.materialStyles.size(); i++)
|
||||
{
|
||||
materialStyles[i] = std::make_shared<Renderer::MaterialStyleStroke>(*other.materialStyles[i]);
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<Renderer::BaseStyle> FillElementLayerStyle::toBaseStyles() const
|
||||
{
|
||||
return std::vector<Renderer::BaseStyle>();
|
||||
|
@ -73,3 +82,12 @@ QWidget* FillElementLayerStyle::getListDisplayWidget() const
|
|||
layout->addWidget(name);
|
||||
return w;
|
||||
}
|
||||
|
||||
FillElementLayerStyle::FillElementLayerStyle(FillElementLayerStyle& other)
|
||||
{
|
||||
materialStyles = std::vector<std::shared_ptr<Renderer::MaterialStyleFill>>(other.materialStyles.size());
|
||||
for (size_t i = 0; i < other.materialStyles.size(); i++)
|
||||
{
|
||||
materialStyles[i] = std::make_shared<Renderer::MaterialStyleFill>(*other.materialStyles[i]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,8 +34,9 @@ public:
|
|||
QWidget* getInputWidget() const override;
|
||||
QWidget* getListDisplayWidget() const override;
|
||||
StrokeElementLayerStyle() = default;
|
||||
StrokeElementLayerStyle(StrokeElementLayerStyle& other);
|
||||
~StrokeElementLayerStyle() = default;
|
||||
std::vector<std::shared_ptr<Renderer::MaterialStroke>> materialStyles;
|
||||
std::vector<std::shared_ptr<Renderer::MaterialStyleStroke>> materialStyles;
|
||||
};
|
||||
|
||||
class FillElementLayerStyle : public Renderer::ElementStyle, public LayerStyle
|
||||
|
@ -46,6 +47,7 @@ public:
|
|||
QWidget* getInputWidget() const override;
|
||||
QWidget* getListDisplayWidget() const override;
|
||||
FillElementLayerStyle() = default;
|
||||
FillElementLayerStyle(FillElementLayerStyle& other);
|
||||
~FillElementLayerStyle() = default;
|
||||
std::vector<std::shared_ptr<Renderer::MaterialFill>> materialStyles;
|
||||
std::vector<std::shared_ptr<Renderer::MaterialStyleFill>> materialStyles;
|
||||
};
|
Loading…
Reference in New Issue