Skip to content
Permalink
Browse files

Small refactor of QgsPropertyOverrideButton

  • Loading branch information
nyalldawson committed Dec 2, 2017
1 parent 6b23e1f commit 618baf925dc9d18343ed78a92e5e67041d6a5529
@@ -53,6 +53,20 @@ class QgsPropertyOverrideButton: QToolButton
\param auxiliaryStorageEnabled If true, activate the button to store data defined in auxiliary storage
%End

void init( int propertyKey,
const QgsProperty &property,
const QgsPropertyDefinition &definition,
const QgsVectorLayer *layer = 0,
bool auxiliaryStorageEnabled = false );
%Docstring
Initialize a newly constructed property button (useful if button was included in a UI layout).
\param propertyKey key for corresponding property
\param property initial value of associated property to show in widget
\param definition properties definition for button
\param layer associated vector layer
\param auxiliaryStorageEnabled If true, activate the button to store data defined in auxiliary storage
%End

void init( int propertyKey,
const QgsAbstractPropertyCollection &collection,
const QgsPropertiesDefinition &definitions,
@@ -88,13 +88,18 @@ QgsPropertyOverrideButton::QgsPropertyOverrideButton( QWidget *parent,


void QgsPropertyOverrideButton::init( int propertyKey, const QgsProperty &property, const QgsPropertiesDefinition &definitions, const QgsVectorLayer *layer, bool auxiliaryStorageEnabled )
{
init( propertyKey, property, definitions.value( propertyKey ), layer, auxiliaryStorageEnabled );
}

void QgsPropertyOverrideButton::init( int propertyKey, const QgsProperty &property, const QgsPropertyDefinition &definition, const QgsVectorLayer *layer, bool auxiliaryStorageEnabled )
{
mVectorLayer = layer;
mAuxiliaryStorageEnabled = auxiliaryStorageEnabled;
setToProperty( property );
mPropertyKey = propertyKey;

mDefinition = definitions.value( propertyKey );
mDefinition = definition;
mDataTypes = mDefinition.dataType();

mInputDescription = mDefinition.helpText();
@@ -77,6 +77,20 @@ class GUI_EXPORT QgsPropertyOverrideButton: public QToolButton
const QgsVectorLayer *layer = nullptr,
bool auxiliaryStorageEnabled = false );

/**
* Initialize a newly constructed property button (useful if button was included in a UI layout).
* \param propertyKey key for corresponding property
* \param property initial value of associated property to show in widget
* \param definition properties definition for button
* \param layer associated vector layer
* \param auxiliaryStorageEnabled If true, activate the button to store data defined in auxiliary storage
*/
void init( int propertyKey,
const QgsProperty &property,
const QgsPropertyDefinition &definition,
const QgsVectorLayer *layer = nullptr,
bool auxiliaryStorageEnabled = false );

/**
* Initialize a newly constructed property button (useful if button was included in a UI layout).
* \param propertyKey key for corresponding property

0 comments on commit 618baf9

Please sign in to comment.
You can’t perform that action at this time.