32af5266cf
- try to enforce the same style to all Qt related files - remove unneeded includes from the files - add missing Q_OBJECT, QT_BEGIN_NAMESPACE / QT_END_NAMESPACE - prepares for a pull-req to include Qt5 compatibility
31 lines
726 B
C++
31 lines
726 B
C++
#ifndef MONITOREDDATAMAPPER_H
|
|
#define MONITOREDDATAMAPPER_H
|
|
|
|
#include <QDataWidgetMapper>
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
class QWidget;
|
|
QT_END_NAMESPACE
|
|
|
|
/** 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.
|
|
*/
|
|
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
|