src/app/qgsaddattrdialog.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002                          qgsaddattrdialog.h  -  description
00003                              -------------------
00004     begin                : January 2005
00005     copyright            : (C) 2005 by Marco Hugentobler
00006     email                : marco.hugentobler@autoform.ch
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 #include "qgsaddattrdialog.h"
00019 #include "qgsvectordataprovider.h"
00020 
00021 QgsAddAttrDialog::QgsAddAttrDialog( QgsVectorDataProvider* provider, QWidget *parent, Qt::WFlags fl )
00022     : QDialog( parent, fl ), mDataProvider( provider )
00023 {
00024   setupUi( this );
00025 
00026   //fill data types into the combo box
00027   const QgsNativeTypeMap &typelist = mDataProvider->supportedNativeTypes();
00028 
00029   for ( QgsNativeTypeMap::const_iterator it = typelist.constBegin(); it != typelist.constEnd(); ++it )
00030   {
00031     mTypeBox->addItem( it.key() );
00032   }
00033 }
00034 
00035 QgsAddAttrDialog::QgsAddAttrDialog( const std::list<QString>& typelist, QWidget *parent, Qt::WFlags fl )
00036     : QDialog( parent, fl ), mDataProvider( 0 )
00037 {
00038   setupUi( this );
00039 
00040   for ( std::list<QString>::const_iterator iter = typelist.begin();iter != typelist.end();++iter )
00041   {
00042     mTypeBox->addItem( *iter );
00043   }
00044 }
00045 
00046 QString QgsAddAttrDialog::name() const
00047 {
00048   return mNameEdit->text();
00049 }
00050 
00051 QString QgsAddAttrDialog::type() const
00052 {
00053   return mTypeBox->currentText();
00054 }

Generated on Tue Oct 28 16:51:25 2008 for Quantum GIS API Documentation by  doxygen 1.5.1