OpenLexocad  28.0
PropertyPercent.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <Core/Property.h>
4 
5 namespace Core
6 {
7 class LX_CORE_EXPORT PropertyPercent : public Core::Property
8 {
10 
11 public:
12  void setValue(int i);
13  bool setValueFromVariant(const Core::Variant& value);
15 
16  int getValue() const;
18 
19  virtual void save(Base::AbstractWriter& writer, Base::PersistenceVersion& save_version);
21  virtual bool isEqual(const Property*) const;
22  virtual Core::Property* copy(void) const override;
23  virtual void paste(const Core::Property& from) override;
24 
25 protected:
26  int _nValue = 0;
27 };
28 
30 
31 } // namespace Core
Property.h
Core::PropertyPercent::restore
virtual void restore(Base::AbstractXMLReader &reader, Base::PersistenceVersion &version)
This method is used to restore properties from an XML document.
Core::PropertyPercent::copyValue
void copyValue(Core::Property *p)
Core::PropertyPercent::getValue
int getValue() const
Core::PropertyPercent::copy
virtual Core::Property * copy(void) const override
Returns a new copy of the property (mainly for Undo/Redo and transactions). The copy has no container...
Core::PropertyPercent::isEqual
virtual bool isEqual(const Property *) const
compare properties
Base::PersistenceVersion
Definition: Persistence.h:13
Core
Definition: Base.h:5
Core::Variant
Definition: Variant.h:78
Core::PropertyPercent
Definition: PropertyPercent.h:8
Base::AbstractWriter
Definition: Writer.h:13
Core::PropertyPercent::setValueFromVariant
bool setValueFromVariant(const Core::Variant &value)
Base::AbstractXMLReader
Definition: AbstractXMLReader.h:7
Core::PropertyPercent::paste
virtual void paste(const Core::Property &from) override
Paste the value from the property (mainly for Undo/Redo and transactions)
Core::PropertyPercent::setValue
void setValue(int i)
Core::version
LX_CORE_EXPORT Version & version
Core::Property
Definition: Property.h:72
Core::PropertyPercent::getVariant
Core::Variant getVariant(void) const
TYPESYSTEM_HEADER
#define TYPESYSTEM_HEADER()
define for subclassing Base::BaseClass
Definition: Base.h:12
Core::DECLARE_PROPERTY_FACTORY
DECLARE_PROPERTY_FACTORY(PropertyAxis1_Factory, Core::PropertyAxis1)
Core::PropertyPercent::save
virtual void save(Base::AbstractWriter &writer, Base::PersistenceVersion &save_version)
This method is used to save properties or very small amounts of data to an XML document.