aboutsummaryrefslogtreecommitdiff
path: root/src/qt/monitoreddatamapper.h
blob: 4dd2d1a86a63c4f50e1143144b84d0d699e024a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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