Class: QgsSublayersDialog

Presents a choice of sublayers.

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

List of all members, including inherited members

Class Hierarchy

Inheritance diagram of qgis.gui.QgsSublayersDialog

Base classes

QDialog

QWidget

QObject

QPaintDevice

Classes

LayerDefinition

A structure that defines layers for the purpose of this dialog

Enums

PromptMode

ProviderType

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

class qgis.gui.QgsSublayersDialog[source]

Bases: QDialog

__init__(providerType: QgsSublayersDialog.ProviderType, name: str | None, parent: QWidget | None = None, fl: 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 (Qt.WindowType = Qt.WindowFlags()) – window flags

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

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

Gdal = 1
class LayerDefinition

Bases: object

A structure that defines layers for the purpose of this dialog

count: int
description: str
layerId: int
layerName: str
type: str
Mdal = 3
Ogr = 0
PromptAlways = 0
PromptIfNeeded = 1
PromptLoadAll = 3
class PromptMode(*values)

Bases: IntEnum

PromptAlways = 0
PromptIfNeeded = 1
PromptLoadAll = 3
PromptNever = 2
PromptNever = 2
class ProviderType(*values)

Bases: IntEnum

Gdal = 1
Mdal = 3
Ogr = 0
Vsifile = 2
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