mirror of
				https://github.com/qgis/QGIS.git
				synced 2025-11-04 00:04:25 -05:00 
			
		
		
		
	enabled passing a map canvas to a provider source widget
This commit is contained in:
		
							parent
							
								
									b44a62863e
								
							
						
					
					
						commit
						4a1f27428d
					
				@ -8,6 +8,7 @@
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class QgsProviderSourceWidget : QWidget
 | 
			
		||||
{
 | 
			
		||||
%Docstring(signature="appended")
 | 
			
		||||
@ -38,6 +39,18 @@ Sets the source ``uri`` to show in the widget.
 | 
			
		||||
Returns the source URI as currently defined by the widget.
 | 
			
		||||
 | 
			
		||||
.. seealso:: :py:func:`setSourceUri`
 | 
			
		||||
%End
 | 
			
		||||
 | 
			
		||||
    void setMapCanvas( QgsMapCanvas *canvas );
 | 
			
		||||
%Docstring
 | 
			
		||||
Sets a map ``canvas`` associated with the widget.
 | 
			
		||||
 | 
			
		||||
.. versionadded:: 3.24
 | 
			
		||||
%End
 | 
			
		||||
 | 
			
		||||
    QgsMapCanvas *mapCanvas();
 | 
			
		||||
%Docstring
 | 
			
		||||
Returns a map canvas associated with the widget.
 | 
			
		||||
%End
 | 
			
		||||
 | 
			
		||||
  signals:
 | 
			
		||||
 | 
			
		||||
@ -23,3 +23,13 @@ QgsProviderSourceWidget::QgsProviderSourceWidget( QWidget *parent )
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void QgsProviderSourceWidget::setMapCanvas( QgsMapCanvas *canvas )
 | 
			
		||||
{
 | 
			
		||||
  mMapCanvas = canvas;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
QgsMapCanvas *QgsProviderSourceWidget::mapCanvas()
 | 
			
		||||
{
 | 
			
		||||
  return mMapCanvas;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -21,6 +21,8 @@
 | 
			
		||||
#include "qgis_gui.h"
 | 
			
		||||
#include "qgis_sip.h"
 | 
			
		||||
 | 
			
		||||
class QgsMapCanvas;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Base class for widgets which allow customization of a provider's source URI.
 | 
			
		||||
 *
 | 
			
		||||
@ -52,6 +54,18 @@ class GUI_EXPORT QgsProviderSourceWidget : public QWidget
 | 
			
		||||
     */
 | 
			
		||||
    virtual QString sourceUri() const = 0;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Sets a map \a canvas associated with the widget.
 | 
			
		||||
     *
 | 
			
		||||
     * \since QGIS 3.24
 | 
			
		||||
     */
 | 
			
		||||
    void setMapCanvas( QgsMapCanvas *canvas );
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Returns a map canvas associated with the widget.
 | 
			
		||||
     */
 | 
			
		||||
    QgsMapCanvas *mapCanvas();
 | 
			
		||||
 | 
			
		||||
  signals:
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
@ -62,5 +76,8 @@ class GUI_EXPORT QgsProviderSourceWidget : public QWidget
 | 
			
		||||
     */
 | 
			
		||||
    void validChanged( bool isValid );
 | 
			
		||||
 | 
			
		||||
  private:
 | 
			
		||||
    QgsMapCanvas *mMapCanvas = nullptr;
 | 
			
		||||
 | 
			
		||||
};
 | 
			
		||||
#endif //QGSPROVIDERSOURCEWIDGET_H
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user