aboutsummaryrefslogtreecommitdiff
path: root/src/qt/monitoreddatamapper.h
diff options
context:
space:
mode:
authorGavin Andresen <gavinandresen@gmail.com>2011-09-26 06:05:11 -0700
committerGavin Andresen <gavinandresen@gmail.com>2011-09-26 06:05:11 -0700
commitf7f2a36925bb560363f691fc3ca3dec83830dd15 (patch)
treec09327d910abe4e7947c53dcbb5f15b01ab194c1 /src/qt/monitoreddatamapper.h
parentf8937b2d3bb545a0a6ff78031ce3cdcb3208ecbe (diff)
parent0465c41c847ddee7eeb5caefb164149400ff8395 (diff)
Merge pull request #521 from laanwj/qt
Qt GUI
Diffstat (limited to 'src/qt/monitoreddatamapper.h')
-rw-r--r--src/qt/monitoreddatamapper.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/qt/monitoreddatamapper.h b/src/qt/monitoreddatamapper.h
new file mode 100644
index 0000000000..4dd2d1a86a
--- /dev/null
+++ b/src/qt/monitoreddatamapper.h
@@ -0,0 +1,32 @@
+#ifndef MONITOREDDATAMAPPER_H
+#define MONITOREDDATAMAPPER_H
+
+#include <QDataWidgetMapper>
+
+QT_BEGIN_NAMESPACE
+class QWidget;
+QT_END_NAMESPACE
+
+/* Data <-> Widget mapper that watches for changes,
+ to be able to notify when 'dirty' (for example, to
+ enable a commit/apply button).
+ */
+class MonitoredDataMapper : public QDataWidgetMapper
+{
+ Q_OBJECT
+public:
+ explicit MonitoredDataMapper(QObject *parent=0);
+
+ void addMapping(QWidget *widget, int section);
+ void addMapping(QWidget *widget, int section, const QByteArray &propertyName);
+private:
+ void addChangeMonitor(QWidget *widget);
+
+signals:
+ void viewModified();
+
+};
+
+
+
+#endif // MONITOREDDATAMAPPER_H