comparison base/PropertyContainer.h @ 46:5364a9d338a2

* Add Insert Instant function in main window * Ensure selections and window geometry are saved in session file * Add wait cursor on session file save * Various improvements to display of texts in pane (clearer readability) * Use commands for setting properties on layers and panes (still need to batch up multiple sets on the same property) * Fix failure of spectrogram to refresh when initial part became visible * Some fixes & paint optimisations in View &c * Make curve mode for time value layers work properly when resolution == 1 * Some vague improvements for time value layer vertical scale
author Chris Cannam
date Thu, 16 Mar 2006 18:46:00 +0000
parents 8460b3bf8f04
children 39ae3dee27b9
comparison
equal deleted inserted replaced
45:b11edc8b8ea0 46:5364a9d338a2
7 This is experimental software. Not for distribution. 7 This is experimental software. Not for distribution.
8 */ 8 */
9 9
10 #ifndef _PROPERTY_CONTAINER_H_ 10 #ifndef _PROPERTY_CONTAINER_H_
11 #define _PROPERTY_CONTAINER_H_ 11 #define _PROPERTY_CONTAINER_H_
12
13 #include "Command.h"
12 14
13 #include <QString> 15 #include <QString>
14 #include <QObject> 16 #include <QObject>
15 #include <vector> 17 #include <vector>
16 18
87 * Set a property. This is used for all property types. For 89 * Set a property. This is used for all property types. For
88 * boolean properties, zero is false and non-zero true; for 90 * boolean properties, zero is false and non-zero true; for
89 * colours, the integer value should be treated as a qRgb. 91 * colours, the integer value should be treated as a qRgb.
90 */ 92 */
91 virtual void setProperty(const PropertyName &, int value); 93 virtual void setProperty(const PropertyName &, int value);
94
95 /**
96 * Set a property using a command, supporting undo and redo.
97 */
98 virtual void setPropertyWithCommand(const PropertyName &, int value);
99
100 protected:
101
102 class SetPropertyCommand : public Command
103 {
104 public:
105 SetPropertyCommand(PropertyContainer *pc, const PropertyName &pn, int);
106 virtual ~SetPropertyCommand() { }
107
108 virtual void execute();
109 virtual void unexecute();
110 virtual QString getName() const;
111
112 protected:
113 PropertyContainer *m_pc;
114 PropertyName m_pn;
115 int m_value;
116 int m_oldValue;
117 };
92 }; 118 };
93 119
94 #endif 120 #endif