mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-13 00:03:09 -04:00
Add QgsSourceSelectDialog python bindings
This commit is contained in:
parent
0ac8ce1497
commit
1f02d4a43d
@ -150,6 +150,7 @@
|
|||||||
%Include qgssearchquerybuilder.sip
|
%Include qgssearchquerybuilder.sip
|
||||||
%Include qgsshortcutsmanager.sip
|
%Include qgsshortcutsmanager.sip
|
||||||
%Include qgsslider.sip
|
%Include qgsslider.sip
|
||||||
|
%Include qgssourceselectdialog.sip
|
||||||
%Include qgssublayersdialog.sip
|
%Include qgssublayersdialog.sip
|
||||||
%Include qgssvgannotationitem.sip
|
%Include qgssvgannotationitem.sip
|
||||||
%Include qgstablewidgetitem.sip
|
%Include qgstablewidgetitem.sip
|
||||||
|
43
python/gui/qgssourceselectdialog.sip
Normal file
43
python/gui/qgssourceselectdialog.sip
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
/**
|
||||||
|
* Generic class listing layers available from a remote service.
|
||||||
|
*/
|
||||||
|
class QgsSourceSelectDialog : public QDialog //, protected Ui::QgsSourceSelectBase
|
||||||
|
{
|
||||||
|
%TypeHeaderCode
|
||||||
|
#include "qgssourceselectdialog.h"
|
||||||
|
%End
|
||||||
|
|
||||||
|
public:
|
||||||
|
/** Whether the dialog is for a map service or a feature service */
|
||||||
|
enum ServiceType { MapService, FeatureService };
|
||||||
|
|
||||||
|
/** Constructor */
|
||||||
|
QgsSourceSelectDialog( const QString& serviceName, ServiceType serviceType, QWidget* parent, Qt::WindowFlags fl );
|
||||||
|
/** Destructor */
|
||||||
|
~QgsSourceSelectDialog();
|
||||||
|
/** Sets the current extent and CRS. Used to select an appropriate CRS and possibly to retreive data only in the current extent */
|
||||||
|
void setCurrentExtentAndCrs( const QgsRectangle& canvasExtent, const QgsCoordinateReferenceSystem& canvasCrs );
|
||||||
|
|
||||||
|
signals:
|
||||||
|
/** Emitted when a layer is added from the dialog */
|
||||||
|
void addLayer( QString uri, QString typeName );
|
||||||
|
/** Emitted when the connections for the service were changed */
|
||||||
|
void connectionsChanged();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
/** To be implemented in the child class. Called when a new connection is initiated. */
|
||||||
|
virtual bool connectToService( const QgsOWSConnection& connection ) = 0;
|
||||||
|
/** May be implemented in child classes for services which support customized queries. */
|
||||||
|
virtual void buildQuery( const QgsOWSConnection&, const QModelIndex& );
|
||||||
|
/** To be implemented in the child class. Constructs an URI for the specified service layer. */
|
||||||
|
virtual QString getLayerURI( const QgsOWSConnection& connection,
|
||||||
|
const QString& layerTitle,
|
||||||
|
const QString& layerName,
|
||||||
|
const QString& crs = QString(),
|
||||||
|
const QString& filter = QString(),
|
||||||
|
const QgsRectangle& bBox = QgsRectangle() ) const = 0;
|
||||||
|
/** Updates the UI for the list of available image encodings from the specified list. */
|
||||||
|
void populateImageEncodings( const QStringList& availableEncodings );
|
||||||
|
/** Returns the selected image encoding. */
|
||||||
|
QString getSelectedImageEncoding() const;
|
||||||
|
};
|
@ -36,7 +36,8 @@
|
|||||||
#include <QRadioButton>
|
#include <QRadioButton>
|
||||||
#include <QImageReader>
|
#include <QImageReader>
|
||||||
|
|
||||||
/** Item delegate with tweaked sizeHint. */
|
/** Item delegate with tweaked sizeHint.
|
||||||
|
* @note not available in Python bindings */
|
||||||
class QgsSourceSelectItemDelegate : public QItemDelegate
|
class QgsSourceSelectItemDelegate : public QItemDelegate
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user