QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
qgssublayersdialog.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgssublayersdialog.h - dialog for selecting sublayers
3  ---------------------
4  begin : January 2009
5  copyright : (C) 2009 by Florian El Ahdab
6  email : felahdab at gmail dot com
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 
16 #ifndef QGSSUBLAYERSDIALOG_H
17 #define QGSSUBLAYERSDIALOG_H
18 
19 #include <QDialog>
20 #include <ui_qgssublayersdialogbase.h>
21 #include "qgscontexthelp.h"
22 
26 class GUI_EXPORT QgsSublayersDialog : public QDialog, private Ui::QgsSublayersDialogBase
27 {
28  Q_OBJECT
29  public:
30 
32  {
33  Ogr,
35  Vsifile
36  };
37 
40  typedef struct LayerDefinition
41  {
42  LayerDefinition() : layerId( -1 ), count( -1 ) {}
43 
44  int layerId;
46  int count;
49 
53 
54  QgsSublayersDialog( ProviderType providerType, const QString& name, QWidget* parent = nullptr, const Qt::WindowFlags& fl = nullptr );
56 
59  void populateLayerTable( const LayerDefinitionList& list );
60 
63  LayerDefinitionList selection();
64 
66  Q_DECL_DEPRECATED void populateLayerTable( const QStringList& theList, const QString& delim = ":" );
68  Q_DECL_DEPRECATED QStringList selectionNames();
70  Q_DECL_DEPRECATED QList<int> selectionIndexes();
71 
72  public slots:
73  void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
74  int exec();
75 
76  protected:
79  bool mShowCount;
80  bool mShowType;
81 };
82 
83 #endif
QString layerName
name of the layer (not necessarily unique)
int layerId
identifier of the layer (one unique layer id may have multiple types though)
QList< LayerDefinition > LayerDefinitionList
List of layer definitions for the purpose of this dialog.
QStringList mSelectedSubLayers
bool mShowType
whether to show type in the table
bool mShowCount
whether to show number of features in the table
static void run(const QString &context)
int count
number of features (might be unused)
QString type
extra type depending on the use (e.g. geometry type for vector sublayers)
typedef WindowFlags
A structure that defines layers for the purpose of this dialog.