-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Style Dock] Add interface for plugins to add panels to dock
- Loading branch information
Showing
13 changed files
with
376 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
/** \ingroup gui | ||
* \class A panel widget that can be shown in the map style dock | ||
* \note added in QGIS 2.16 | ||
*/ | ||
class QgsMapStylePanel : public QWidget | ||
{ | ||
%TypeHeaderCode | ||
#include <qgsmapstylepanel.h> | ||
%End | ||
public: | ||
/** | ||
* @brief A panel widget that can be shown in the map style dock | ||
* @param layer The layer active in the dock. | ||
* @param canvas The canvas object. | ||
* @param parent The parent of the widget. | ||
* @note The widget is created each time the panel is selected in the dock. | ||
* Keep the loading light as possible for speed in the UI. | ||
*/ | ||
QgsMapStylePanel(QgsMapLayer* layer, QgsMapCanvas *canvas, QWidget *parent = 0); | ||
|
||
signals: | ||
/** | ||
* @brief Nofity the map style dock that something has changed and | ||
* we need to update the map. | ||
* You should emit this when any of the widgets are changed if live | ||
* update is enabled apply() will get called to apply the changes to the layer. | ||
*/ | ||
void widgetChanged(); | ||
|
||
public slots: | ||
|
||
/** | ||
* @brief Called when changes to the layer need to be made. | ||
* Will be called when live update is enabled. | ||
*/ | ||
virtual void apply() = 0; | ||
}; | ||
|
||
|
||
/** \ingroup gui | ||
* \class QgsMapStylePanelFactory | ||
* \note added in QGIS 2.16 | ||
*/ | ||
class QgsMapStylePanelFactory | ||
{ | ||
%TypeHeaderCode | ||
#include <qgsmapstylepanel.h> | ||
%End | ||
public: | ||
/** Constructor */ | ||
QgsMapStylePanelFactory(); | ||
|
||
/** Destructor */ | ||
virtual ~QgsMapStylePanelFactory(); | ||
|
||
/** | ||
* @brief The icon that will be shown in the UI for the panel. | ||
* @return A QIcon for the panel icon. | ||
*/ | ||
virtual QIcon icon() = 0; | ||
|
||
/** | ||
* @brief The title of the panel.. | ||
* @note This may or may not be shown to the user. | ||
* @return Title of the panel | ||
*/ | ||
virtual QString title() = 0; | ||
|
||
/** | ||
* @brief Supported layer type for the widget. | ||
* @return The layer type this widget is supported for. | ||
*/ | ||
virtual QgsMapLayer::LayerType layerType() = 0; | ||
|
||
/** | ||
* @brief Factory fucntion to create the widget on demand as needed by the dock. | ||
* @note This function is called each time the panel is selected. Keep it light for better UX. | ||
* @param layer The active layer in the dock. | ||
* @param canvas The map canvas. | ||
* @param parent The parent of the widget. | ||
* @return A new QgsMapStylePanel which is shown in the map style dock. | ||
*/ | ||
virtual QgsMapStylePanel* createPanel( QgsMapLayer* layer, QgsMapCanvas *canvas, QWidget* parent /TransferThis/ ) = 0 /Factory/; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.