QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
gui
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 "ui_qgssublayersdialogbase.h"
20
21
#include "
qgis.h
"
22
#include "qgis_gui.h"
23
#include "
qgis_sip.h
"
24
25
#include <QCheckBox>
26
#include <QDialog>
27
34
class
GUI_EXPORT
QgsSublayersDialog
:
public
QDialog,
private
Ui::QgsSublayersDialogBase
35
{
36
Q_OBJECT
37
public
:
42
enum
PromptMode
43
{
44
48
PromptAlways
,
49
53
PromptIfNeeded
,
54
58
PromptNever
,
59
63
PromptLoadAll
64
};
65
Q_ENUM( PromptMode )
66
67
enum
ProviderType
68
{
69
Ogr
,
70
Gdal
,
71
Vsifile
,
72
Mdal
73
};
74
78
struct
LayerDefinition
79
{
81
int
layerId
= -1;
82
84
QString
layerName
;
85
87
int
count
= -1;
88
90
QString
type
;
91
97
QString
description
;
98
};
99
103
typedef
QList<QgsSublayersDialog::LayerDefinition>
LayerDefinitionList
;
104
106
118
Q_DECL_DEPRECATED
QgsSublayersDialog
(
119
ProviderType
providerType,
const
QString &name, QWidget *parent
SIP_TRANSFERTHIS
=
nullptr
, Qt::WindowFlags fl = Qt::WindowFlags(),
const
QString &dataSourceUri = QString()
120
)
SIP_DEPRECATED
;
121
122
~
QgsSublayersDialog
() override;
123
127
void
populateLayerTable
( const
LayerDefinitionList
&list );
128
132
LayerDefinitionList
selection
();
133
137
void
setShowAddToGroupCheckbox
(
bool
showAddToGroupCheckbox
) { mShowAddToGroupCheckbox =
showAddToGroupCheckbox
; }
138
142
bool
showAddToGroupCheckbox
()
const
{
return
mShowAddToGroupCheckbox; }
143
147
bool
addToGroupCheckbox
()
const
{
return
mCbxAddToGroup->isChecked(); }
148
152
int
countColumn
()
const
{
return
mShowCount
? 2 : -1; }
153
154
public
slots:
155
int
exec()
override
;
156
157
private
slots:
158
void
layersTable_selectionChanged(
const
QItemSelection &,
const
QItemSelection & );
159
void
mBtnDeselectAll_pressed();
160
161
protected
:
165
QString
mName
;
166
QStringList
mSelectedSubLayers
;
167
169
bool
mShowCount
=
false
;
171
bool
mShowType
=
false
;
173
bool
mShowDescription
=
false
;
174
175
private
:
177
bool
mShowAddToGroupCheckbox =
false
;
178
};
179
180
#endif
QgsSublayersDialog::mShowType
bool mShowType
Whether to show type in the table.
Definition
qgssublayersdialog.h:171
QgsSublayersDialog::LayerDefinitionList
QList< QgsSublayersDialog::LayerDefinition > LayerDefinitionList
List of layer definitions for the purpose of this dialog.
Definition
qgssublayersdialog.h:103
QgsSublayersDialog::PromptMode
PromptMode
Prompt behavior of the QgsSublayersDialog.
Definition
qgssublayersdialog.h:43
QgsSublayersDialog::PromptNever
@ PromptNever
never prompt, will not load anything
Definition
qgssublayersdialog.h:58
QgsSublayersDialog::PromptAlways
@ PromptAlways
always ask if there are existing sublayers
Definition
qgssublayersdialog.h:48
QgsSublayersDialog::PromptIfNeeded
@ PromptIfNeeded
always ask if there are existing sublayers, but skip if there are bands for rasters
Definition
qgssublayersdialog.h:53
QgsSublayersDialog::PromptLoadAll
@ PromptLoadAll
never prompt, but load all sublayers
Definition
qgssublayersdialog.h:63
QgsSublayersDialog::QgsSublayersDialog
Q_DECL_DEPRECATED QgsSublayersDialog(ProviderType providerType, const QString &name, QWidget *parent=nullptr, Qt::WindowFlags fl=Qt::WindowFlags(), const QString &dataSourceUri=QString())
Constructor for QgsSublayersDialog.
Definition
qgssublayersdialog.cpp:54
QgsSublayersDialog::showAddToGroupCheckbox
bool showAddToGroupCheckbox() const
If we should display the add to group checkbox.
Definition
qgssublayersdialog.h:142
QgsSublayersDialog::selection
LayerDefinitionList selection()
Returns list of selected layers.
Definition
qgssublayersdialog.cpp:122
QgsSublayersDialog::mShowCount
bool mShowCount
Whether to show number of features in the table.
Definition
qgssublayersdialog.h:169
QgsSublayersDialog::setShowAddToGroupCheckbox
void setShowAddToGroupCheckbox(bool showAddToGroupCheckbox)
Set if we should display the add to group checkbox.
Definition
qgssublayersdialog.h:137
QgsSublayersDialog::mShowDescription
bool mShowDescription
Whether to show description in the table.
Definition
qgssublayersdialog.h:173
QgsSublayersDialog::mSelectedSubLayers
QStringList mSelectedSubLayers
Definition
qgssublayersdialog.h:166
QgsSublayersDialog::ProviderType
ProviderType
Definition
qgssublayersdialog.h:68
QgsSublayersDialog::Gdal
@ Gdal
Definition
qgssublayersdialog.h:70
QgsSublayersDialog::Vsifile
@ Vsifile
Definition
qgssublayersdialog.h:71
QgsSublayersDialog::Ogr
@ Ogr
Definition
qgssublayersdialog.h:69
QgsSublayersDialog::Mdal
@ Mdal
Definition
qgssublayersdialog.h:72
QgsSublayersDialog::populateLayerTable
void populateLayerTable(const LayerDefinitionList &list)
Populate the table with layers.
Definition
qgssublayersdialog.cpp:146
QgsSublayersDialog::countColumn
int countColumn() const
Returns column with count or -1.
Definition
qgssublayersdialog.h:152
QgsSublayersDialog::addToGroupCheckbox
bool addToGroupCheckbox() const
If we should add layers in a group.
Definition
qgssublayersdialog.h:147
QgsSublayersDialog::mName
QString mName
Provider type name.
Definition
qgssublayersdialog.h:165
qgis.h
qgis_sip.h
SIP_DEPRECATED
#define SIP_DEPRECATED
Definition
qgis_sip.h:113
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition
qgis_sip.h:52
QgsSublayersDialog::LayerDefinition
A structure that defines layers for the purpose of this dialog.
Definition
qgssublayersdialog.h:79
QgsSublayersDialog::LayerDefinition::layerName
QString layerName
Name of the layer (not necessarily unique).
Definition
qgssublayersdialog.h:84
QgsSublayersDialog::LayerDefinition::type
QString type
Extra type depending on the use (e.g. geometry type for vector sublayers).
Definition
qgssublayersdialog.h:90
QgsSublayersDialog::LayerDefinition::description
QString description
Description.
Definition
qgssublayersdialog.h:97
QgsSublayersDialog::LayerDefinition::count
int count
Number of features (might be unused).
Definition
qgssublayersdialog.h:87
QgsSublayersDialog::LayerDefinition::layerId
int layerId
Identifier of the layer (one unique layer id may have multiple types though).
Definition
qgssublayersdialog.h:81
Generated on
for QGIS API Documentation by
1.17.0