| 1 | /* This file is part of Mapnik (c++ mapping toolkit) |
|---|
| 2 | * Copyright (C) 2007 Artem Pavlenko |
|---|
| 3 | * |
|---|
| 4 | * Mapnik is free software; you can redistribute it and/or |
|---|
| 5 | * modify it under the terms of the GNU General Public License |
|---|
| 6 | * as published by the Free Software Foundation; either version 2 |
|---|
| 7 | * of the License, or any later version. |
|---|
| 8 | * |
|---|
| 9 | * This program is distributed in the hope that it will be useful, |
|---|
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 12 | * GNU General Public License for more details. |
|---|
| 13 | * |
|---|
| 14 | * You should have received a copy of the GNU General Public License |
|---|
| 15 | * along with this program; if not, write to the Free Software |
|---|
| 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|---|
| 17 | */ |
|---|
| 18 | |
|---|
| 19 | //$Id$ |
|---|
| 20 | |
|---|
| 21 | #include "info_dialog.hpp" |
|---|
| 22 | |
|---|
| 23 | |
|---|
| 24 | info_dialog::info_dialog(QVector<QPair<QString,QString> > const& info, QWidget *parent) |
|---|
| 25 | : QDialog(parent) |
|---|
| 26 | { |
|---|
| 27 | ui.setupUi(this); |
|---|
| 28 | ui.tableWidget->setHorizontalHeaderItem(0,new QTableWidgetItem("Name")); |
|---|
| 29 | ui.tableWidget->setHorizontalHeaderItem(1,new QTableWidgetItem("Value")); |
|---|
| 30 | |
|---|
| 31 | ui.tableWidget->setRowCount(info.size()); |
|---|
| 32 | ui.tableWidget->setColumnCount(2); |
|---|
| 33 | for (int i=0;i<info.size();++i) |
|---|
| 34 | { |
|---|
| 35 | QTableWidgetItem *keyItem = new QTableWidgetItem(info[i].first); |
|---|
| 36 | QTableWidgetItem *valueItem = new QTableWidgetItem(info[i].second); |
|---|
| 37 | ui.tableWidget->setItem(i,0,keyItem); |
|---|
| 38 | ui.tableWidget->setItem(i,1,valueItem); |
|---|
| 39 | } |
|---|
| 40 | } |
|---|