Class: QgsSublayersDialog

Presents a choice of sublayers.

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

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: int
description: str
layerId: int
layerName: str
type: str
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