Skip to content
Permalink
Browse files

Small tweaks to property override button behavior

  • Loading branch information
nyalldawson committed Feb 14, 2017
1 parent 516bdfe commit 3371003402df95d35bed4d7748dce55c3de139e0
@@ -82,7 +82,7 @@ void QgsPropertyAssistantWidget::registerExpressionContextGenerator( QgsExpressi

void QgsPropertyAssistantWidget::updateProperty( QgsProperty& property )
{
property.setActive( true );
property.setActive( !mExpressionWidget->currentText().isEmpty() );
if ( mExpressionWidget->isExpression() )
property.setExpressionString( mExpressionWidget->currentField() );
else
@@ -449,18 +449,14 @@ void QgsPropertyOverrideButton::menuActionTriggered( QAction* action )
mExpressionString = exprString;
mProperty.setExpressionString( mExpressionString );
mProperty.setTransformer( nullptr );
setActivePrivate( mProperty.isActive() );
setActivePrivate( true );
updateGui();
emit changed();
}
}
else if ( action == mActionClearExpr )
{
// only deactivate if defined expression is being used
if ( mProperty.isActive() && mProperty.propertyType() == QgsProperty::ExpressionBasedProperty )
{
setActivePrivate( false );
}
setActivePrivate( false );
mProperty.setStaticValue( QVariant() );
mProperty.setTransformer( nullptr );
mExpressionString.clear();
@@ -528,6 +524,13 @@ void QgsPropertyOverrideButton::showExpressionDialog()

void QgsPropertyOverrideButton::showAssistant()
{
//first step - try to convert any existing expression to a transformer if one doesn't
//already exist
if ( !mProperty.transformer() )
{
( void )mProperty.convertToTransformer();
}

QgsPanelWidget* panel = QgsPanelWidget::findParentPanel( this );
if ( panel && panel->dockMode() )
{
@@ -22,6 +22,7 @@
#include <QStandardItemModel>
#include <QItemDelegate>
#include "qgis_gui.h"
#include "qgsproperty.h"

class QgsVectorLayer;
class QgsSymbol;

0 comments on commit 3371003

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