|
Quantum GIS API Documentation
master-693a1fe
|
00001 /*************************************************************************** 00002 qgsfieldvalidator.h - description 00003 ------------------- 00004 begin : March 2011 00005 copyright : (C) 2011 by SunilRajKiran-kCube 00006 email : sunilraj.kiran@kcubeconsulting.com 00007 00008 adapted version of QValidator for QgsField 00009 ***************************************************************************/ 00010 00011 /*************************************************************************** 00012 * * 00013 * This program is free software; you can redistribute it and/or modify * 00014 * it under the terms of the GNU General Public License as published by * 00015 * the Free Software Foundation; either version 2 of the License, or * 00016 * (at your option) any later version. * 00017 * * 00018 ***************************************************************************/ 00019 00020 #ifndef QGSFIELDVALIDATOR_H 00021 #define QGSFIELDVALIDATOR_H 00022 00023 #include <QValidator> 00024 #include <QVariant> 00025 #include <QSettings> 00026 #include "qgsfield.h" 00027 00028 00029 class GUI_EXPORT QgsFieldValidator : public QValidator 00030 { 00031 Q_OBJECT 00032 00033 public: 00034 QgsFieldValidator( QObject *parent, const QgsField &field, QString dateFormat ); 00035 ~QgsFieldValidator(); 00036 00037 virtual State validate( QString &, int & ) const; 00038 virtual void fixup( QString & ) const; 00039 00040 QString dateFormat() const { return mDateFormat; } 00041 00042 private: 00043 // Disables copy constructing 00044 Q_DISABLE_COPY( QgsFieldValidator ) 00045 00046 QValidator *mValidator; 00047 QgsField mField; 00048 QString mNullValue; 00049 QString mDateFormat; 00050 }; 00051 00052 #endif // QGSFIELDVALIDATOR_H