diff options
Diffstat (limited to 'src/properties.h')
-rw-r--r-- | src/properties.h | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/src/properties.h b/src/properties.h index c6147e4..efde85b 100644 --- a/src/properties.h +++ b/src/properties.h @@ -11,7 +11,9 @@ #include "vector3f.h" #include <QColor> +#include <QMap> #include <QString> +#include <QTextStream> namespace editor { @@ -64,16 +66,23 @@ public: } /** + * @brief returns the comment string for a specified attribute + * */ + inline const QString comment(const QString &attribute) const { + return properties_comments[attribute]; + } + + /** * @brief returns the info string of this object * */ - inline const QString & info() const { + inline const QString &info() const { return properties_info; } /** * @brief returns the values string of this object * */ - inline const QString & values() const { + inline const QString &values() const { return properties_values; } @@ -87,6 +96,13 @@ public: } /** + * @brief set the comments string for a specified attribute + * */ + inline void set_comment(const QString attribute, const QString &text) { + properties_comments[attribute] = text; + } + + /** * @brief set the info string of this object * */ inline void set_info(const QString &text) { @@ -162,12 +178,23 @@ public: properties_color.setRgb(r, g, b); } +protected: + /** + * @brief save attribute comments to a textstream + * */ + void save_comment(QTextStream &textstream, const QString &attribute); private: + typedef QMap<QString, QString> Comments; + + /// comments for this objects QString properties_comment; + /// comments for the individual attributes; + Comments properties_comments; + QString properties_label; QString properties_name; - + Vector3f properties_location; QColor properties_color; |