2016-08-05 08:09:43 +02:00
|
|
|
class QgsSymbolSelectorWidget : QgsPanelWidget
|
2016-06-13 18:07:39 +10:00
|
|
|
{
|
|
|
|
%TypeHeaderCode
|
2016-08-05 08:09:43 +02:00
|
|
|
#include <qgssymbolselectordialog.h>
|
2016-06-13 18:07:39 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
public:
|
2016-08-05 08:09:43 +02:00
|
|
|
QgsSymbolSelectorWidget( QgsSymbol* symbol, QgsStyleV2* style, const QgsVectorLayer* vl, QWidget* parent /TransferThis/ = 0);
|
2016-06-13 18:07:39 +10:00
|
|
|
|
|
|
|
//! return menu for "advanced" button - create it if doesn't exist and show the advanced button
|
|
|
|
QMenu* advancedMenu();
|
|
|
|
|
|
|
|
/** Sets the optional expression context used for the widget. This expression context is used for
|
|
|
|
* evaluating data defined symbol properties and for populating based expression widgets in
|
|
|
|
* the layer widget.
|
|
|
|
* @param context expression context pointer. Ownership is transferred to the dialog.
|
|
|
|
* @note added in QGIS 2.12
|
|
|
|
* @see expressionContext()
|
|
|
|
*/
|
|
|
|
void setExpressionContext( QgsExpressionContext* context /Transfer/ );
|
|
|
|
|
|
|
|
/** Returns the expression context used for the dialog, if set. This expression context is used for
|
|
|
|
* evaluating data defined symbol properties and for populating based expression widgets in
|
|
|
|
* the dialog.
|
|
|
|
* @note added in QGIS 2.12
|
|
|
|
* @see setExpressionContext()
|
|
|
|
*/
|
|
|
|
QgsExpressionContext* expressionContext() const;
|
|
|
|
|
|
|
|
/** Sets the map canvas associated with the dialog. This allows the widget to retrieve the current
|
|
|
|
* map scale and other properties from the canvas.
|
|
|
|
* @param canvas map canvas
|
|
|
|
* @note added in QGIS 2.12
|
|
|
|
*/
|
|
|
|
void setMapCanvas( QgsMapCanvas* canvas );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Return the symbol that is currently active in the widget. Can be null.
|
|
|
|
* @return The active symbol.
|
|
|
|
*/
|
2016-08-05 08:09:43 +02:00
|
|
|
QgsSymbol* symbol();
|
2016-06-13 18:07:39 +10:00
|
|
|
|
|
|
|
protected:
|
|
|
|
//! Reimplements dialog keyPress event so we can ignore it
|
|
|
|
void keyPressEvent( QKeyEvent * event );
|
|
|
|
|
|
|
|
void loadSymbol();
|
|
|
|
//! @note not available in python bindings
|
2016-08-05 08:09:43 +02:00
|
|
|
// void loadSymbol( QgsSymbol* symbol, SymbolLayerItem* parent );
|
2016-06-13 18:07:39 +10:00
|
|
|
|
|
|
|
void updateUi();
|
|
|
|
|
|
|
|
void updateLockButton();
|
|
|
|
|
|
|
|
//! @note not available in python bindings
|
|
|
|
// SymbolLayerItem* currentLayerItem();
|
2016-08-05 08:08:39 +02:00
|
|
|
QgsSymbolLayer* currentLayer();
|
2016-06-13 18:07:39 +10:00
|
|
|
|
|
|
|
void moveLayerByOffset( int offset );
|
|
|
|
|
|
|
|
void setWidget( QWidget* widget );
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void symbolModified();
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
void moveLayerDown();
|
|
|
|
void moveLayerUp();
|
|
|
|
|
|
|
|
void addLayer();
|
|
|
|
void removeLayer();
|
|
|
|
|
|
|
|
void lockLayer();
|
|
|
|
|
|
|
|
void saveSymbol() /Deprecated/;
|
|
|
|
|
|
|
|
//! Duplicates the current symbol layer and places the duplicated layer above the current symbol layer
|
|
|
|
//! @note added in QGIS 2.14
|
|
|
|
void duplicateLayer();
|
|
|
|
|
|
|
|
void layerChanged();
|
|
|
|
|
|
|
|
void updateLayerPreview();
|
|
|
|
void updatePreview();
|
|
|
|
|
|
|
|
//! Slot to update tree when a new symbol from style
|
|
|
|
void symbolChanged();
|
|
|
|
//! alters tree and sets proper widget when Layer Type is changed
|
|
|
|
//! @note: The layer is received from the LayerPropertiesWidget
|
2016-08-05 08:08:39 +02:00
|
|
|
void changeLayer( QgsSymbolLayer* layer );
|
2016-06-13 18:07:39 +10:00
|
|
|
};
|
|
|
|
|
2016-08-05 08:09:43 +02:00
|
|
|
class QgsSymbolSelectorDialog : QDialog
|
2012-09-24 02:28:15 +02:00
|
|
|
{
|
|
|
|
%TypeHeaderCode
|
2016-08-05 08:09:43 +02:00
|
|
|
#include <qgssymbolselectordialog.h>
|
2012-09-24 02:28:15 +02:00
|
|
|
%End
|
|
|
|
|
|
|
|
public:
|
2016-08-05 08:09:43 +02:00
|
|
|
QgsSymbolSelectorDialog( QgsSymbol* symbol, QgsStyleV2* style, const QgsVectorLayer* vl, QWidget* parent /TransferThis/ = 0, bool embedded = false );
|
2012-09-24 02:28:15 +02:00
|
|
|
|
|
|
|
//! return menu for "advanced" button - create it if doesn't exist and show the advanced button
|
|
|
|
QMenu* advancedMenu();
|
|
|
|
|
2015-09-03 22:46:37 +10:00
|
|
|
/** Sets the optional expression context used for the widget. This expression context is used for
|
|
|
|
* evaluating data defined symbol properties and for populating based expression widgets in
|
|
|
|
* the layer widget.
|
|
|
|
* @param context expression context pointer. Ownership is transferred to the dialog.
|
|
|
|
* @note added in QGIS 2.12
|
|
|
|
* @see expressionContext()
|
|
|
|
*/
|
|
|
|
void setExpressionContext( QgsExpressionContext* context /Transfer/ );
|
|
|
|
|
|
|
|
/** Returns the expression context used for the dialog, if set. This expression context is used for
|
|
|
|
* evaluating data defined symbol properties and for populating based expression widgets in
|
|
|
|
* the dialog.
|
|
|
|
* @note added in QGIS 2.12
|
|
|
|
* @see setExpressionContext()
|
|
|
|
*/
|
|
|
|
QgsExpressionContext* expressionContext() const;
|
|
|
|
|
2015-09-16 21:55:32 +10:00
|
|
|
/** Sets the map canvas associated with the dialog. This allows the widget to retrieve the current
|
|
|
|
* map scale and other properties from the canvas.
|
|
|
|
* @param canvas map canvas
|
|
|
|
* @note added in QGIS 2.12
|
|
|
|
*/
|
|
|
|
void setMapCanvas( QgsMapCanvas* canvas );
|
|
|
|
|
2016-08-05 08:09:43 +02:00
|
|
|
QgsSymbol* symbol();
|
2012-09-24 02:28:15 +02:00
|
|
|
protected:
|
|
|
|
//! Reimplements dialog keyPress event so we can ignore it
|
|
|
|
void keyPressEvent( QKeyEvent * event );
|
|
|
|
|
|
|
|
void loadSymbol();
|
2014-01-27 09:22:24 +01:00
|
|
|
//! @note not available in python bindings
|
2016-08-05 08:09:43 +02:00
|
|
|
// void loadSymbol( QgsSymbol* symbol, SymbolLayerItem* parent );
|
2012-09-24 02:28:15 +02:00
|
|
|
|
|
|
|
void updateUi();
|
|
|
|
|
|
|
|
void updateLockButton();
|
|
|
|
|
2014-01-27 09:22:24 +01:00
|
|
|
//! @note not available in python bindings
|
2012-09-24 02:28:15 +02:00
|
|
|
// SymbolLayerItem* currentLayerItem();
|
2016-08-05 08:08:39 +02:00
|
|
|
QgsSymbolLayer* currentLayer();
|
2012-09-24 02:28:15 +02:00
|
|
|
|
|
|
|
void moveLayerByOffset( int offset );
|
|
|
|
|
|
|
|
void setWidget( QWidget* widget );
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void symbolModified();
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
void moveLayerDown();
|
|
|
|
void moveLayerUp();
|
|
|
|
|
|
|
|
void addLayer();
|
|
|
|
void removeLayer();
|
|
|
|
|
|
|
|
void lockLayer();
|
|
|
|
|
2016-01-07 11:21:32 +07:00
|
|
|
void saveSymbol() /Deprecated/;
|
|
|
|
|
2016-01-06 16:04:14 +11:00
|
|
|
//! Duplicates the current symbol layer and places the duplicated layer above the current symbol layer
|
|
|
|
//! @note added in QGIS 2.14
|
|
|
|
void duplicateLayer();
|
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
void layerChanged();
|
|
|
|
|
|
|
|
void updateLayerPreview();
|
|
|
|
void updatePreview();
|
|
|
|
|
|
|
|
//! Slot to update tree when a new symbol from style
|
|
|
|
void symbolChanged();
|
|
|
|
//! alters tree and sets proper widget when Layer Type is changed
|
|
|
|
//! @note: The layer is received from the LayerPropertiesWidget
|
2016-08-05 08:08:39 +02:00
|
|
|
void changeLayer( QgsSymbolLayer* layer );
|
2012-09-24 02:28:15 +02:00
|
|
|
|
|
|
|
|
|
|
|
};
|