Class: QgsAuthSettingsWidget¶
- class qgis.gui.QgsAuthSettingsWidget¶
Bases:
PyQt5.QtWidgets.QWidget
Widget for entering authentication credentials both in the form username/password and by using QGIS Authentication Database and its authentication configurations.
The widget also offers the functionality to convert username/password credentials to an authentication configuration.
New in version 3.0.
QgsAuthSettingsWidget(parent: QWidget = None, configId: str = ‘’, username: str = ‘’, password: str = ‘’, dataprovider: str = ‘’) Create a dialog for setting an associated authentication config, either from existing configs, or creating/removing them from auth database
- Parameters
parent – Parent widget
configId – authentication configuration id
username –
password –
dataprovider –
The key of the calling layer provider, if applicable
Methods
convertButtonEnabled, mainly useful for unit tests
- rtype
str
- rtype
bool
convertToEncrypted is called when the convert to encrypted button is clicked and it creates a Basic authentication configuration from username and password specified in the Basic tab
- rtype
str
warning text message based upon where credentials are stored
- rtype
str
setBasicText set the text of the warning label
setConfigId set the authentication configuration id param configId the authentication configuration id
setDataprovider set the data provider key for filtering compatible authentication configurations
setPassword set the password
setStorePasswordCheched check the "Store" checkbox for the password
setStoreUsernameChecked check the "Store" checkbox for the username
setUsername set the username
setWarningText set the text of the warning label
showStoreCheckboxes show the "Store" checkboxes for basic auth.
storePassword
storeUsername
- rtype
str
Signals
pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL
pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL
pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL
Attributes
- ProjectFile = 0¶
- UserSettings = 1¶
- class WarningType¶
Bases:
int
- baseClass¶
alias of
QgsAuthSettingsWidget
- actionEvent(self, QActionEvent)¶
- btnConvertToEncryptedIsEnabled(self) bool ¶
convertButtonEnabled, mainly useful for unit tests
- Return type
bool
- Returns
True
if the convert button is enabled
- changeEvent(self, QEvent)¶
- childEvent(self, QChildEvent)¶
- closeEvent(self, QCloseEvent)¶
- configIdChanged¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Parameters
name (str = ...) –
revision (int = ...) –
arguments (Sequence = ...) –
- Return type
PYQT_SIGNAL
- configurationTabIsSelected(self) bool ¶
- configurationTabIsSelected(None) None
- Return type
bool
- Returns
True
if the configuration tab is the currently selected tab
- connectNotify(self, QMetaMethod)¶
- contextMenuEvent(self, QContextMenuEvent)¶
- convertToEncrypted(self) bool ¶
convertToEncrypted is called when the convert to encrypted button is clicked and it creates a Basic authentication configuration from username and password specified in the Basic tab
- Return type
bool
- Returns
return
True
on success
- create(self, window: PyQt5.sip.voidptr = 0, initializeWindow: bool = True, destroyOldWindow: bool = True)¶
- customEvent(self, QEvent)¶
- dataprovider(self) str ¶
- dataprovider(None) None
- Return type
str
- Returns
the data provider key used to filter compatible authentication configurations
- destroy(self, destroyWindow: bool = True, destroySubWindows: bool = True)¶
- disconnectNotify(self, QMetaMethod)¶
- dragEnterEvent(self, QDragEnterEvent)¶
- dragLeaveEvent(self, QDragLeaveEvent)¶
- dragMoveEvent(self, QDragMoveEvent)¶
- dropEvent(self, QDropEvent)¶
- enterEvent(self, QEvent)¶
- event(self, QEvent) bool ¶
- focusInEvent(self, QFocusEvent)¶
- focusNextChild(self) bool ¶
- focusNextPrevChild(self, bool) bool ¶
- focusOutEvent(self, QFocusEvent)¶
- focusPreviousChild(self) bool ¶
- formattedWarning(warning: QgsAuthSettingsWidget.WarningType) str ¶
warning text message based upon where credentials are stored
- Parameters
warning (QgsAuthSettingsWidget.WarningType) – enum of warning type
- Return type
str
- Returns
pre-formatted warning text
- hideEvent(self, QHideEvent)¶
- initPainter(self, QPainter)¶
- inputMethodEvent(self, QInputMethodEvent)¶
- isSignalConnected(self, QMetaMethod) bool ¶
- keyPressEvent(self, QKeyEvent)¶
- keyReleaseEvent(self, QKeyEvent)¶
- leaveEvent(self, QEvent)¶
- metric(self, QPaintDevice.PaintDeviceMetric) int ¶
- mouseDoubleClickEvent(self, QMouseEvent)¶
- mouseMoveEvent(self, QMouseEvent)¶
- mousePressEvent(self, QMouseEvent)¶
- mouseReleaseEvent(self, QMouseEvent)¶
- moveEvent(self, QMoveEvent)¶
- nativeEvent(self, Union[QByteArray, bytes, bytearray], PyQt5.sip.voidptr) Tuple[bool, int] ¶
- paintEvent(self, QPaintEvent)¶
- passwordChanged¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Parameters
name (str = ...) –
revision (int = ...) –
arguments (Sequence = ...) –
- Return type
PYQT_SIGNAL
- receivers(self, PYQT_SIGNAL) int ¶
- resizeEvent(self, QResizeEvent)¶
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- setBasicText(self, basicText: str)¶
setBasicText set the text of the warning label
- Parameters
basicText (str) – the text of the basic tab label
- setConfigId(self, configId: str)¶
setConfigId set the authentication configuration id param configId the authentication configuration id
- Parameters
configId (str) –
- setDataprovider(self, dataprovider: str)¶
setDataprovider set the data provider key for filtering compatible authentication configurations
- Parameters
dataprovider (str) – data provider key
- setPassword(self, password: str)¶
setPassword set the password
- Parameters
password (str) – the password
- setStorePasswordChecked(self, checked: bool)¶
setStorePasswordCheched check the “Store” checkbox for the password
- Parameters
checked (bool) –
See also
- setStoreUsernameChecked(self, checked: bool)¶
setStoreUsernameChecked check the “Store” checkbox for the username
- Parameters
checked (bool) –
See also
- setUsername(self, username: str)¶
setUsername set the username
- Parameters
username (str) – the user name
- setWarningText(self, warningText: str)¶
setWarningText set the text of the warning label
- Parameters
warningText (str) – the text of the warning label
See also
- showEvent(self, QShowEvent)¶
- showStoreCheckboxes(self, enabled: bool)¶
showStoreCheckboxes show the “Store” checkboxes for basic auth. Some connection configurations allow the user to enter credentials for testing the connection without storing them in the project. “Store” checkboxes are disabled by default.
- Parameters
enabled (bool) –
- storePasswordIsChecked(self) bool ¶
storePassword
- Return type
bool
- Returns
True
if “Store” checkbox for the password is checked
- storeUsernameIsChecked(self) bool ¶
storeUsername
- Return type
bool
- Returns
True
if “Store” checkbox for the username is checked
- tabletEvent(self, QTabletEvent)¶
- timerEvent(self, QTimerEvent)¶
- updateMicroFocus(self)¶
- usernameChanged¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Parameters
name (str = ...) –
revision (int = ...) –
arguments (Sequence = ...) –
- Return type
PYQT_SIGNAL
- wheelEvent(self, QWheelEvent)¶