00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
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
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 }