mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-15 00:04:00 -04:00
Small tweaks to property override button behavior
This commit is contained in:
parent
516bdfeed9
commit
3371003402
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user