QGIS API Documentation 3.41.0-Master (cea29feecf2)
Loading...
Searching...
No Matches
Public Member Functions | List of all members
QgsConnectionRegistry Class Reference

A registry for saved data provider connections, allowing retrieval of saved connections by name and provider type. More...

#include <qgsconnectionregistry.h>

Inheritance diagram for QgsConnectionRegistry:
Inheritance graph
[legend]

Public Member Functions

 QgsConnectionRegistry (const QgsConnectionRegistry &other)=delete
 
 QgsConnectionRegistry (QObject *parent=nullptr)
 Constructor for QgsConnectionRegistry.
 
QgsAbstractProviderConnectioncreateConnection (const QString &name)
 Creates a new connection by loading the connection with the given id from the settings.
 
QgsConnectionRegistryoperator= (const QgsConnectionRegistry &other)=delete
 

Detailed Description

A registry for saved data provider connections, allowing retrieval of saved connections by name and provider type.

QgsConnectionRegistry is not usually directly created, but rather accessed through QgsApplication::connectionRegistry().

Since
QGIS 3.14

Definition at line 38 of file qgsconnectionregistry.h.

Constructor & Destructor Documentation

◆ QgsConnectionRegistry() [1/2]

QgsConnectionRegistry::QgsConnectionRegistry ( QObject *  parent = nullptr)

Constructor for QgsConnectionRegistry.

Definition at line 24 of file qgsconnectionregistry.cpp.

◆ QgsConnectionRegistry() [2/2]

QgsConnectionRegistry::QgsConnectionRegistry ( const QgsConnectionRegistry other)
delete

Member Function Documentation

◆ createConnection()

QgsAbstractProviderConnection * QgsConnectionRegistry::createConnection ( const QString &  name)

Creates a new connection by loading the connection with the given id from the settings.

The id string must be of the format "provider://connection_name", e.g. "postgres://my_connection" for the PostgreSQL connection saved as "my_connection".

Ownership is transferred to the caller.

Exceptions
QgsProviderConnectionException

Definition at line 29 of file qgsconnectionregistry.cpp.

◆ operator=()

QgsConnectionRegistry & QgsConnectionRegistry::operator= ( const QgsConnectionRegistry other)
delete

The documentation for this class was generated from the following files: