#ifndef FIELD_H #define FIELD_H #include #include #include #include #include #include #include class Field : public QObject { Q_OBJECT public: Field(QWidget *parent, int db_id, int PropId, int BacType, QString label = QString()); Field() {}; virtual ~Field() {}; void SaveToDB(QSqlDatabase *dbh); virtual void SetValue(QVariant value) { this->value = value; } QWidget *Input(); QWidget *Label(); QVariant Value(); int BacType; // Database type int PropId; // Database id public slots: void valueChanged(int value) { this->value = value; } void valueChanged(const QString &value) { this->value = value; } void valueChanged(const QDateTime &value) { this->value = value; } protected: virtual int calculateLength() = 0; QWidget *parent; QWidget *input; QLabel *label; QVariant value; int db_id; // ID of object, not property }; #endif