OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
ot::StyleRefPainter2D Class Reference

The StyleRefPainter2D can be used to reference a ColorStyleValue in the active ColorStyle. More...

#include "StyleRefPainter2D.h"

Inheritance diagram for ot::StyleRefPainter2D:
ot::Painter2D ot::Serializable

Public Member Functions

 StyleRefPainter2D (ColorStyleValueEntry _referenceKey=ColorStyleValueEntry::WidgetBackground)
 
virtual ~StyleRefPainter2D ()
 
virtual void addToJsonObject (JsonValue &_object, JsonAllocator &_allocator) const override
 Add the object contents to the provided JSON object.
 
virtual void setFromJsonObject (const ConstJsonObject &_object) override
 Will set the object contents from the provided JSON object.
 
virtual std::string getFactoryKey (void) const override
 Returns the key that is used to create an instance of this class in the simple factory.
 
virtual std::string generateQss (void) const override
 
virtual ot::Color getDefaultColor (void) const override
 
virtual bool isEqualTo (const Painter2D *_other) const override
 Returns true if this painter is equal to the other painter.
 
void setReferenceKey (ColorStyleValueEntry _referenceKey)
 Sets the key of the ColorStyleValue that should be referenced.
 
ColorStyleValueEntry getReferenceKey (void) const
 Key of the ColorStyleValue that is referenced.
 
- Public Member Functions inherited from ot::Painter2D
 Painter2D ()
 
virtual ~Painter2D ()
 
Painter2DcreateCopy (void) const
 Creates a copy of this painter.
 
- Public Member Functions inherited from ot::Serializable
 Serializable ()
 
virtual ~Serializable ()
 
virtual void addToJsonObject (ot::JsonValue &_object, ot::JsonAllocator &_allocator) const =0
 Add the object contents to the provided JSON object.
 

Detailed Description

The StyleRefPainter2D can be used to reference a ColorStyleValue in the active ColorStyle.

Note
Note that the reference is only evaluated in the frontend by the QtFactory.

Constructor & Destructor Documentation

◆ StyleRefPainter2D()

ot::StyleRefPainter2D::StyleRefPainter2D ( ColorStyleValueEntry _referenceKey = ColorStyleValueEntry::WidgetBackground)

◆ ~StyleRefPainter2D()

ot::StyleRefPainter2D::~StyleRefPainter2D ( )
virtual

Member Function Documentation

◆ addToJsonObject()

void ot::StyleRefPainter2D::addToJsonObject ( JsonValue & _object,
JsonAllocator & _allocator ) const
overridevirtual

Add the object contents to the provided JSON object.

Parameters
_documentThe JSON document (used to get the allocator)
_objectThe JSON object to add the contents to

Reimplemented from ot::Painter2D.

◆ generateQss()

std::string ot::StyleRefPainter2D::generateQss ( void ) const
overridevirtual

Implements ot::Painter2D.

◆ getDefaultColor()

ot::Color ot::StyleRefPainter2D::getDefaultColor ( void ) const
overridevirtual

Implements ot::Painter2D.

◆ getFactoryKey()

virtual std::string ot::StyleRefPainter2D::getFactoryKey ( void ) const
inlineoverridevirtual

Returns the key that is used to create an instance of this class in the simple factory.

Implements ot::Painter2D.

◆ getReferenceKey()

ColorStyleValueEntry ot::StyleRefPainter2D::getReferenceKey ( void ) const
inline

Key of the ColorStyleValue that is referenced.

◆ isEqualTo()

bool ot::StyleRefPainter2D::isEqualTo ( const Painter2D * _other) const
overridevirtual

Returns true if this painter is equal to the other painter.

Implements ot::Painter2D.

◆ setFromJsonObject()

void ot::StyleRefPainter2D::setFromJsonObject ( const ConstJsonObject & _object)
overridevirtual

Will set the object contents from the provided JSON object.

Parameters
_objectThe JSON object containing the information
Exceptions
Willthrow an exception if the provided object is not valid (members missing or invalid types)

Reimplemented from ot::Painter2D.

◆ setReferenceKey()

void ot::StyleRefPainter2D::setReferenceKey ( ColorStyleValueEntry _referenceKey)
inline

Sets the key of the ColorStyleValue that should be referenced.

Parameters
_referenceKeyKey to set.

The documentation for this class was generated from the following files: