OpenLexocad  28.0
PropertyDateTime.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <QDateTime>
4 #include <Core/Property.h>
5 
6 namespace Core
7 {
8 class LX_CORE_EXPORT PropertyDateTime : public Core::Property
9 {
11 
12 public:
13  void setValue(const QDateTime& t);
14  bool setValueFromVariant(const Core::Variant& value);
16 
17  const QDateTime& getValue() const;
19 
20  virtual void save(Base::AbstractWriter& writer, Base::PersistenceVersion& save_version);
21  virtual bool createSQL(Base::AbstractWriter& writer, Base::PersistenceVersion& save_version, bool data) override;
23  virtual bool isEqual(const Property*) const;
24  virtual Core::Property* copy(void) const override;
25  virtual void paste(const Core::Property& from) override;
26 
27 
28 protected:
29  QDateTime _datetime;
30 };
31 
32 class LX_CORE_EXPORT PropertyDateTimeList : public Core::Property
33 {
35 
36 public:
39 
40  void setValue(const std::list<QDateTime>& dtlist);
41  bool setValueFromVariant(const Core::Variant& value);
43 
44  void addDateTime(const QDateTime& t);
45  void setEmpty();
46  bool isEmpty() const;
47 
48  const std::list<QDateTime>& getValue() const;
49 
50  Core::Variant getVariant(void) const { return Core::Variant(_dateTimeList); }
51 
52  virtual void save(Base::AbstractWriter& writer, Base::PersistenceVersion& save_version);
54  virtual bool isEqual(const Property*) const;
55  virtual Core::Property* copy(void) const override;
56  virtual void paste(const Core::Property& from) override;
57 
58 protected:
59  std::list<QDateTime> _dateTimeList;
60 };
61 
64 
65 
66 } // namespace Core
Property.h
Core::PropertyDateTimeList::getValue
const std::list< QDateTime > & getValue() const
Core::PropertyDateTime
Definition: PropertyDateTime.h:9
Core::PropertyDateTimeList::~PropertyDateTimeList
virtual ~PropertyDateTimeList()
Core::PropertyDateTimeList
Definition: PropertyDateTime.h:33
Core::PropertyDateTimeList::restore
virtual void restore(Base::AbstractXMLReader &reader, Base::PersistenceVersion &version)
This method is used to restore properties from an XML document.
Core::PropertyDateTimeList::isEqual
virtual bool isEqual(const Property *) const
compare properties
Core::PropertyDateTimeList::setValueFromVariant
bool setValueFromVariant(const Core::Variant &value)
Core::PropertyDateTimeList::PropertyDateTimeList
PropertyDateTimeList()
Core::PropertyDateTimeList::_dateTimeList
std::list< QDateTime > _dateTimeList
Definition: PropertyDateTime.h:59
Core::PropertyDateTimeList::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::PropertyDateTimeList::isEmpty
bool isEmpty() const
Core::PropertyDateTimeList::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.
Core::PropertyDateTimeList::setEmpty
void setEmpty()
Core::PropertyDateTimeList::getVariant
Core::Variant getVariant(void) const
Definition: PropertyDateTime.h:50
Core::PropertyDateTime::restore
virtual void restore(Base::AbstractXMLReader &reader, Base::PersistenceVersion &version)
This method is used to restore properties from an XML document.
Core::PropertyDateTimeList::paste
virtual void paste(const Core::Property &from) override
Paste the value from the property (mainly for Undo/Redo and transactions)
Base::PersistenceVersion
Definition: Persistence.h:13
Core::PropertyDateTime::setValueFromVariant
bool setValueFromVariant(const Core::Variant &value)
Core
Definition: Base.h:5
Core::PropertyDateTime::getVariant
Core::Variant getVariant(void) const
Core::Variant
Definition: Variant.h:78
Base::AbstractWriter
Definition: Writer.h:13
Core::PropertyDateTime::isEqual
virtual bool isEqual(const Property *) const
compare properties
Core::PropertyDateTime::createSQL
virtual bool createSQL(Base::AbstractWriter &writer, Base::PersistenceVersion &save_version, bool data) override
This method is used to save properties or very small amounts of data to an XML document.
Base::AbstractXMLReader
Definition: AbstractXMLReader.h:7
Core::PropertyDateTimeList::copyValue
void copyValue(Core::Property *p)
Core::PropertyDateTime::setValue
void setValue(const QDateTime &t)
Core::PropertyDateTime::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::PropertyDateTime::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.
Core::version
LX_CORE_EXPORT Version & version
Core::PropertyDateTimeList::addDateTime
void addDateTime(const QDateTime &t)
Core::Property
Definition: Property.h:72
Core::PropertyDateTime::copyValue
void copyValue(Core::Property *p)
Core::PropertyDateTime::getValue
const QDateTime & getValue() const
Core::PropertyDateTime::paste
virtual void paste(const Core::Property &from) override
Paste the value from the property (mainly for Undo/Redo and transactions)
Core::PropertyDateTime::_datetime
QDateTime _datetime
Definition: PropertyDateTime.h:29
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::PropertyDateTimeList::setValue
void setValue(const std::list< QDateTime > &dtlist)