QGIS API Documentation  3.14.0-Pi (9f7028fd23)
qgsabstractproviderconnection.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  qgsabstractproviderconnection.cpp - QgsAbstractProviderConnection
3 
4  ---------------------
5  begin : 2.8.2019
6  copyright : (C) 2019 by Alessandro Pasotti
7  email : elpaso at itopen dot it
8  ***************************************************************************
9  * *
10  * This program is free software; you can redistribute it and/or modify *
11  * it under the terms of the GNU General Public License as published by *
12  * the Free Software Foundation; either version 2 of the License, or *
13  * (at your option) any later version. *
14  * *
15  ***************************************************************************/
17 #include <QIcon>
18 
20 {
21  Q_UNUSED( name );
22  // Note: concrete classes must implement the logic to read the configuration from the settings
23  // and create mUri
24 }
25 
26 QgsAbstractProviderConnection::QgsAbstractProviderConnection( const QString &uri, const QVariantMap &configuration )
27  : mUri( uri )
28  , mConfiguration( configuration )
29 {
30 
31 }
32 
34 {
35  return QIcon();
36 }
37 
39 {
40  return mUri;
41 }
42 
43 void QgsAbstractProviderConnection::setUri( const QString &uri )
44 {
45  mUri = uri;
46 }
47 
49 {
50  return mConfiguration;
51 }
52 
53 void QgsAbstractProviderConnection::setConfiguration( const QVariantMap &configuration )
54 {
55  mConfiguration = configuration;
56 }
QgsAbstractProviderConnection::setConfiguration
void setConfiguration(const QVariantMap &configuration)
Sets the connection configuration.
Definition: qgsabstractproviderconnection.cpp:53
QgsAbstractProviderConnection::icon
virtual QIcon icon() const
Returns an icon representing the connection.
Definition: qgsabstractproviderconnection.cpp:33
QgsAbstractProviderConnection::setUri
void setUri(const QString &uri)
Sets the connection data source URI to uri.
Definition: qgsabstractproviderconnection.cpp:43
QgsAbstractProviderConnection::configuration
QVariantMap configuration() const
Returns the connection configuration parameters.
Definition: qgsabstractproviderconnection.cpp:48
QgsAbstractProviderConnection::uri
QString uri() const
Returns the connection data source URI string representation.
Definition: qgsabstractproviderconnection.cpp:38
QgsAbstractProviderConnection::QgsAbstractProviderConnection
QgsAbstractProviderConnection(const QString &name)
Creates a new connection with name by reading its configuration from the settings.
Definition: qgsabstractproviderconnection.cpp:19
qgsabstractproviderconnection.h