mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-22 00:06:12 -05:00
Allow to use WMS as static provider
This commit is contained in:
parent
4e51938559
commit
635c1b54d8
@ -74,18 +74,27 @@ endif(NOT MSVC)
|
||||
|
||||
IF (IOS)
|
||||
SET (DEFAULT_FORCE_STATIC_LIBS TRUE)
|
||||
SET (DEFAULT_FORCE_STATIC_PROVIDERS TRUE)
|
||||
ELSE (IOS)
|
||||
SET (DEFAULT_FORCE_STATIC_LIBS FALSE)
|
||||
SET (DEFAULT_FORCE_STATIC_PROVIDERS FALSE)
|
||||
ENDIF (IOS)
|
||||
|
||||
SET (FORCE_STATIC_LIBS ${DEFAULT_FORCE_STATIC_LIBS} CACHE BOOL "Determines whether libraries should be static only")
|
||||
MARK_AS_ADVANCED(FORCE_STATIC_LIBS)
|
||||
|
||||
IF(FORCE_STATIC_LIBS)
|
||||
SET(LIBRARY_TYPE STATIC)
|
||||
IF (FORCE_STATIC_LIBS)
|
||||
SET (LIBRARY_TYPE STATIC)
|
||||
ELSE (FORCE_STATIC_LIBS)
|
||||
SET(LIBRARY_TYPE SHARED)
|
||||
SET (LIBRARY_TYPE SHARED)
|
||||
ENDIF (FORCE_STATIC_LIBS)
|
||||
|
||||
SET (FORCE_STATIC_PROVIDERS ${DEFAULT_FORCE_STATIC_PROVIDERS} CACHE BOOL "Determines whether data providers should be static only")
|
||||
MARK_AS_ADVANCED(FORCE_STATIC_PROVIDERS)
|
||||
IF (FORCE_STATIC_PROVIDERS)
|
||||
# following variable is used in qgsconfig.h
|
||||
SET (HAVE_STATIC_PROVIDERS TRUE)
|
||||
ENDIF (FORCE_STATIC_PROVIDERS)
|
||||
|
||||
# in generated makefiles use relative paths so the project dir is moveable
|
||||
# Note commented out since it cause problems but it would be nice to resolve these and enable
|
||||
#
|
||||
|
@ -71,5 +71,7 @@
|
||||
|
||||
#cmakedefine HAVE_QT5SERIALPORT
|
||||
|
||||
#cmakedefine HAVE_STATIC_PROVIDERS
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -122,7 +122,15 @@ Removes a child item and returns it without deleting it. Emits relevant signals
|
||||
%Docstring
|
||||
Returns ``True`` if this item is equal to another item (by testing item type and path).
|
||||
%End
|
||||
virtual QWidget *paramWidget() /Factory/;
|
||||
|
||||
virtual QWidget *paramWidget() /Factory,Deprecated/;
|
||||
%Docstring
|
||||
Returns source widget from data item for :py:class:`QgsBrowserPropertiesWidget`
|
||||
|
||||
Use QgsDataItemGuiProvider.createParamWidget() instead
|
||||
|
||||
.. deprecated:: QGIS 3.10
|
||||
%End
|
||||
|
||||
virtual QList<QAction *> actions( QWidget *parent );
|
||||
%Docstring
|
||||
@ -616,7 +624,7 @@ Returns the full path to the directory the item represents.
|
||||
|
||||
virtual QIcon icon();
|
||||
|
||||
virtual QWidget *paramWidget() /Factory/;
|
||||
virtual QWidget *paramWidget() /Factory,Deprecated/;
|
||||
|
||||
virtual bool hasDragEnabled() const;
|
||||
virtual QgsMimeDataUtils::Uri mimeUri() const;
|
||||
@ -680,9 +688,12 @@ Data item that can be used to report problems (e.g. network error)
|
||||
};
|
||||
|
||||
|
||||
|
||||
class QgsDirectoryParamWidget : QTreeWidget
|
||||
{
|
||||
%Docstring
|
||||
|
||||
TODO: move to qgis_gui for QGIS 4
|
||||
%End
|
||||
|
||||
%TypeHeaderCode
|
||||
#include "qgsdataitem.h"
|
||||
|
@ -144,6 +144,17 @@ Called when a user drops on an ``item``. Providers should return ``True``
|
||||
if the drop was handled and do not want other providers to handle the
|
||||
drop, and to prevent the default drop behavior for items.
|
||||
|
||||
.. versionadded:: 3.10
|
||||
%End
|
||||
|
||||
virtual QWidget *createParamWidget( QgsDataItem *item, QgsDataItemGuiContext context ) /Factory/;
|
||||
%Docstring
|
||||
Creates source widget from data item for :py:class:`QgsBrowserPropertiesWidget`
|
||||
By default it returns None.
|
||||
Caller takes responsibility of deleting created.
|
||||
|
||||
The function is replacement of :py:func:`QgsDataItem.paramWidget()`
|
||||
|
||||
.. versionadded:: 3.10
|
||||
%End
|
||||
};
|
||||
|
@ -79,6 +79,7 @@ The function is replacement of QgsProviderRegistry.createSelectionWidget() from
|
||||
|
||||
.. versionadded:: 3.10
|
||||
%End
|
||||
|
||||
private:
|
||||
QgsSourceSelectProviderRegistry( const QgsSourceSelectProviderRegistry &rh );
|
||||
};
|
||||
|
@ -11,8 +11,8 @@ IF (WITH_GUI)
|
||||
ADD_SUBDIRECTORY(auth)
|
||||
ENDIF (WITH_GUI)
|
||||
|
||||
ADD_SUBDIRECTORY(providers)
|
||||
IF (NOT IOS)
|
||||
ADD_SUBDIRECTORY(providers)
|
||||
ADD_SUBDIRECTORY(crssync)
|
||||
ENDIF (NOT IOS)
|
||||
|
||||
|
@ -199,7 +199,7 @@ void QgsAppDirectoryItemGuiProvider::populateContextMenu( QgsDataItem *item, QMe
|
||||
QAction *propertiesAction = new QAction( tr( "Properties…" ), menu );
|
||||
connect( propertiesAction, &QAction::triggered, this, [ = ]
|
||||
{
|
||||
showProperties( directoryItem );
|
||||
showProperties( directoryItem, context );
|
||||
} );
|
||||
menu->addAction( propertiesAction );
|
||||
|
||||
@ -264,7 +264,7 @@ void QgsAppDirectoryItemGuiProvider::toggleFastScan( QgsDirectoryItem *item )
|
||||
settings.setValue( QStringLiteral( "qgis/scanItemsFastScanUris" ), fastScanDirs );
|
||||
}
|
||||
|
||||
void QgsAppDirectoryItemGuiProvider::showProperties( QgsDirectoryItem *item )
|
||||
void QgsAppDirectoryItemGuiProvider::showProperties( QgsDirectoryItem *item, QgsDataItemGuiContext context )
|
||||
{
|
||||
if ( ! item )
|
||||
return;
|
||||
@ -272,7 +272,7 @@ void QgsAppDirectoryItemGuiProvider::showProperties( QgsDirectoryItem *item )
|
||||
QgsBrowserPropertiesDialog *dialog = new QgsBrowserPropertiesDialog( QStringLiteral( "browser" ), QgisApp::instance() );
|
||||
dialog->setAttribute( Qt::WA_DeleteOnClose );
|
||||
|
||||
dialog->setItem( item );
|
||||
dialog->setItem( item, context );
|
||||
dialog->show();
|
||||
}
|
||||
|
||||
@ -423,7 +423,7 @@ void QgsLayerItemGuiProvider::populateContextMenu( QgsDataItem *item, QMenu *men
|
||||
QAction *propertiesAction = new QAction( tr( "Layer Properties…" ), menu );
|
||||
connect( propertiesAction, &QAction::triggered, this, [ = ]
|
||||
{
|
||||
showPropertiesForItem( layerItem );
|
||||
showPropertiesForItem( layerItem, context );
|
||||
} );
|
||||
menu->addAction( propertiesAction );
|
||||
|
||||
@ -523,14 +523,14 @@ void QgsLayerItemGuiProvider::deleteLayers( const QStringList &itemPaths, QgsDat
|
||||
}
|
||||
}
|
||||
|
||||
void QgsLayerItemGuiProvider::showPropertiesForItem( QgsLayerItem *item )
|
||||
void QgsLayerItemGuiProvider::showPropertiesForItem( QgsLayerItem *item, QgsDataItemGuiContext context )
|
||||
{
|
||||
if ( ! item )
|
||||
return;
|
||||
|
||||
QgsBrowserPropertiesDialog *dialog = new QgsBrowserPropertiesDialog( QStringLiteral( "browser" ), QgisApp::instance() );
|
||||
dialog->setAttribute( Qt::WA_DeleteOnClose );
|
||||
dialog->setItem( item );
|
||||
dialog->setItem( item, context );
|
||||
dialog->show();
|
||||
}
|
||||
|
||||
|
@ -46,7 +46,7 @@ class QgsAppDirectoryItemGuiProvider : public QObject, public QgsDataItemGuiProv
|
||||
void renameFavorite( QgsFavoriteItem *favorite );
|
||||
void hideDirectory( QgsDirectoryItem *item );
|
||||
void toggleFastScan( QgsDirectoryItem *item );
|
||||
void showProperties( QgsDirectoryItem *item );
|
||||
void showProperties( QgsDirectoryItem *item, QgsDataItemGuiContext context );
|
||||
};
|
||||
|
||||
|
||||
@ -99,7 +99,7 @@ class QgsLayerItemGuiProvider : public QObject, public QgsDataItemGuiProvider
|
||||
private:
|
||||
|
||||
void addLayersFromItems( const QList<QgsDataItem *> &items );
|
||||
void showPropertiesForItem( QgsLayerItem *item );
|
||||
void showPropertiesForItem( QgsLayerItem *item, QgsDataItemGuiContext context );
|
||||
void deleteLayers( const QStringList &itemPath, QgsDataItemGuiContext context );
|
||||
|
||||
};
|
||||
|
@ -1495,6 +1495,16 @@ TARGET_LINK_LIBRARIES(qgis_core
|
||||
${LIBZIP_LIBRARY}
|
||||
)
|
||||
|
||||
IF (FORCE_STATIC_PROVIDERS)
|
||||
INCLUDE_DIRECTORIES(
|
||||
${CMAKE_SOURCE_DIR}/src/providers/wms
|
||||
)
|
||||
|
||||
TARGET_LINK_LIBRARIES(qgis_core
|
||||
wmsprovider_a
|
||||
)
|
||||
ENDIF (FORCE_STATIC_PROVIDERS)
|
||||
|
||||
IF (MSVC)
|
||||
#needed for linking to gdal which needs odbc
|
||||
SET(TARGET_LINK_LIBRARIES qgis_core odbc32 odbccp32)
|
||||
|
@ -142,7 +142,15 @@ class CORE_EXPORT QgsDataItem : public QObject
|
||||
* Returns TRUE if this item is equal to another item (by testing item type and path).
|
||||
*/
|
||||
virtual bool equal( const QgsDataItem *other );
|
||||
virtual QWidget *paramWidget() SIP_FACTORY { return nullptr; }
|
||||
|
||||
/**
|
||||
* Returns source widget from data item for QgsBrowserPropertiesWidget
|
||||
*
|
||||
* Use QgsDataItemGuiProvider::createParamWidget() instead
|
||||
*
|
||||
* \deprecated QGIS 3.10
|
||||
*/
|
||||
Q_DECL_DEPRECATED virtual QWidget *paramWidget() SIP_FACTORY SIP_DEPRECATED { return nullptr; }
|
||||
|
||||
/**
|
||||
* Returns the list of actions available for this item. This is usually used for the popup menu on right-clicking
|
||||
@ -625,7 +633,7 @@ class CORE_EXPORT QgsDirectoryItem : public QgsDataCollectionItem
|
||||
|
||||
bool equal( const QgsDataItem *other ) override;
|
||||
QIcon icon() override;
|
||||
QWidget *paramWidget() override SIP_FACTORY;
|
||||
Q_DECL_DEPRECATED QWidget *paramWidget() override SIP_FACTORY SIP_DEPRECATED;
|
||||
bool hasDragEnabled() const override { return true; }
|
||||
QgsMimeDataUtils::Uri mimeUri() const override;
|
||||
|
||||
@ -682,12 +690,13 @@ class CORE_EXPORT QgsErrorItem : public QgsDataItem
|
||||
|
||||
};
|
||||
|
||||
|
||||
// ---------
|
||||
|
||||
/**
|
||||
* \ingroup core
|
||||
* \class QgsDirectoryParamWidget
|
||||
*
|
||||
* TODO: move to qgis_gui for QGIS 4
|
||||
*/
|
||||
class CORE_EXPORT QgsDirectoryParamWidget : public QTreeWidget
|
||||
{
|
||||
|
@ -35,6 +35,9 @@
|
||||
#include "providers/gdal/qgsgdalprovider.h"
|
||||
#include "providers/ogr/qgsogrprovider.h"
|
||||
#include "providers/meshmemory/qgsmeshmemorydataprovider.h"
|
||||
#ifdef HAVE_STATIC_PROVIDERS
|
||||
#include "qgswmsprovider.h"
|
||||
#endif
|
||||
|
||||
static QgsProviderRegistry *sInstance = nullptr;
|
||||
|
||||
@ -97,8 +100,6 @@ QgsProviderRegistry::QgsProviderRegistry( const QString &pluginPath )
|
||||
|
||||
void QgsProviderRegistry::init()
|
||||
{
|
||||
typedef QgsProviderMetadata *factory_function( );
|
||||
|
||||
// add static providers
|
||||
Q_NOWARN_DEPRECATED_PUSH
|
||||
mProviders[ QgsMemoryProvider::providerKey() ] = new QgsProviderMetadata( QgsMemoryProvider::providerKey(), QgsMemoryProvider::providerDescription(), &QgsMemoryProvider::createProvider );
|
||||
@ -106,8 +107,16 @@ void QgsProviderRegistry::init()
|
||||
Q_NOWARN_DEPRECATED_POP
|
||||
mProviders[ QgsGdalProvider::providerKey() ] = new QgsGdalProviderMetadata();
|
||||
mProviders[ QgsOgrProvider::providerKey() ] = new QgsOgrProviderMetadata();
|
||||
#ifdef HAVE_STATIC_PROVIDERS
|
||||
mProviders[ QgsWmsProvider::providerKey() ] = new QgsWmsProviderMetadata();
|
||||
#endif
|
||||
|
||||
// add dynamic providers
|
||||
#ifdef HAVE_STATIC_PROVIDERS
|
||||
QgsDebugMsg( QStringLiteral( "Forced only static providers" ) );
|
||||
#else
|
||||
typedef QgsProviderMetadata *factory_function( );
|
||||
|
||||
mLibraryDirectory.setSorting( QDir::Name | QDir::IgnoreCase );
|
||||
mLibraryDirectory.setFilter( QDir::Files | QDir::NoSymLinks );
|
||||
|
||||
@ -177,7 +186,7 @@ void QgsProviderRegistry::init()
|
||||
// add this provider to the provider map
|
||||
mProviders[meta->key()] = meta;
|
||||
}
|
||||
|
||||
#endif
|
||||
QgsDebugMsg( QStringLiteral( "Loaded %1 providers (%2) " ).arg( mProviders.size() ).arg( providerList().join( ';' ) ) );
|
||||
|
||||
// now initialize all providers
|
||||
|
@ -1123,6 +1123,15 @@ TARGET_LINK_LIBRARIES(qgis_gui
|
||||
${Qt5QuickWidgets_LIBRARIES}
|
||||
)
|
||||
|
||||
IF (FORCE_STATIC_PROVIDERS)
|
||||
INCLUDE_DIRECTORIES(
|
||||
${CMAKE_SOURCE_DIR}/src/providers/wms
|
||||
)
|
||||
TARGET_LINK_LIBRARIES(qgis_gui
|
||||
wmsprovider_gui_a
|
||||
)
|
||||
ENDIF (FORCE_STATIC_PROVIDERS)
|
||||
|
||||
IF(ENABLE_MODELTEST)
|
||||
TARGET_LINK_LIBRARIES(qgis_gui ${Qt5Test_LIBRARIES})
|
||||
ENDIF(ENABLE_MODELTEST)
|
||||
|
@ -444,7 +444,7 @@ void QgsBrowserDockWidget::showProperties()
|
||||
{
|
||||
QgsBrowserPropertiesDialog *dialog = new QgsBrowserPropertiesDialog( settingsSection(), this );
|
||||
dialog->setAttribute( Qt::WA_DeleteOnClose );
|
||||
dialog->setItem( item );
|
||||
dialog->setItem( item, createContext() );
|
||||
dialog->show();
|
||||
}
|
||||
}
|
||||
@ -563,7 +563,8 @@ void QgsBrowserDockWidget::setPropertiesWidget()
|
||||
{
|
||||
QModelIndex index = mProxyModel->mapToSource( indexes.value( 0 ) );
|
||||
QgsDataItem *item = mModel->dataItem( index );
|
||||
QgsBrowserPropertiesWidget *propertiesWidget = QgsBrowserPropertiesWidget::createWidget( item, mPropertiesWidget );
|
||||
QgsDataItemGuiContext context = createContext();
|
||||
QgsBrowserPropertiesWidget *propertiesWidget = QgsBrowserPropertiesWidget::createWidget( item, context, mPropertiesWidget );
|
||||
if ( propertiesWidget )
|
||||
{
|
||||
propertiesWidget->setCondensedMode( true );
|
||||
|
@ -29,6 +29,8 @@
|
||||
#include <QFileDialog>
|
||||
#include <QPlainTextDocumentLayout>
|
||||
#include <QSortFilterProxyModel>
|
||||
#include <QDesktopServices>
|
||||
#include <QDragEnterEvent>
|
||||
|
||||
#include "qgsbrowsermodel.h"
|
||||
#include "qgsbrowsertreeview.h"
|
||||
@ -45,10 +47,8 @@
|
||||
#include "qgsattributetablemodel.h"
|
||||
#include "qgsattributetablefiltermodel.h"
|
||||
#include "qgsapplication.h"
|
||||
#include <QDesktopServices>
|
||||
|
||||
#include <QDragEnterEvent>
|
||||
|
||||
#include "qgsdataitemguiproviderregistry.h"
|
||||
#include "qgsdataitemguiprovider.h"
|
||||
|
||||
/// @cond PRIVATE
|
||||
|
||||
@ -71,7 +71,7 @@ QgsBrowserPropertiesWrapLabel::QgsBrowserPropertiesWrapLabel( const QString &tex
|
||||
|
||||
void QgsBrowserPropertiesWrapLabel::adjustHeight( QSizeF size )
|
||||
{
|
||||
int height = size.height() + 2 * frameWidth();
|
||||
int height = static_cast<int>( size.height() ) + 2 * frameWidth();
|
||||
setMinimumHeight( height );
|
||||
setMaximumHeight( height );
|
||||
}
|
||||
@ -88,7 +88,7 @@ void QgsBrowserPropertiesWidget::setWidget( QWidget *paramWidget )
|
||||
layout->addWidget( paramWidget );
|
||||
}
|
||||
|
||||
QgsBrowserPropertiesWidget *QgsBrowserPropertiesWidget::createWidget( QgsDataItem *item, QWidget *parent )
|
||||
QgsBrowserPropertiesWidget *QgsBrowserPropertiesWidget::createWidget( QgsDataItem *item, const QgsDataItemGuiContext &context, QWidget *parent )
|
||||
{
|
||||
QgsBrowserPropertiesWidget *propertiesWidget = nullptr;
|
||||
// In general, we would like to show all items' paramWidget, but top level items like
|
||||
@ -100,8 +100,24 @@ QgsBrowserPropertiesWidget *QgsBrowserPropertiesWidget::createWidget( QgsDataIte
|
||||
}
|
||||
else if ( item->type() == QgsDataItem::Layer )
|
||||
{
|
||||
// try new infrastructure of creation of layer widgets
|
||||
QWidget *paramWidget = nullptr;
|
||||
const QList< QgsDataItemGuiProvider * > providers = QgsGui::instance()->dataItemGuiProviderRegistry()->providers();
|
||||
for ( QgsDataItemGuiProvider *provider : providers )
|
||||
{
|
||||
paramWidget = provider->createParamWidget( item, context );
|
||||
if ( paramWidget )
|
||||
break;
|
||||
}
|
||||
if ( !paramWidget )
|
||||
{
|
||||
// try old infrastructure
|
||||
Q_NOWARN_DEPRECATED_PUSH
|
||||
paramWidget = item->paramWidget();
|
||||
Q_NOWARN_DEPRECATED_POP
|
||||
}
|
||||
|
||||
// prefer item's widget over standard layer widget
|
||||
QWidget *paramWidget = item->paramWidget();
|
||||
if ( paramWidget )
|
||||
{
|
||||
propertiesWidget = new QgsBrowserPropertiesWidget( parent );
|
||||
@ -342,12 +358,12 @@ QgsBrowserPropertiesDialog::QgsBrowserPropertiesDialog( const QString &settingsS
|
||||
QgsGui::instance()->enableAutoGeometryRestore( this );
|
||||
}
|
||||
|
||||
void QgsBrowserPropertiesDialog::setItem( QgsDataItem *item )
|
||||
void QgsBrowserPropertiesDialog::setItem( QgsDataItem *item, const QgsDataItemGuiContext &context )
|
||||
{
|
||||
if ( !item )
|
||||
return;
|
||||
|
||||
mPropertiesWidget = QgsBrowserPropertiesWidget::createWidget( item, this );
|
||||
mPropertiesWidget = QgsBrowserPropertiesWidget::createWidget( item, context, this );
|
||||
mLayout->addWidget( mPropertiesWidget );
|
||||
setWindowTitle( item->type() == QgsDataItem::Layer ? tr( "Layer Properties" ) : tr( "Directory Properties" ) );
|
||||
}
|
||||
|
@ -32,6 +32,7 @@
|
||||
// version without notice, or even be removed.
|
||||
//
|
||||
|
||||
#include <QSortFilterProxyModel>
|
||||
|
||||
#include "ui_qgsbrowserdockwidgetbase.h"
|
||||
#include "ui_qgsbrowserlayerpropertiesbase.h"
|
||||
@ -41,13 +42,14 @@
|
||||
#include "qgsdataitem.h"
|
||||
#include "qgsbrowsertreeview.h"
|
||||
#include "qgsdockwidget.h"
|
||||
#include <QSortFilterProxyModel>
|
||||
#include "qgsdataitemguiprovider.h"
|
||||
|
||||
class QgsBrowserGuiModel;
|
||||
class QModelIndex;
|
||||
class QgsDockBrowserTreeView;
|
||||
class QgsLayerItem;
|
||||
class QgsDataItem;
|
||||
class QgsDirectoryParamWidget;
|
||||
|
||||
#define SIP_NO_FILE
|
||||
|
||||
@ -84,9 +86,9 @@ class QgsBrowserPropertiesWidget : public QWidget
|
||||
*/
|
||||
explicit QgsBrowserPropertiesWidget( QWidget *parent = nullptr );
|
||||
//! Factory method to create a new browser properties widget
|
||||
static QgsBrowserPropertiesWidget *createWidget( QgsDataItem *item, QWidget *parent = nullptr );
|
||||
static QgsBrowserPropertiesWidget *createWidget( QgsDataItem *item, const QgsDataItemGuiContext &context, QWidget *parent = nullptr );
|
||||
//! Stub
|
||||
virtual void setItem( QgsDataItem *item ) { Q_UNUSED( item ) }
|
||||
virtual void setItem( QgsDataItem *item ) { Q_UNUSED( item ); }
|
||||
//! Sets content widget, usually item paramWidget. Takes ownership.
|
||||
virtual void setWidget( QWidget *widget );
|
||||
|
||||
@ -173,7 +175,7 @@ class GUI_EXPORT QgsBrowserPropertiesDialog : public QDialog, private Ui::QgsBro
|
||||
QgsBrowserPropertiesDialog( const QString &settingsSection, QWidget *parent = nullptr );
|
||||
|
||||
//! Create dialog from the given item and add it
|
||||
void setItem( QgsDataItem *item );
|
||||
void setItem( QgsDataItem *item, const QgsDataItemGuiContext &context );
|
||||
|
||||
private:
|
||||
QgsBrowserPropertiesWidget *mPropertiesWidget = nullptr;
|
||||
|
@ -61,3 +61,8 @@ bool QgsDataItemGuiProvider::handleDrop( QgsDataItem *, QgsDataItemGuiContext, c
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
QWidget *QgsDataItemGuiProvider::createParamWidget( QgsDataItem *, QgsDataItemGuiContext )
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -163,6 +163,17 @@ class GUI_EXPORT QgsDataItemGuiProvider
|
||||
* \since QGIS 3.10
|
||||
*/
|
||||
virtual bool handleDrop( QgsDataItem *item, QgsDataItemGuiContext context, const QMimeData *data, Qt::DropAction action );
|
||||
|
||||
/**
|
||||
* Creates source widget from data item for QgsBrowserPropertiesWidget
|
||||
* By default it returns nullptr.
|
||||
* Caller takes responsibility of deleting created.
|
||||
*
|
||||
* The function is replacement of QgsDataItem::paramWidget()
|
||||
*
|
||||
* \since QGIS 3.10
|
||||
*/
|
||||
virtual QWidget *createParamWidget( QgsDataItem *item, QgsDataItemGuiContext context ) SIP_FACTORY;
|
||||
};
|
||||
|
||||
#endif // QGSDATAITEMGUIPROVIDER_H
|
||||
|
@ -25,6 +25,10 @@
|
||||
#include "qgsgdalguiprovider.h"
|
||||
#include "qgsogrguiprovider.h"
|
||||
|
||||
#ifdef HAVE_STATIC_PROVIDERS
|
||||
#include "qgswmsprovidergui.h"
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Convenience function for finding any existing data providers that match "providerKey"
|
||||
|
||||
@ -47,6 +51,12 @@ QgsProviderGuiMetadata *findMetadata_( QgsProviderGuiRegistry::GuiProviders cons
|
||||
} // findMetadata_
|
||||
|
||||
QgsProviderGuiRegistry::QgsProviderGuiRegistry( const QString &pluginPath )
|
||||
{
|
||||
loadStaticProviders();
|
||||
loadDynamicProviders( pluginPath );
|
||||
}
|
||||
|
||||
void QgsProviderGuiRegistry::loadStaticProviders( )
|
||||
{
|
||||
// Register static providers
|
||||
QgsProviderGuiMetadata *gdal = new QgsGdalGuiProviderMetadata();
|
||||
@ -55,11 +65,17 @@ QgsProviderGuiRegistry::QgsProviderGuiRegistry( const QString &pluginPath )
|
||||
QgsProviderGuiMetadata *ogr = new QgsOgrGuiProviderMetadata();
|
||||
mProviders[ ogr->key() ] = ogr;
|
||||
|
||||
loadDynamicProviders( pluginPath );
|
||||
#ifdef HAVE_STATIC_PROVIDERS
|
||||
QgsProviderGuiMetadata *wms = new QgsWmsProviderGuiMetadata();
|
||||
mProviders[ wms->key() ] = wms;
|
||||
#endif
|
||||
}
|
||||
|
||||
void QgsProviderGuiRegistry::loadDynamicProviders( const QString &pluginPath )
|
||||
{
|
||||
#ifdef HAVE_STATIC_PROVIDERS
|
||||
QgsDebugMsg( QStringLiteral( "Forced only static GUI providers" ) );
|
||||
#else
|
||||
typedef QgsProviderGuiMetadata *factory_function( );
|
||||
|
||||
// add dynamic providers
|
||||
@ -124,6 +140,7 @@ void QgsProviderGuiRegistry::loadDynamicProviders( const QString &pluginPath )
|
||||
mProviders[providerKey] = meta;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
QgsProviderGuiRegistry::~QgsProviderGuiRegistry()
|
||||
|
@ -90,9 +90,21 @@ class GUI_EXPORT QgsProviderGuiRegistry
|
||||
SIP_SKIP typedef std::map<QString, QgsProviderGuiMetadata *> GuiProviders;
|
||||
|
||||
private:
|
||||
//! Loads the dynamic plugins on the given path
|
||||
|
||||
/**
|
||||
* Loads the dynamic plugins on the given path
|
||||
* When QGIS is compiled with FORCE_STATIC_PROVIDERS,
|
||||
* the function is no-op
|
||||
*/
|
||||
void loadDynamicProviders( const QString &pluginPath );
|
||||
|
||||
/**
|
||||
* Loads the static providers
|
||||
* By default only ogr and gdal providers, but when QGIS is compiled with
|
||||
* FORCE_STATIC_PROVIDERS, it also loads all the rest of providers
|
||||
*/
|
||||
void loadStaticProviders( );
|
||||
|
||||
//! Associative container of provider metadata handles
|
||||
GuiProviders mProviders;
|
||||
};
|
||||
|
@ -25,8 +25,6 @@
|
||||
|
||||
QgsRatioLockButton::QgsRatioLockButton( QWidget *parent )
|
||||
: QToolButton( parent )
|
||||
|
||||
|
||||
{
|
||||
setMinimumSize( QSize( 24, 24 ) );
|
||||
setMaximumWidth( fontMetrics().width( QStringLiteral( "000" ) ) );
|
||||
|
@ -88,6 +88,7 @@ class GUI_EXPORT QgsSourceSelectProviderRegistry
|
||||
Qt::WindowFlags fl,
|
||||
QgsProviderRegistry::WidgetMode widgetMode
|
||||
);
|
||||
|
||||
private:
|
||||
#ifdef SIP_RUN
|
||||
QgsSourceSelectProviderRegistry( const QgsSourceSelectProviderRegistry &rh );
|
||||
|
@ -2,30 +2,32 @@
|
||||
SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${QGIS_OUTPUT_DIRECTORY}/${QGIS_PLUGIN_SUBDIR})
|
||||
SET (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${QGIS_OUTPUT_DIRECTORY}/${QGIS_PLUGIN_SUBDIR})
|
||||
|
||||
ADD_SUBDIRECTORY(arcgisrest)
|
||||
# providers with implemented both static and dynamic building
|
||||
ADD_SUBDIRECTORY(wms)
|
||||
ADD_SUBDIRECTORY(delimitedtext)
|
||||
ADD_SUBDIRECTORY(geonode)
|
||||
IF (NOT IOS)
|
||||
ADD_SUBDIRECTORY(mssql)
|
||||
ENDIF(NOT IOS)
|
||||
ADD_SUBDIRECTORY(ows)
|
||||
ADD_SUBDIRECTORY(wcs)
|
||||
ADD_SUBDIRECTORY(gpx)
|
||||
ADD_SUBDIRECTORY(wfs)
|
||||
ADD_SUBDIRECTORY(spatialite)
|
||||
ADD_SUBDIRECTORY(virtual)
|
||||
ADD_SUBDIRECTORY(db2)
|
||||
ADD_SUBDIRECTORY(mdal)
|
||||
|
||||
IF (WITH_ORACLE)
|
||||
ADD_SUBDIRECTORY(oracle)
|
||||
ENDIF(WITH_ORACLE)
|
||||
IF (NOT FORCE_STATIC_PROVIDERS)
|
||||
ADD_SUBDIRECTORY(arcgisrest)
|
||||
ADD_SUBDIRECTORY(delimitedtext)
|
||||
ADD_SUBDIRECTORY(geonode)
|
||||
ADD_SUBDIRECTORY(mssql)
|
||||
ADD_SUBDIRECTORY(ows)
|
||||
ADD_SUBDIRECTORY(wcs)
|
||||
ADD_SUBDIRECTORY(gpx)
|
||||
ADD_SUBDIRECTORY(wfs)
|
||||
ADD_SUBDIRECTORY(spatialite)
|
||||
ADD_SUBDIRECTORY(virtual)
|
||||
ADD_SUBDIRECTORY(db2)
|
||||
ADD_SUBDIRECTORY(mdal)
|
||||
|
||||
IF (POSTGRES_FOUND)
|
||||
ADD_SUBDIRECTORY(postgres)
|
||||
ENDIF (POSTGRES_FOUND)
|
||||
IF (WITH_ORACLE)
|
||||
ADD_SUBDIRECTORY(oracle)
|
||||
ENDIF(WITH_ORACLE)
|
||||
|
||||
IF (WITH_GRASS OR WITH_GRASS7)
|
||||
ADD_SUBDIRECTORY(grass)
|
||||
ENDIF (WITH_GRASS OR WITH_GRASS7)
|
||||
IF (POSTGRES_FOUND)
|
||||
ADD_SUBDIRECTORY(postgres)
|
||||
ENDIF (POSTGRES_FOUND)
|
||||
|
||||
IF (WITH_GRASS OR WITH_GRASS7)
|
||||
ADD_SUBDIRECTORY(grass)
|
||||
ENDIF (WITH_GRASS OR WITH_GRASS7)
|
||||
ENDIF (NOT FORCE_STATIC_PROVIDERS)
|
||||
|
@ -12,7 +12,7 @@ SET (WMS_MOC_HDRS
|
||||
)
|
||||
|
||||
IF (WITH_GUI)
|
||||
SET(WMS_SRCS ${WMS_SRCS}
|
||||
SET(WMS_GUI_SRCS
|
||||
qgswmsprovidergui.cpp
|
||||
qgswmssourceselect.cpp
|
||||
qgswmsdataitemguiproviders.cpp
|
||||
@ -20,7 +20,8 @@ IF (WITH_GUI)
|
||||
qgswmtsdimensions.cpp
|
||||
qgsxyzconnectiondialog.cpp
|
||||
)
|
||||
SET(WMS_MOC_HDRS ${WMS_MOC_HDRS}
|
||||
SET(WMS_GUI_MOC_HDRS
|
||||
qgswmsprovidergui.h
|
||||
qgswmssourceselect.h
|
||||
qgswmsdataitemguiproviders.h
|
||||
qgstilescalewidget.h
|
||||
@ -30,6 +31,7 @@ IF (WITH_GUI)
|
||||
ENDIF ()
|
||||
|
||||
QT5_WRAP_CPP (WMS_MOC_SRCS ${WMS_MOC_HDRS})
|
||||
QT5_WRAP_CPP (WMS_GUI_MOC_SRCS ${WMS_GUI_MOC_HDRS})
|
||||
|
||||
INCLUDE_DIRECTORIES(
|
||||
${CMAKE_SOURCE_DIR}/src/core
|
||||
@ -54,31 +56,58 @@ INCLUDE_DIRECTORIES(SYSTEM
|
||||
${QTKEYCHAIN_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
# static library
|
||||
ADD_LIBRARY(wmsprovider_a STATIC ${WMS_SRCS} ${WMS_MOC_SRCS})
|
||||
ADD_LIBRARY(wmsprovider MODULE ${WMS_SRCS} ${WMS_MOC_SRCS})
|
||||
|
||||
TARGET_LINK_LIBRARIES(wmsprovider
|
||||
qgis_core
|
||||
${GDAL_LIBRARY} # for OGR_G_CreateGeometryFromJson()
|
||||
)
|
||||
|
||||
|
||||
TARGET_LINK_LIBRARIES(wmsprovider_a
|
||||
qgis_core
|
||||
${Qt5Xml_LIBRARIES}
|
||||
${Qt5Core_LIBRARIES}
|
||||
${Qt5Svg_LIBRARIES}
|
||||
${Qt5Network_LIBRARIES}
|
||||
${Qt5Sql_LIBRARIES}
|
||||
${Qt5Concurrent_LIBRARIES}
|
||||
)
|
||||
|
||||
TARGET_COMPILE_DEFINITIONS(wmsprovider_a PRIVATE "-DQT_NO_FOREACH")
|
||||
|
||||
IF (WITH_GUI)
|
||||
TARGET_LINK_LIBRARIES (wmsprovider
|
||||
qgis_gui
|
||||
ADD_LIBRARY(wmsprovider_gui_a STATIC ${WMS_GUI_SRCS} ${WMS_GUI_MOC_SRCS})
|
||||
TARGET_LINK_LIBRARIES(wmsprovider_gui_a
|
||||
${Qt5Xml_LIBRARIES}
|
||||
${Qt5Core_LIBRARIES}
|
||||
${Qt5Svg_LIBRARIES}
|
||||
${Qt5Network_LIBRARIES}
|
||||
${Qt5Sql_LIBRARIES}
|
||||
${Qt5Concurrent_LIBRARIES}
|
||||
${Qt5Gui_LIBRARIES}
|
||||
${Qt5Widgets_LIBRARIES}
|
||||
)
|
||||
TARGET_LINK_LIBRARIES (wmsprovider_a
|
||||
qgis_gui
|
||||
TARGET_COMPILE_DEFINITIONS(wmsprovider_gui_a PRIVATE "-DQT_NO_FOREACH")
|
||||
ENDIF (WITH_GUI)
|
||||
|
||||
IF (FORCE_STATIC_PROVIDERS)
|
||||
# for (external) mobile apps to be able to pick up provider for linking
|
||||
INSTALL (TARGETS wmsprovider_a ARCHIVE DESTINATION ${QGIS_PLUGIN_DIR})
|
||||
IF (WITH_GUI)
|
||||
INSTALL (TARGETS wmsprovider_gui_a ARCHIVE DESTINATION ${QGIS_PLUGIN_DIR})
|
||||
ENDIF (WITH_GUI)
|
||||
ELSE (FORCE_STATIC_PROVIDERS)
|
||||
# dynimally loaded module
|
||||
ADD_LIBRARY(wmsprovider MODULE ${WMS_SRCS} ${WMS_GUI_SRCS} ${WMS_MOC_SRCS} ${WMS_GUI_MOC_SRCS})
|
||||
|
||||
TARGET_LINK_LIBRARIES(wmsprovider
|
||||
qgis_core
|
||||
${GDAL_LIBRARY} # for OGR_G_CreateGeometryFromJson()
|
||||
)
|
||||
ENDIF ()
|
||||
|
||||
TARGET_COMPILE_DEFINITIONS(wmsprovider PRIVATE "-DQT_NO_FOREACH")
|
||||
IF (WITH_GUI)
|
||||
TARGET_LINK_LIBRARIES (wmsprovider
|
||||
qgis_gui
|
||||
)
|
||||
ENDIF (WITH_GUI)
|
||||
|
||||
INSTALL (TARGETS wmsprovider
|
||||
RUNTIME DESTINATION ${QGIS_PLUGIN_DIR}
|
||||
LIBRARY DESTINATION ${QGIS_PLUGIN_DIR})
|
||||
TARGET_COMPILE_DEFINITIONS(wmsprovider PRIVATE "-DQT_NO_FOREACH")
|
||||
|
||||
INSTALL (TARGETS wmsprovider
|
||||
RUNTIME DESTINATION ${QGIS_PLUGIN_DIR}
|
||||
LIBRARY DESTINATION ${QGIS_PLUGIN_DIR})
|
||||
|
||||
ENDIF (NOT FORCE_STATIC_PROVIDERS)
|
||||
|
@ -22,10 +22,22 @@
|
||||
#include "qgsxyzconnectiondialog.h"
|
||||
#include "qgsxyzconnection.h"
|
||||
#include "qgsmanageconnectionsdialog.h"
|
||||
#include "qgswmssourceselect.h"
|
||||
|
||||
#include <QFileDialog>
|
||||
#include <QMessageBox>
|
||||
|
||||
static QWidget *_paramWidget( QgsDataItem *root )
|
||||
{
|
||||
if ( qobject_cast<QgsWMSRootItem *>( root ) != nullptr )
|
||||
{
|
||||
return new QgsWMSSourceSelect( nullptr, nullptr, QgsProviderRegistry::WidgetMode::Manager );
|
||||
}
|
||||
else
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void QgsWmsDataItemGuiProvider::populateContextMenu( QgsDataItem *item, QMenu *menu, const QList<QgsDataItem *> &, QgsDataItemGuiContext )
|
||||
{
|
||||
@ -48,6 +60,11 @@ void QgsWmsDataItemGuiProvider::populateContextMenu( QgsDataItem *item, QMenu *m
|
||||
}
|
||||
}
|
||||
|
||||
QWidget *QgsWmsDataItemGuiProvider::createParamWidget( QgsDataItem *root, QgsDataItemGuiContext )
|
||||
{
|
||||
return _paramWidget( root );
|
||||
}
|
||||
|
||||
void QgsWmsDataItemGuiProvider::editConnection( QgsDataItem *item )
|
||||
{
|
||||
QgsNewHttpConnection nc( nullptr, QgsNewHttpConnection::ConnectionWms, QStringLiteral( "qgis/connections-wms/" ), item->name() );
|
||||
@ -113,6 +130,11 @@ void QgsXyzDataItemGuiProvider::populateContextMenu( QgsDataItem *item, QMenu *m
|
||||
}
|
||||
}
|
||||
|
||||
QWidget *QgsXyzDataItemGuiProvider::createParamWidget( QgsDataItem *root, QgsDataItemGuiContext )
|
||||
{
|
||||
return _paramWidget( root );
|
||||
}
|
||||
|
||||
void QgsXyzDataItemGuiProvider::editConnection( QgsDataItem *item )
|
||||
{
|
||||
QgsXyzConnectionDialog dlg;
|
||||
|
@ -28,6 +28,8 @@ class QgsWmsDataItemGuiProvider : public QObject, public QgsDataItemGuiProvider
|
||||
void populateContextMenu( QgsDataItem *item, QMenu *menu,
|
||||
const QList<QgsDataItem *> &selectedItems, QgsDataItemGuiContext context ) override;
|
||||
|
||||
QWidget *createParamWidget( QgsDataItem *root, QgsDataItemGuiContext ) override;
|
||||
|
||||
private:
|
||||
static void editConnection( QgsDataItem *item );
|
||||
static void deleteConnection( QgsDataItem *item );
|
||||
@ -46,6 +48,8 @@ class QgsXyzDataItemGuiProvider : public QObject, public QgsDataItemGuiProvider
|
||||
void populateContextMenu( QgsDataItem *item, QMenu *menu,
|
||||
const QList<QgsDataItem *> &selectedItems, QgsDataItemGuiContext context ) override;
|
||||
|
||||
QWidget *createParamWidget( QgsDataItem *root, QgsDataItemGuiContext ) override;
|
||||
|
||||
private:
|
||||
static void editConnection( QgsDataItem *item );
|
||||
static void deleteConnection( QgsDataItem *item );
|
||||
|
@ -332,15 +332,6 @@ QVector<QgsDataItem *> QgsWMSRootItem::createChildren()
|
||||
return connections;
|
||||
}
|
||||
|
||||
#ifdef HAVE_GUI
|
||||
QWidget *QgsWMSRootItem::paramWidget()
|
||||
{
|
||||
QgsWMSSourceSelect *select = new QgsWMSSourceSelect( nullptr, nullptr, QgsProviderRegistry::WidgetMode::Manager );
|
||||
return select;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
@ -92,12 +92,7 @@ class QgsWMSRootItem : public QgsDataCollectionItem
|
||||
|
||||
QVariant sortKey() const override { return 7; }
|
||||
|
||||
#ifdef HAVE_GUI
|
||||
QWidget *paramWidget() override;
|
||||
#endif
|
||||
|
||||
public slots:
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
@ -3226,6 +3226,10 @@ QString QgsWmsProvider::name() const
|
||||
return WMS_KEY;
|
||||
}
|
||||
|
||||
QString QgsWmsProvider::providerKey()
|
||||
{
|
||||
return WMS_KEY;
|
||||
}
|
||||
|
||||
QString QgsWmsProvider::description() const
|
||||
{
|
||||
@ -4262,7 +4266,9 @@ QList<QgsDataItemProvider *> QgsWmsProviderMetadata::dataItemProviders() const
|
||||
return providers;
|
||||
}
|
||||
|
||||
#ifndef HAVE_STATIC_PROVIDERS
|
||||
QGISEXTERN QgsProviderMetadata *providerMetadataFactory()
|
||||
{
|
||||
return new QgsWmsProviderMetadata();
|
||||
}
|
||||
#endif
|
||||
|
@ -211,6 +211,7 @@ class QgsWmsProvider : public QgsRasterDataProvider
|
||||
QString lastError() override;
|
||||
QString lastErrorFormat() override;
|
||||
QString name() const override;
|
||||
static QString providerKey();
|
||||
QString description() const override;
|
||||
void reloadData() override;
|
||||
bool renderInPreview( const QgsDataProvider::PreviewContext &context ) override;
|
||||
|
@ -13,13 +13,14 @@
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
#include "qgswmsprovidergui.h"
|
||||
#include "qgswmsprovider.h"
|
||||
#include "qgswmssourceselect.h"
|
||||
#include "qgssourceselectprovider.h"
|
||||
#include "qgstilescalewidget.h"
|
||||
#include "qgsproviderguimetadata.h"
|
||||
#include "qgswmsdataitemguiproviders.h"
|
||||
|
||||
#include "qgswmsdataitems.h"
|
||||
|
||||
//! Provider for WMS layers source select
|
||||
class QgsWmsSourceSelectProvider : public QgsSourceSelectProvider
|
||||
@ -36,33 +37,33 @@ class QgsWmsSourceSelectProvider : public QgsSourceSelectProvider
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class QgsWmsProviderGuiMetadata: public QgsProviderGuiMetadata
|
||||
QgsWmsProviderGuiMetadata::QgsWmsProviderGuiMetadata()
|
||||
: QgsProviderGuiMetadata( QgsWmsProvider::WMS_KEY )
|
||||
{
|
||||
public:
|
||||
QgsWmsProviderGuiMetadata(): QgsProviderGuiMetadata( QgsWmsProvider::WMS_KEY ) {}
|
||||
QList<QgsSourceSelectProvider *> sourceSelectProviders() override
|
||||
{
|
||||
QList<QgsSourceSelectProvider *> providers;
|
||||
providers << new QgsWmsSourceSelectProvider;
|
||||
return providers;
|
||||
}
|
||||
}
|
||||
|
||||
QList<QgsDataItemGuiProvider *> dataItemGuiProviders() override
|
||||
{
|
||||
return QList<QgsDataItemGuiProvider *>()
|
||||
<< new QgsWmsDataItemGuiProvider
|
||||
<< new QgsXyzDataItemGuiProvider;
|
||||
}
|
||||
QList<QgsSourceSelectProvider *> QgsWmsProviderGuiMetadata::sourceSelectProviders()
|
||||
{
|
||||
QList<QgsSourceSelectProvider *> providers;
|
||||
providers << new QgsWmsSourceSelectProvider;
|
||||
return providers;
|
||||
}
|
||||
|
||||
void registerGui( QMainWindow *widget ) override
|
||||
{
|
||||
QgsTileScaleWidget::showTileScale( widget );
|
||||
}
|
||||
};
|
||||
QList<QgsDataItemGuiProvider *> QgsWmsProviderGuiMetadata::dataItemGuiProviders()
|
||||
{
|
||||
return QList<QgsDataItemGuiProvider *>()
|
||||
<< new QgsWmsDataItemGuiProvider
|
||||
<< new QgsXyzDataItemGuiProvider;
|
||||
}
|
||||
|
||||
void QgsWmsProviderGuiMetadata::registerGui( QMainWindow *widget )
|
||||
{
|
||||
QgsTileScaleWidget::showTileScale( widget );
|
||||
}
|
||||
|
||||
#ifndef HAVE_STATIC_PROVIDERS
|
||||
QGISEXTERN QgsProviderGuiMetadata *providerGuiMetadataFactory()
|
||||
{
|
||||
return new QgsWmsProviderGuiMetadata();
|
||||
}
|
||||
#endif
|
||||
|
35
src/providers/wms/qgswmsprovidergui.h
Normal file
35
src/providers/wms/qgswmsprovidergui.h
Normal file
@ -0,0 +1,35 @@
|
||||
/***************************************************************************
|
||||
qgswmsprovidergui.h
|
||||
--------------------------------------
|
||||
Date : September 2019
|
||||
Copyright : (C) 2019 by Peter Petrik
|
||||
Email : zilolv at gmail dot com
|
||||
***************************************************************************
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef QGSWMSPROVIDERGUI_H
|
||||
#define QGSWMSPROVIDERGUI_H
|
||||
|
||||
#include <QList>
|
||||
#include <QMainWindow>
|
||||
|
||||
#include "qgsproviderguimetadata.h"
|
||||
|
||||
class QgsWmsProviderGuiMetadata: public QgsProviderGuiMetadata
|
||||
{
|
||||
public:
|
||||
QgsWmsProviderGuiMetadata();
|
||||
QList<QgsSourceSelectProvider *> sourceSelectProviders() override;
|
||||
|
||||
QList<QgsDataItemGuiProvider *> dataItemGuiProviders() override;
|
||||
|
||||
void registerGui( QMainWindow *widget ) override;
|
||||
};
|
||||
|
||||
#endif // QGSWMSPROVIDERGUI_H
|
@ -71,8 +71,10 @@ SET_TARGET_PROPERTIES(qgis_wcsprovidertest PROPERTIES
|
||||
COMPILE_FLAGS "-DTEST_SERVER_URL=\\\"${TEST_SERVER_URL}\\\""
|
||||
)
|
||||
|
||||
ADD_QGIS_TEST(arcgisrestutilstest testqgsarcgisrestutils.cpp)
|
||||
TARGET_LINK_LIBRARIES(qgis_arcgisrestutilstest arcgisfeatureserverprovider_a)
|
||||
IF (NOT FORCE_STATIC_PROVIDERS)
|
||||
ADD_QGIS_TEST(arcgisrestutilstest testqgsarcgisrestutils.cpp)
|
||||
TARGET_LINK_LIBRARIES(qgis_arcgisrestutilstest arcgisfeatureserverprovider_a)
|
||||
ENDIF (NOT FORCE_STATIC_PROVIDERS)
|
||||
|
||||
IF(NOT MSVC)
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
|
||||
@ -80,23 +82,25 @@ ENDIF(NOT MSVC)
|
||||
|
||||
ADD_QGIS_TEST(wmscapabilitiestest
|
||||
testqgswmscapabilities.cpp)
|
||||
TARGET_LINK_LIBRARIES(qgis_wmscapabilitiestest wmsprovider_a)
|
||||
TARGET_LINK_LIBRARIES(qgis_wmscapabilitiestest wmsprovider_a qgis_core)
|
||||
|
||||
ADD_QGIS_TEST(wmsccapabilitiestest
|
||||
testqgswmsccapabilities.cpp)
|
||||
TARGET_LINK_LIBRARIES(qgis_wmsccapabilitiestest wmsprovider_a)
|
||||
TARGET_LINK_LIBRARIES(qgis_wmsccapabilitiestest wmsprovider_a qgis_core)
|
||||
|
||||
ADD_QGIS_TEST(wmsprovidertest
|
||||
testqgswmsprovider.cpp)
|
||||
TARGET_LINK_LIBRARIES(qgis_wmsprovidertest wmsprovider_a)
|
||||
TARGET_LINK_LIBRARIES(qgis_wmsprovidertest wmsprovider_a qgis_core)
|
||||
|
||||
ADD_QGIS_TEST(postgresprovidertest testqgspostgresprovider.cpp)
|
||||
TARGET_LINK_LIBRARIES(qgis_postgresprovidertest postgresprovider_a)
|
||||
IF (NOT FORCE_STATIC_PROVIDERS)
|
||||
ADD_QGIS_TEST(postgresprovidertest testqgspostgresprovider.cpp)
|
||||
TARGET_LINK_LIBRARIES(qgis_postgresprovidertest postgresprovider_a)
|
||||
|
||||
ADD_QGIS_TEST(postgresconntest testqgspostgresconn.cpp)
|
||||
TARGET_LINK_LIBRARIES(qgis_postgresconntest postgresprovider_a)
|
||||
ADD_QGIS_TEST(postgresconntest testqgspostgresconn.cpp)
|
||||
TARGET_LINK_LIBRARIES(qgis_postgresconntest postgresprovider_a)
|
||||
|
||||
ADD_QGIS_TEST(mdalprovidertest testqgsmdalprovider.cpp)
|
||||
ADD_QGIS_TEST(mdalprovidertest testqgsmdalprovider.cpp)
|
||||
ENDIF (NOT FORCE_STATIC_PROVIDERS)
|
||||
|
||||
#############################################################
|
||||
# WCS public servers test:
|
||||
|
Loading…
x
Reference in New Issue
Block a user