QGIS API Documentation 3.40.0-Bratislava (b56115d8743)
Loading...
Searching...
No Matches
Public Slots | Signals | Public Member Functions | Protected Member Functions | List of all members
QgsDataSourceManagerDialog Class Reference

The QgsDataSourceManagerDialog class embeds the browser panel and all the provider dialogs. More...

#include <qgsdatasourcemanagerdialog.h>

Inheritance diagram for QgsDataSourceManagerDialog:
Inheritance graph
[legend]

Public Slots

void activate ()
 Raise, unminimize and activate this window.
 
void configureFromUri (const QString &pageName, const QString &uri)
 Shows the page pageName and configure the source select widget from the layer uri.
 
void rasterLayersAdded (const QStringList &layersList)
 One or more raster layer were added: for signal forwarding to QgisApp.
 
void refresh ()
 Refresh the browser view.
 
void reset ()
 Resets the interface of the datasource manager after reopening the dialog.
 
void setCurrentPage (int index)
 Sync current page with the leftbar list.
 
void setPreviousPage ()
 Reset current page to previously selected page.
 
void vectorLayersAdded (const QStringList &layerQStringList, const QString &enc, const QString &dataSourceType)
 One or more vector layer were added: for signal forwarding to QgisApp.
 
- Public Slots inherited from QgsOptionsDialogBase
void searchText (const QString &text)
 searchText searches for a text in all the pages of the stacked widget and highlight the results
 

Signals

void addDatabaseLayers (const QStringList &layerPathList, const QString &providerKey)
 Emitted when a DB layer was selected for addition: for signal forwarding to QgisApp.
 
void addLayer (Qgis::LayerType type, const QString &url, const QString &baseName, const QString &providerKey)
 Emitted when a layer has been selected for addition.
 
void addRasterLayers (const QStringList &layersList)
 Emitted when a one or more layer were selected for addition: for signal forwarding to QgisApp.
 
void addVectorLayers (const QStringList &layerQStringList, const QString &enc, const QString &dataSourceType)
 Emitted when a one or more layer were selected for addition: for signal forwarding to QgisApp.
 
void connectionsChanged ()
 Emitted when a connection has changed inside the provider dialogs This signal is normally forwarded to the application to notify other browsers that they need to refresh their connections list.
 
void handleDropUriList (const QgsMimeDataUtils::UriList &)
 Emitted when drop uri list needs to be handled from the browser.
 
void openFile (const QString &fileName, const QString &fileTypeHint=QString())
 Emitted when a file needs to be opened.
 
void providerDialogsRefreshRequested ()
 One or more provider connections have changed and the dialogs should be refreshed.
 
void replaceSelectedVectorLayer (const QString &oldId, const QString &uri, const QString &layerName, const QString &provider)
 Replace the selected layer by a vector layer defined by uri, layer name, data source uri.
 
void showStatusMessage (const QString &message)
 Emitted when a status message needs to be shown: for signal forwarding to QgisApp.
 
void updateProjectHome ()
 Update project home directory.
 

Public Member Functions

 QgsDataSourceManagerDialog (QgsBrowserGuiModel *browserModel, QWidget *parent=nullptr, QgsMapCanvas *canvas=nullptr, Qt::WindowFlags fl=Qt::Window)
 QgsDataSourceManagerDialog constructor.
 
 ~QgsDataSourceManagerDialog () override
 
QgsMessageBarmessageBar () const
 Returns the dialog's message bar.
 
void openPage (const QString &pageName)
 Open a given page in the dialog.
 
- Public Member Functions inherited from QgsOptionsDialogBase
 QgsOptionsDialogBase (const QString &settingsKey, QWidget *parent=nullptr, Qt::WindowFlags fl=Qt::WindowFlags(), QgsSettings *settings=nullptr)
 Constructor.
 
 ~QgsOptionsDialogBase () override
 
void addPage (const QString &title, const QString &tooltip, const QIcon &icon, QWidget *widget, const QStringList &path=QStringList(), const QString &key=QString())
 Adds a new page to the dialog pages.
 
bool iconOnly ()
 Determine if the options list is in icon only mode.
 
void initOptionsBase (bool restoreUi=true, const QString &title=QString())
 Set up the base ui connections for vertical tabs.
 
void insertPage (const QString &title, const QString &tooltip, const QIcon &icon, QWidget *widget, const QString &before, const QStringList &path=QStringList(), const QString &key=QString())
 Inserts a new page into the dialog pages.
 
void resizeAlltabs (int index)
 Resizes all tabs when the dialog is resized.
 
void restoreLastPage ()
 Refocus the active tab from the last time the dialog was shown.
 
void restoreOptionsBaseUi (const QString &title=QString())
 Restore the base ui.
 
void setCurrentPage (const QString &page)
 Sets the dialog page (by object name) to show.
 
void setSettings (QgsSettings *settings)
 

Protected Member Functions

void showEvent (QShowEvent *event) override
 
- Protected Member Functions inherited from QgsOptionsDialogBase
QStandardItem * createItem (const QString &name, const QString &tooltip, const QString &icon)
 Creates a new QStandardItem with the specified name, tooltip and icon.
 
void paintEvent (QPaintEvent *e) override
 
void registerTextSearchWidgets ()
 register widgets in the dialog to search for text in it it is automatically called if a line edit has "mSearchLineEdit" as object name.
 
void showEvent (QShowEvent *e) override
 
virtual void updateWindowTitle ()
 

Additional Inherited Members

- Protected Slots inherited from QgsOptionsDialogBase
virtual void optionsStackedWidget_CurrentChanged (int index)
 Select relevant tab on current page change.
 
virtual void optionsStackedWidget_WidgetRemoved (int index)
 Remove tab and unregister widgets on page remove.
 
virtual void updateOptionsListVerticalTabs ()
 Update tabs on the splitter move.
 
void warnAboutMissingObjects ()
 
- Protected Attributes inherited from QgsOptionsDialogBase
bool mDelSettings = false
 
QString mDialogTitle
 
bool mIconOnly = false
 
bool mInit = false
 
QDialogButtonBox * mOptButtonBox = nullptr
 
QListWidget * mOptListWidget = nullptr
 
QString mOptsKey
 
QSplitter * mOptSplitter = nullptr
 
QStackedWidget * mOptStackedWidget = nullptr
 
QStandardItemModel * mOptTreeModel = nullptr
 
QTreeView * mOptTreeView = nullptr
 
QList< QPair< QgsOptionsDialogHighlightWidget *, int > > mRegisteredSearchWidgets
 
QgsFilterLineEditmSearchLineEdit = nullptr
 
QPointer< QgsSettingsmSettings
 
QgsOptionsProxyModel * mTreeProxyModel = nullptr
 

Detailed Description

The QgsDataSourceManagerDialog class embeds the browser panel and all the provider dialogs.

The dialog does not handle layer addition directly but emits signals that need to be forwarded to the QGIS application to be handled.

Note
not available in Python bindings

Definition at line 47 of file qgsdatasourcemanagerdialog.h.

Constructor & Destructor Documentation

◆ QgsDataSourceManagerDialog()

QgsDataSourceManagerDialog::QgsDataSourceManagerDialog ( QgsBrowserGuiModel browserModel,
QWidget *  parent = nullptr,
QgsMapCanvas canvas = nullptr,
Qt::WindowFlags  fl = Qt::Window 
)
explicit

QgsDataSourceManagerDialog constructor.

Parameters
browserModelinstance of the (shared) browser model
parentthe object
canvasa pointer to the map canvas
flwindow flags

Definition at line 34 of file qgsdatasourcemanagerdialog.cpp.

◆ ~QgsDataSourceManagerDialog()

QgsDataSourceManagerDialog::~QgsDataSourceManagerDialog ( )
override

Definition at line 119 of file qgsdatasourcemanagerdialog.cpp.

Member Function Documentation

◆ activate

void QgsDataSourceManagerDialog::activate ( )
slot

Raise, unminimize and activate this window.

Since
QGIS 3.28

Definition at line 139 of file qgsdatasourcemanagerdialog.cpp.

◆ addDatabaseLayers

void QgsDataSourceManagerDialog::addDatabaseLayers ( const QStringList &  layerPathList,
const QString &  providerKey 
)
signal

Emitted when a DB layer was selected for addition: for signal forwarding to QgisApp.

◆ addLayer

void QgsDataSourceManagerDialog::addLayer ( Qgis::LayerType  type,
const QString &  url,
const QString &  baseName,
const QString &  providerKey 
)
signal

Emitted when a layer has been selected for addition.

This is a generic method, intended for replacing the specific layer type signals implemented below.

Since
QGIS 3.34

◆ addRasterLayers

void QgsDataSourceManagerDialog::addRasterLayers ( const QStringList &  layersList)
signal

Emitted when a one or more layer were selected for addition: for signal forwarding to QgisApp.

Since
QGIS 3.20

◆ addVectorLayers

void QgsDataSourceManagerDialog::addVectorLayers ( const QStringList &  layerQStringList,
const QString &  enc,
const QString &  dataSourceType 
)
signal

Emitted when a one or more layer were selected for addition: for signal forwarding to QgisApp.

◆ configureFromUri

void QgsDataSourceManagerDialog::configureFromUri ( const QString &  pageName,
const QString &  uri 
)
slot

Shows the page pageName and configure the source select widget from the layer uri.

Since
QGIS 3.38

Definition at line 178 of file qgsdatasourcemanagerdialog.cpp.

◆ connectionsChanged

void QgsDataSourceManagerDialog::connectionsChanged ( )
signal

Emitted when a connection has changed inside the provider dialogs This signal is normally forwarded to the application to notify other browsers that they need to refresh their connections list.

◆ handleDropUriList

void QgsDataSourceManagerDialog::handleDropUriList ( const QgsMimeDataUtils::UriList )
signal

Emitted when drop uri list needs to be handled from the browser.

◆ messageBar()

QgsMessageBar * QgsDataSourceManagerDialog::messageBar ( ) const

Returns the dialog's message bar.

Definition at line 134 of file qgsdatasourcemanagerdialog.cpp.

◆ openFile

void QgsDataSourceManagerDialog::openFile ( const QString &  fileName,
const QString &  fileTypeHint = QString() 
)
signal

Emitted when a file needs to be opened.

◆ openPage()

void QgsDataSourceManagerDialog::openPage ( const QString &  pageName)

Open a given page in the dialog.

Parameters
pageNamethe page name, usually the provider name or "browser" (for the browser panel) or "ogr" (vector layers) or "raster" (raster layers)

Definition at line 124 of file qgsdatasourcemanagerdialog.cpp.

◆ providerDialogsRefreshRequested

void QgsDataSourceManagerDialog::providerDialogsRefreshRequested ( )
signal

One or more provider connections have changed and the dialogs should be refreshed.

◆ rasterLayersAdded

void QgsDataSourceManagerDialog::rasterLayersAdded ( const QStringList &  layersList)
slot

One or more raster layer were added: for signal forwarding to QgisApp.

Since
QGIS 3.20

Definition at line 194 of file qgsdatasourcemanagerdialog.cpp.

◆ refresh

void QgsDataSourceManagerDialog::refresh ( )
slot

Refresh the browser view.

Definition at line 160 of file qgsdatasourcemanagerdialog.cpp.

◆ replaceSelectedVectorLayer

void QgsDataSourceManagerDialog::replaceSelectedVectorLayer ( const QString &  oldId,
const QString &  uri,
const QString &  layerName,
const QString &  provider 
)
signal

Replace the selected layer by a vector layer defined by uri, layer name, data source uri.

◆ reset

void QgsDataSourceManagerDialog::reset ( )
slot

Resets the interface of the datasource manager after reopening the dialog.

Will clear the selection of embedded all source selection widgets.

Since
QGIS 3.10

Definition at line 166 of file qgsdatasourcemanagerdialog.cpp.

◆ setCurrentPage

void QgsDataSourceManagerDialog::setCurrentPage ( int  index)
slot

Sync current page with the leftbar list.

Definition at line 146 of file qgsdatasourcemanagerdialog.cpp.

◆ setPreviousPage

void QgsDataSourceManagerDialog::setPreviousPage ( )
slot

Reset current page to previously selected page.

Definition at line 154 of file qgsdatasourcemanagerdialog.cpp.

◆ showEvent()

void QgsDataSourceManagerDialog::showEvent ( QShowEvent *  event)
overrideprotected

Definition at line 329 of file qgsdatasourcemanagerdialog.cpp.

◆ showStatusMessage

void QgsDataSourceManagerDialog::showStatusMessage ( const QString &  message)
signal

Emitted when a status message needs to be shown: for signal forwarding to QgisApp.

◆ updateProjectHome

void QgsDataSourceManagerDialog::updateProjectHome ( )
signal

Update project home directory.

◆ vectorLayersAdded

void QgsDataSourceManagerDialog::vectorLayersAdded ( const QStringList &  layerQStringList,
const QString &  enc,
const QString &  dataSourceType 
)
slot

One or more vector layer were added: for signal forwarding to QgisApp.

Definition at line 199 of file qgsdatasourcemanagerdialog.cpp.


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