-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Applied patch from ticket #767 by Florian El Ahdab.
Thanks for the contribution! I've slightly modified the patch to simplify some pieces of code. git-svn-id: http://svn.osgeo.org/qgis/trunk@10065 c8812cc2-4d05-0410-92ff-de0c093fc19c
- Loading branch information
wonder
committed
Jan 31, 2009
1 parent
66ec89c
commit 0f0f381
Showing
9 changed files
with
430 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/*************************************************************************** | ||
qgsogrsublayersdialog.cpp - dialog for selecting ogr sublayers | ||
--------------------- | ||
begin : January 2009 | ||
copyright : (C) 2009 by Florian El Ahdab | ||
email : felahdab at gmail dot com | ||
*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
***************************************************************************/ | ||
/* $Id$ */ | ||
|
||
#include "qgsogrsublayersdialog.h" | ||
|
||
#include <QTableWidgetItem> | ||
|
||
|
||
QgsOGRSublayersDialog::QgsOGRSublayersDialog( QWidget* parent, Qt::WFlags fl ) | ||
: QDialog( parent, fl ) | ||
{ | ||
setupUi( this ); | ||
QStringList labels=QStringList() << "Layer ID" << "Layer name" << "Nb of features" << "Geometry type"; | ||
layersTable->setHeaderLabels(labels); | ||
} | ||
|
||
QgsOGRSublayersDialog::~QgsOGRSublayersDialog() | ||
{ | ||
} | ||
|
||
QStringList QgsOGRSublayersDialog::getSelection() | ||
{ | ||
QStringList list=QStringList(); | ||
for (int i = 0; i < layersTable-> selectedItems().size(); i++) | ||
{ | ||
QString theItem =layersTable-> selectedItems().at(i)->text(1); | ||
list.append(theItem); | ||
} | ||
return list; | ||
} | ||
|
||
void QgsOGRSublayersDialog::populateLayerTable (QStringList theList) | ||
{ | ||
for (int i =0; i< theList.size(); i++){ | ||
QString ligne = theList.at(i); | ||
QStringList elements = ligne.split(":"); | ||
QStringList item=QStringList(); | ||
item << elements.at(0) << elements.at(1) << elements.at(2) << elements.at(3); | ||
layersTable -> addTopLevelItem(new QTreeWidgetItem(item)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/*************************************************************************** | ||
qgsogrsublayersdialog.h - dialog for selecting ogr sublayers | ||
--------------------- | ||
begin : January 2009 | ||
copyright : (C) 2009 by Florian El Ahdab | ||
email : felahdab at gmail dot com | ||
*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
***************************************************************************/ | ||
/* $Id$ */ | ||
|
||
#ifndef QGSOGRSUBLAYERSDIALOG_H | ||
#define QGSOGRSUBLAYERSDIALOG_H | ||
|
||
#include <QDialog> | ||
#include <ui_qgsogrsublayersdialogbase.h> | ||
|
||
|
||
|
||
class QgsOGRSublayersDialog : public QDialog, private Ui::QgsOGRSublayersDialogBase | ||
{ | ||
Q_OBJECT | ||
public: | ||
QgsOGRSublayersDialog( QWidget* parent = 0, Qt::WFlags fl = 0 ); | ||
~QgsOGRSublayersDialog(); | ||
void populateLayerTable(QStringList theList); | ||
QStringList getSelection(); | ||
|
||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.