#ifndef IVALIDATOR_H #define IVALIDATOR_H #include #include class IValidator { public: IValidator(QWidget *widget, const QString &errMessage) { m_widget = widget; m_errMessage = errMessage; } virtual bool validate() = 0; QString errMessage() { return m_errMessage; } protected: QWidget *m_widget; private: QString m_errMessage; }; #endif // IVALIDATOR_H