QGIS/python/gui/symbology-ng/qgssymbolselectordialog.sip

155 lines
4.3 KiB
Plaintext
Raw Normal View History

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-06 11:01:42 +02:00
QgsSymbolSelectorWidget( QgsSymbol* symbol, QgsStyle* 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 context in which the symbol widget is shown, e.g., the associated map canvas and expression contexts.
* @param context symbol widget context
* @see context()
2016-09-12 13:51:14 +10:00
* @note added in QGIS 3.0
*/
void setContext( const QgsSymbolWidgetContext& context );
2016-09-12 13:51:14 +10:00
/** Returns the context in which the symbol widget is shown, e.g., the associated map canvas and expression contexts.
* @see setContext()
* @note added in QGIS 3.0
2016-06-13 18:07:39 +10:00
*/
QgsSymbolWidgetContext context() const;
2016-06-13 18:07:39 +10:00
/**
* @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();
//! 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
{
%TypeHeaderCode
2016-08-05 08:09:43 +02:00
#include <qgssymbolselectordialog.h>
%End
public:
2016-08-06 11:01:42 +02:00
QgsSymbolSelectorDialog( QgsSymbol* symbol, QgsStyle* style, const QgsVectorLayer* vl, QWidget* parent /TransferThis/ = 0, bool embedded = false );
//! return menu for "advanced" button - create it if doesn't exist and show the advanced button
QMenu* advancedMenu();
/** Sets the context in which the symbol widget is shown, e.g., the associated map canvas and expression contexts.
* @param context symbol widget context
* @see context()
2016-09-12 13:51:14 +10:00
* @note added in QGIS 3.0
*/
void setContext( const QgsSymbolWidgetContext& context );
2016-09-12 13:51:14 +10:00
/** Returns the context in which the symbol widget is shown, e.g., the associated map canvas and expression contexts.
* @see setContext()
* @note added in QGIS 3.0
*/
QgsSymbolWidgetContext context() const;
2016-08-05 08:09:43 +02:00
QgsSymbol* symbol();
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 );
void updateUi();
void updateLockButton();
2014-01-27 09:22:24 +01:00
//! @note not available in python bindings
// SymbolLayerItem* currentLayerItem();
2016-08-05 08:08:39 +02:00
QgsSymbolLayer* currentLayer();
void moveLayerByOffset( int offset );
void setWidget( QWidget* widget );
signals:
void symbolModified();
public slots:
void moveLayerDown();
void moveLayerUp();
void addLayer();
void removeLayer();
void lockLayer();
//! 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 );
};