QGIS API Documentation 3.34.0-Prizren (ffbdd678812)
Loading...
Searching...
No Matches
qgstiledsceneproviderguimetadata.cpp
Go to the documentation of this file.
1/***************************************************************************
2 qgstiledsceneproviderguimetadata.cpp
3 --------------------------------------
4 begin : June 2023
5 copyright : (C) 2023 by Nyall Dawson
6 email : nyall dot dawson at gmail dot com
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15
18#include "qgsapplication.h"
21
23
24class QgsTiledSceneSourceSelectProvider : public QgsSourceSelectProvider
25{
26 public:
27
28 QString providerKey() const override { return QStringLiteral( "tiledscene" ); }
29 QString text() const override { return QObject::tr( "Scene" ); }
30 int ordering() const override { return QgsSourceSelectProvider::OrderRemoteProvider + 51; }
31 QIcon icon() const override { return QgsApplication::getThemeIcon( QStringLiteral( "/mActionAddTiledSceneLayer.svg" ) ); }
32 QgsAbstractDataSourceWidget *createDataSourceWidget( QWidget *parent = nullptr, Qt::WindowFlags fl = Qt::Widget, QgsProviderRegistry::WidgetMode widgetMode = QgsProviderRegistry::WidgetMode::Embedded ) const override
33 {
34 return new QgsTiledSceneSourceSelect( parent, fl, widgetMode );
35 }
36};
37
38QgsTiledSceneProviderGuiMetadata::QgsTiledSceneProviderGuiMetadata()
39 : QgsProviderGuiMetadata( QStringLiteral( "tiledscene" ) )
40{
41}
42
43QList<QgsDataItemGuiProvider *> QgsTiledSceneProviderGuiMetadata::dataItemGuiProviders()
44{
45 return { new QgsTiledSceneDataItemGuiProvider() };
46}
47
48QList<QgsSourceSelectProvider *> QgsTiledSceneProviderGuiMetadata::sourceSelectProviders()
49{
50 return { new QgsTiledSceneSourceSelectProvider };
51}
52
Abstract base Data Source Widget to create connections and add layers This class provides common func...
static QIcon getThemeIcon(const QString &name, const QColor &fillColor=QColor(), const QColor &strokeColor=QColor())
Helper to get a theme icon.
Holds data for GUI part of the data providers.
WidgetMode
Different ways a source select dialog can be used.
@ Embedded
Used for the data source manager dialog where the widget is embedded as the main content for a partic...
This is the interface for those who want to add entries to the QgsDataSourceManagerDialog.
virtual QString providerKey() const =0
Data Provider key.
virtual int ordering() const
Ordering: the source select provider registry will be able to sort the source selects (ascending) usi...
virtual QgsAbstractDataSourceWidget * createDataSourceWidget(QWidget *parent=nullptr, Qt::WindowFlags fl=Qt::Widget, QgsProviderRegistry::WidgetMode widgetMode=QgsProviderRegistry::WidgetMode::Embedded) const =0
Create a new instance of QgsAbstractDataSourceWidget (or nullptr).
virtual QIcon icon() const =0
Creates a new instance of an QIcon for the menu item entry.
virtual QString text() const =0
Text for the menu item entry, it will be visible to the user so make sure it's translatable.
@ OrderRemoteProvider
Starting point for remote (online) providers (e.g. WMS)