Subgroup: other

Class: QgsAbstractDataSourceWidget

class qgis.gui.QgsAbstractDataSourceWidget

Bases: PyQt5.QtWidgets.QDialog

Abstract base Data Source Widget to create connections and add layers This class provides common functionality and the interface for all source select dialogs used by data providers to configure data sources and add layers.

New in version 3.0: Methods

accept
acceptDrops
accessibleDescription
accessibleName
actionEvent
actions
activateWindow
addAction
addActions
addButton Return the add Button
addButtonClicked Triggered when the add button is clicked, the add layer signal is emitted Concrete classes should implement the right behavior depending on the layer being added.
adjustSize
autoFillBackground
backgroundRole
baseSize
blockSignals
changeEvent
childAt childAt(self, int, int) -> QWidget
childEvent
children
childrenRect
childrenRegion
clearFocus
clearMask
close
closeEvent
colorCount
connectNotify
contentsMargins
contentsRect
contextMenuEvent
contextMenuPolicy
create
createWindowContainer
cursor
customEvent
deleteLater
depth
destroy
devType
devicePixelRatio
devicePixelRatioF
devicePixelRatioFScale
disconnect
disconnectNotify
done
dragEnterEvent
dragLeaveEvent
dragMoveEvent
dropEvent
dumpObjectInfo
dumpObjectTree
dynamicPropertyNames
effectiveWinId
ensurePolished
enterEvent
event
eventFilter
exec
exec_
find
findChild findChild(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> QObject
findChildren findChildren(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject]
focusInEvent
focusNextChild
focusNextPrevChild
focusOutEvent
focusPolicy
focusPreviousChild
focusProxy
focusWidget
font
fontInfo
fontMetrics
foregroundRole
frameGeometry
frameSize
geometry
getContentsMargins
grab
grabGesture
grabKeyboard
grabMouse grabMouse(self, Union[QCursor, Qt.CursorShape])
grabShortcut
graphicsEffect
graphicsProxyWidget
hasFocus
hasHeightForWidth
hasMouseTracking
hasTabletTracking
height
heightForWidth
heightMM
hide
hideEvent
inherits
initPainter
inputMethodEvent
inputMethodHints
inputMethodQuery
insertAction
insertActions
installEventFilter
isActiveWindow
isAncestorOf
isEnabled
isEnabledTo
isFullScreen
isHidden
isLeftToRight
isMaximized
isMinimized
isModal
isRightToLeft
isSignalConnected
isSizeGripEnabled
isVisible
isVisibleTo
isWidgetType
isWindow
isWindowModified
isWindowType
keyPressEvent
keyReleaseEvent
keyboardGrabber
killTimer
layout
layoutDirection
leaveEvent
locale
logicalDpiX
logicalDpiY
lower
mapCanvas Return the map canvas (can be null)
mapFrom
mapFromGlobal
mapFromParent
mapTo
mapToGlobal
mapToParent
mask
maximumHeight
maximumSize
maximumWidth
metaObject
metric
minimumHeight
minimumSize
minimumSizeHint
minimumWidth
mouseDoubleClickEvent
mouseGrabber
mouseMoveEvent
mousePressEvent
mouseReleaseEvent
move move(self, int, int)
moveEvent
moveToThread
nativeEvent
nativeParentWidget
nextInFocusChain
normalGeometry
objectName
open
overrideWindowFlags
overrideWindowState
paintEngine
paintEvent
paintingActive
palette
parent
parentWidget
physicalDpiX
physicalDpiY
pos
previousInFocusChain
property
pyqtConfigure Each keyword argument is either the name of a Qt property or a Qt signal.
raise_
receivers
rect
refresh Triggered when the provider’s connections need to be refreshed
reject
releaseKeyboard
releaseMouse
releaseShortcut
removeAction
removeEventFilter
render render(self, QPainter, targetOffset: QPoint = QPoint(), sourceRegion: QRegion = QRegion(), flags: Union[QWidget.RenderFlags, QWidget.RenderFlag] = QWidget.RenderFlags(QWidget.DrawWindowBackground|QWidget.DrawChildren))
repaint repaint(self, int, int, int, int)
resize resize(self, int, int)
resizeEvent
restoreGeometry
result
saveGeometry
scroll scroll(self, int, int, QRect)
sender
senderSignalIndex
setAcceptDrops
setAccessibleDescription
setAccessibleName
setAttribute
setAutoFillBackground
setBackgroundRole
setBaseSize setBaseSize(self, QSize)
setContentsMargins setContentsMargins(self, QMargins)
setContextMenuPolicy
setCursor
setDisabled
setEnabled
setFixedHeight
setFixedSize setFixedSize(self, int, int)
setFixedWidth
setFocus setFocus(self, Qt.FocusReason)
setFocusPolicy
setFocusProxy
setFont
setForegroundRole
setGeometry setGeometry(self, int, int, int, int)
setGraphicsEffect
setHidden
setInputMethodHints
setLayout
setLayoutDirection
setLocale
setMapCanvas Store a pointer to the map canvas to retrieve extent and CRS
setMask setMask(self, QRegion)
setMaximumHeight
setMaximumSize setMaximumSize(self, QSize)
setMaximumWidth
setMinimumHeight
setMinimumSize setMinimumSize(self, QSize)
setMinimumWidth
setModal
setMouseTracking
setObjectName
setPalette
setParent setParent(self, QWidget, Union[Qt.WindowFlags, Qt.WindowType])
setProperty
setResult
setShortcutAutoRepeat
setShortcutEnabled
setSizeGripEnabled
setSizeIncrement setSizeIncrement(self, QSize)
setSizePolicy setSizePolicy(self, QSizePolicy.Policy, QSizePolicy.Policy)
setStatusTip
setStyle
setStyleSheet
setTabOrder
setTabletTracking
setToolTip
setToolTipDuration
setUpdatesEnabled
setVisible
setWhatsThis
setWindowFilePath
setWindowFlag
setWindowFlags
setWindowIcon
setWindowIconText
setWindowModality
setWindowModified
setWindowOpacity
setWindowRole
setWindowState
setWindowTitle
setupButtons Connect the ok and apply/add buttons to the slots
sharedPainter
show
showEvent
showFullScreen
showMaximized
showMinimized
showNormal
signalsBlocked
size
sizeHint
sizeIncrement
sizePolicy
stackUnder
startTimer
statusTip
style
styleSheet
tabletEvent
testAttribute
thread
timerEvent
toolTip
toolTipDuration
tr
underMouse
ungrabGesture
unsetCursor
unsetLayoutDirection
unsetLocale
update update(self, QRect)
updateGeometry
updateMicroFocus
updatesEnabled
visibleRegion
whatsThis
wheelEvent
widgetMode Return the widget mode
width
widthMM
winId
window
windowFilePath
windowFlags
windowHandle
windowIcon
windowIconText
windowModality
windowOpacity
windowRole
windowState
windowTitle
windowType
x
y

Attributes

Accepted
DrawChildren
DrawWindowBackground
IgnoreMask
PdmDepth
PdmDevicePixelRatio
PdmDevicePixelRatioScaled
PdmDpiX
PdmDpiY
PdmHeight
PdmHeightMM
PdmNumColors
PdmPhysicalDpiX
PdmPhysicalDpiY
PdmWidth
PdmWidthMM
Rejected
accepted accepted(self) [signal]
addDatabaseLayers Emitted when a DB layer has been selected for addition [signal]
addRasterLayer Emitted when a raster layer has been selected for addition [signal]
addVectorLayer Emitted when a vector layer has been selected for addition.
addVectorLayers Emitted when one or more OGR supported layers are selected for addition
connectionsChanged Emitted when the provider’s connections have changed
customContextMenuRequested customContextMenuRequested(self, QPoint) [signal]
destroyed destroyed(self, QObject = None) [signal]
enableButtons Emitted when the ok/add buttons should be enabled/disabled [signal]
finished finished(self, int) [signal]
objectNameChanged objectNameChanged(self, str) [signal]
progress Emitted when a progress dialog is shown by the provider dialog [signal]
progressMessage Emitted when a progress dialog is shown by the provider dialog [signal]
rejected rejected(self) [signal]
replaceVectorLayer Emitted when a layer needs to be replaced
staticMetaObject
windowIconChanged windowIconChanged(self, QIcon) [signal]
windowIconTextChanged windowIconTextChanged(self, str) [signal]
windowTitleChanged windowTitleChanged(self, str) [signal]
actionEvent()
addButton(self) → QPushButton

Return the add Button

addButtonClicked(self)

Triggered when the add button is clicked, the add layer signal is emitted Concrete classes should implement the right behavior depending on the layer being added.

addDatabaseLayers

Emitted when a DB layer has been selected for addition [signal]

addRasterLayer

Emitted when a raster layer has been selected for addition [signal]

addVectorLayer

Emitted when a vector layer has been selected for addition.

If providerKey is not specified, the default provider key associated with the source will be used. [signal]

addVectorLayers

Emitted when one or more OGR supported layers are selected for addition

Parameters:
  • layerList – list of layers protocol URIs
  • encoding – encoding
  • dataSourceType – string (can be “file” or “database”) [signal]
changeEvent()
childEvent()
closeEvent()
connectNotify()
connectionsChanged

Emitted when the provider’s connections have changed This signal is normally forwarded the app and used to refresh browser items [signal]

contextMenuEvent()
create()
customEvent()
destroy()
disconnectNotify()
dragEnterEvent()
dragLeaveEvent()
dragMoveEvent()
dropEvent()
enableButtons

Emitted when the ok/add buttons should be enabled/disabled [signal]

enterEvent()
event()
eventFilter()
focusInEvent()
focusNextChild()
focusNextPrevChild()
focusOutEvent()
focusPreviousChild()
hideEvent()
initPainter()
inputMethodEvent()
isSignalConnected()
keyPressEvent()
keyReleaseEvent()
leaveEvent()
mapCanvas(self) → QgsMapCanvas

Return the map canvas (can be null)

metric()
mouseDoubleClickEvent()
mouseMoveEvent()
mousePressEvent()
mouseReleaseEvent()
moveEvent()
nativeEvent()
paintEvent()
progress

Emitted when a progress dialog is shown by the provider dialog [signal]

progressMessage

Emitted when a progress dialog is shown by the provider dialog [signal]

receivers()
refresh(self)

Triggered when the provider’s connections need to be refreshed The default implementation does nothing

replaceVectorLayer

Emitted when a layer needs to be replaced

Parameters:
  • oldId – old layer ID
  • source – URI of the layer
  • name – of the layer
  • provider – key [signal]
resizeEvent()
sender()
senderSignalIndex()
setMapCanvas(self, mapCanvas: QgsMapCanvas)

Store a pointer to the map canvas to retrieve extent and CRS Used to select an appropriate CRS and possibly to retrieve data only in the current extent

setupButtons(self, buttonBox: QDialogButtonBox)

Connect the ok and apply/add buttons to the slots

sharedPainter()
showEvent()
tabletEvent()
timerEvent()
updateMicroFocus()
wheelEvent()
widgetMode(self) → QgsProviderRegistry.WidgetMode

Return the widget mode