Class: QgsSublayersDialog

Deprecated since version 3.40: Will be removed in QGIS 4.0.

Class Hierarchy

Inheritance diagram of qgis.gui.QgsSublayersDialog

Base classes

QDialog

QWidget

QObject

QPaintDevice

Methods

addToGroupCheckbox

If we should add layers in a group

countColumn

Returns column with count or -1

populateLayerTable

Populate the table with layers

selection

Returns list of selected layers

setShowAddToGroupCheckbox

Set if we should display the add to group checkbox

showAddToGroupCheckbox

If we should display the add to group checkbox

Attributes

Gdal

Mdal

Ogr

PromptAlways

PromptIfNeeded

PromptLoadAll

PromptNever

Vsifile

class qgis.gui.QgsSublayersDialog[source]

Bases: QDialog

__init__(providerType: QgsSublayersDialog.ProviderType, name: str | None, parent: QWidget | None = None, fl: Qt.WindowFlags | Qt.WindowType = Qt.WindowFlags(), dataSourceUri: str | None = '')

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:
  • providerType (QgsSublayersDialog.ProviderType) – provider type

  • name (Optional[str]) – provider type name

  • parent (Optional[QWidget] = None) – parent widget of the dialog

  • fl (Union[Qt.WindowFlags, Qt.WindowType] = Qt.WindowFlags()) – window flags

  • dataSourceUri (Optional[str] = '') – data source URI

Deprecated since version 3.40: Will be removed in QGIS 4.0.

Gdal = 1
class LayerDefinition

Bases: object

A structure that defines layers for the purpose of this dialog

count

Number of features (might be unused)

description

Description.

Added in version 3.10.

layerId

Identifier of the layer (one unique layer id may have multiple types though)

layerName

Name of the layer (not necessarily unique)

type

Extra type depending on the use (e.g. geometry type for vector sublayers)

Mdal = 3
Ogr = 0
PromptAlways = 0
PromptIfNeeded = 1
PromptLoadAll = 3
class PromptMode

Bases: int

PromptNever = 2
class ProviderType

Bases: int

Vsifile = 2
addToGroupCheckbox(self) bool[source]

If we should add layers in a group

Return type:

bool

countColumn(self) int[source]

Returns column with count or -1

Return type:

int

populateLayerTable(self, list: Iterable[QgsSublayersDialog.LayerDefinition])[source]

Populate the table with layers

Parameters:

list (Iterable[QgsSublayersDialog.LayerDefinition])

selection(self) List[QgsSublayersDialog.LayerDefinition][source]

Returns list of selected layers

Return type:

List[QgsSublayersDialog.LayerDefinition]

setShowAddToGroupCheckbox(self, showAddToGroupCheckbox: bool)[source]

Set if we should display the add to group checkbox

Parameters:

showAddToGroupCheckbox (bool)

showAddToGroupCheckbox(self) bool[source]

If we should display the add to group checkbox

Return type:

bool