Quantum GIS API Documentation  1.8
src/gui/qgsfieldvalidator.h
Go to the documentation of this file.
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 );
00035     ~QgsFieldValidator();
00036 
00037     virtual State validate( QString &, int & ) const;
00038     virtual void fixup( QString & ) const;
00039 
00040   private:
00041     // Disables copy constructing
00042     Q_DISABLE_COPY( QgsFieldValidator )
00043 
00044     QValidator *mValidator;
00045     QgsField mField;
00046     QString mNullValue;
00047 };
00048 
00049 #endif // QGSFIELDVALIDATOR_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines