2011-06-01 14:40:06 +02:00
|
|
|
#ifndef MONITOREDDATAMAPPER_H
|
|
|
|
#define MONITOREDDATAMAPPER_H
|
|
|
|
|
|
|
|
#include <QDataWidgetMapper>
|
|
|
|
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
class QWidget;
|
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
2011-11-13 13:19:52 +01:00
|
|
|
/** Data to Widget mapper that watches for edits and notifies listeners when a field is edited.
|
|
|
|
This can be used, for example, to enable a commit/apply button in a configuration dialog.
|
2011-06-01 14:40:06 +02:00
|
|
|
*/
|
|
|
|
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
|