Quantum GIS API Documentation  1.7.4
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 /* $Id$ */
00020 
00021 #ifndef QGSFIELDVALIDATOR_H
00022 #define QGSFIELDVALIDATOR_H
00023 
00024 #include <QValidator>
00025 #include <QVariant>
00026 #include <QSettings>
00027 #include "qgsfield.h"
00028 
00029 
00030 class GUI_EXPORT QgsFieldValidator : public QValidator
00031 {
00032     Q_OBJECT
00033 
00034   public:
00035     QgsFieldValidator( QObject *parent, const QgsField &field );
00036     ~QgsFieldValidator();
00037 
00038     virtual State validate( QString &, int & ) const;
00039     virtual void fixup( QString & ) const;
00040 
00041   private:
00042     // Disables copy constructing
00043     Q_DISABLE_COPY( QgsFieldValidator )
00044 
00045     QValidator *mValidator;
00046     QgsField mField;
00047     QString mNullValue;
00048 };
00049 
00050 #endif // QGSFIELDVALIDATOR_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines