QGIS API Documentation 3.99.0-Master (2fe06baccd8)
Loading...
Searching...
No Matches
QgsSublayersDialog Class Reference

Presents a choice of sublayers. More...

#include <qgssublayersdialog.h>

Inheritance diagram for QgsSublayersDialog:

Classes

struct  LayerDefinition
 A structure that defines layers for the purpose of this dialog. More...

Public Types

typedef QList< QgsSublayersDialog::LayerDefinitionLayerDefinitionList
 List of layer definitions for the purpose of this dialog.
enum  PromptMode { PromptAlways , PromptIfNeeded , PromptNever , PromptLoadAll }
 Prompt behavior of the QgsSublayersDialog. More...
enum  ProviderType { Ogr , Gdal , Vsifile , Mdal }

Public Slots

int exec () override

Public Member Functions

Q_DECL_DEPRECATED QgsSublayersDialog (ProviderType providerType, const QString &name, QWidget *parent=nullptr, Qt::WindowFlags fl=Qt::WindowFlags(), const QString &dataSourceUri=QString())
 Constructor for QgsSublayersDialog.
 ~QgsSublayersDialog () override
bool addToGroupCheckbox () const
 If we should add layers in a group.
int countColumn () const
 Returns column with count or -1.
void populateLayerTable (const LayerDefinitionList &list)
 Populate the table with layers.
LayerDefinitionList selection ()
 Returns list of selected layers.
void setShowAddToGroupCheckbox (bool showAddToGroupCheckbox)
 Set if we should display the add to group checkbox.
bool showAddToGroupCheckbox () const
 If we should display the add to group checkbox.

Protected Attributes

QString mName
 Provider type name.
QStringList mSelectedSubLayers
bool mShowCount = false
 Whether to show number of features in the table.
bool mShowDescription = false
 Whether to show description in the table.
bool mShowType = false
 Whether to show type in the table.

Detailed Description

Presents a choice of sublayers.

Deprecated
QGIS 3.40. Will be removed in QGIS 4.0.

Definition at line 34 of file qgssublayersdialog.h.

Member Typedef Documentation

◆ LayerDefinitionList

List of layer definitions for the purpose of this dialog.

Definition at line 103 of file qgssublayersdialog.h.

Member Enumeration Documentation

◆ PromptMode

Prompt behavior of the QgsSublayersDialog.

Deprecated
QGIS 3.40. Use Qgis::SublayerPromptMode instead.
Enumerator
PromptAlways 

always ask if there are existing sublayers

PromptIfNeeded 

always ask if there are existing sublayers, but skip if there are bands for rasters

PromptNever 

never prompt, will not load anything

PromptLoadAll 

never prompt, but load all sublayers

Definition at line 42 of file qgssublayersdialog.h.

◆ ProviderType

Enumerator
Ogr 
Gdal 
Vsifile 
Mdal 
Since
QGIS 3.14

Definition at line 67 of file qgssublayersdialog.h.

Constructor & Destructor Documentation

◆ QgsSublayersDialog()

QgsSublayersDialog::QgsSublayersDialog ( ProviderType providerType,
const QString & name,
QWidget * parent = nullptr,
Qt::WindowFlags fl = Qt::WindowFlags(),
const QString & dataSourceUri = QString() )

Constructor for QgsSublayersDialog.

Construct a new QgsSublayersDialog object - a dialog to select which sub layers to be imported from a data source (e.g. from geopackage or zipfile)

Parameters
providerTypeprovider type
nameprovider type name
parentparent widget of the dialog
flwindow flags
dataSourceUridata source URI
Deprecated
QGIS 3.40. Will be removed in QGIS 4.0.

Definition at line 49 of file qgssublayersdialog.cpp.

◆ ~QgsSublayersDialog()

QgsSublayersDialog::~QgsSublayersDialog ( )
override

Definition at line 97 of file qgssublayersdialog.cpp.

Member Function Documentation

◆ addToGroupCheckbox()

bool QgsSublayersDialog::addToGroupCheckbox ( ) const
inline

If we should add layers in a group.

Definition at line 145 of file qgssublayersdialog.h.

◆ countColumn()

int QgsSublayersDialog::countColumn ( ) const
inline

Returns column with count or -1.

Definition at line 150 of file qgssublayersdialog.h.

◆ exec

int QgsSublayersDialog::exec ( )
overrideslot

Definition at line 176 of file qgssublayersdialog.cpp.

◆ populateLayerTable()

void QgsSublayersDialog::populateLayerTable ( const LayerDefinitionList & list)

Populate the table with layers.

Definition at line 141 of file qgssublayersdialog.cpp.

◆ selection()

QgsSublayersDialog::LayerDefinitionList QgsSublayersDialog::selection ( )

Returns list of selected layers.

Definition at line 117 of file qgssublayersdialog.cpp.

◆ setShowAddToGroupCheckbox()

void QgsSublayersDialog::setShowAddToGroupCheckbox ( bool showAddToGroupCheckbox)
inline

Set if we should display the add to group checkbox.

Definition at line 135 of file qgssublayersdialog.h.

◆ showAddToGroupCheckbox()

bool QgsSublayersDialog::showAddToGroupCheckbox ( ) const
inline

If we should display the add to group checkbox.

Definition at line 140 of file qgssublayersdialog.h.

Member Data Documentation

◆ mName

QString QgsSublayersDialog::mName
protected

Provider type name.

Definition at line 163 of file qgssublayersdialog.h.

◆ mSelectedSubLayers

QStringList QgsSublayersDialog::mSelectedSubLayers
protected

Definition at line 164 of file qgssublayersdialog.h.

◆ mShowCount

bool QgsSublayersDialog::mShowCount = false
protected

Whether to show number of features in the table.

Definition at line 167 of file qgssublayersdialog.h.

◆ mShowDescription

bool QgsSublayersDialog::mShowDescription = false
protected

Whether to show description in the table.

Definition at line 171 of file qgssublayersdialog.h.

◆ mShowType

bool QgsSublayersDialog::mShowType = false
protected

Whether to show type in the table.

Definition at line 169 of file qgssublayersdialog.h.


The documentation for this class was generated from the following files: