~ubuntu-branches/ubuntu/quantal/qgis/quantal

« back to all changes in this revision

Viewing changes to src/qgsdelattrdialog.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Steve Halasz
  • Date: 2005-11-05 16:04:45 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20051105160445-l0g4isz5bc9yehet
Tags: 0.7.4-1
* New upstream release
* Build GRASS support in qgis-plugin-grass package (Closes: #248649)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
                         qgsdelattrdialog.cpp  -  description
 
3
                             -------------------
 
4
    begin                : January 2005
 
5
    copyright            : (C) 2005 by Marco Hugentobler
 
6
    email                : marco.hugentobler@autoform.ch
 
7
 ***************************************************************************/
 
8
 
 
9
/***************************************************************************
 
10
 *                                                                         *
 
11
 *   This program is free software; you can redistribute it and/or modify  *
 
12
 *   it under the terms of the GNU General Public License as published by  *
 
13
 *   the Free Software Foundation; either version 2 of the License, or     *
 
14
 *   (at your option) any later version.                                   *
 
15
 *                                                                         *
 
16
 ***************************************************************************/
 
17
 
 
18
#include "qgsdelattrdialog.h"
 
19
#include "qgsfield.h"
 
20
#include <qheader.h>
 
21
#include <qlistbox.h>
 
22
 
 
23
QgsDelAttrDialog::QgsDelAttrDialog(QHeader* header): QgsDelAttrDialogBase()
 
24
{
 
25
    QObject::connect((QObject*)mOkButton, SIGNAL(clicked()), this, SLOT(accept()));
 
26
    QObject::connect((QObject*)mCancelButton, SIGNAL(clicked()), this, SLOT(reject()));
 
27
 
 
28
    //insert attribute names into the QListView
 
29
    if(header)
 
30
    {
 
31
        listBox2->clear();
 
32
        for(int i=1;i<header->count();++i)
 
33
        {
 
34
            listBox2->insertItem(header->label(i));
 
35
        }
 
36
    }
 
37
}
 
38
 
 
39
const std::list<QString>* QgsDelAttrDialog::selectedAttributes()
 
40
{
 
41
    mSelectedItems.clear();
 
42
    for(int i=0;i<listBox2->numRows();++i)
 
43
    {
 
44
        if(listBox2->isSelected(i))
 
45
        {
 
46
            mSelectedItems.push_back(listBox2->text(i));
 
47
        }
 
48
    }
 
49
    return &mSelectedItems;
 
50
}