src/app/qgsdelattrdialog.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002                          qgsdelattrdialog.cpp  -  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 "qgsdelattrdialog.h"
00019 #include "qgsfield.h"
00020 #include <QHeaderView>
00021 
00022 QgsDelAttrDialog::QgsDelAttrDialog( QHeaderView* header ): QDialog()
00023 {
00024   setupUi( this );
00025 
00026   //insert attribute names into the QListView
00027   if ( header )
00028   {
00029     listBox2->clear();
00030     QAbstractItemModel *model = header->model();
00031     for ( int i = 1;i < header->count();++i )
00032     {
00033       listBox2->addItem( model->headerData( i, Qt::Horizontal ).toString() );
00034     }
00035   }
00036 }
00037 
00038 const std::list<QString>* QgsDelAttrDialog::selectedAttributes()
00039 {
00040   mSelectedItems.clear();
00041   QListIterator<QListWidgetItem *> selection( listBox2->selectedItems() );
00042   while ( selection.hasNext() )
00043   {
00044     mSelectedItems.push_back( selection.next()->text() );
00045   }
00046   return &mSelectedItems;
00047 }

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