File tree Expand file tree Collapse file tree 3 files changed +11
-7
lines changed Expand file tree Collapse file tree 3 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ void QgsPropertyAssistantWidget::registerExpressionContextGenerator( QgsExpressi
82
82
83
83
void QgsPropertyAssistantWidget::updateProperty ( QgsProperty& property )
84
84
{
85
- property.setActive ( true );
85
+ property.setActive ( ! mExpressionWidget -> currentText (). isEmpty () );
86
86
if ( mExpressionWidget ->isExpression () )
87
87
property.setExpressionString ( mExpressionWidget ->currentField () );
88
88
else
Original file line number Diff line number Diff line change @@ -449,18 +449,14 @@ void QgsPropertyOverrideButton::menuActionTriggered( QAction* action )
449
449
mExpressionString = exprString;
450
450
mProperty .setExpressionString ( mExpressionString );
451
451
mProperty .setTransformer ( nullptr );
452
- setActivePrivate ( mProperty . isActive () );
452
+ setActivePrivate ( true );
453
453
updateGui ();
454
454
emit changed ();
455
455
}
456
456
}
457
457
else if ( action == mActionClearExpr )
458
458
{
459
- // only deactivate if defined expression is being used
460
- if ( mProperty .isActive () && mProperty .propertyType () == QgsProperty::ExpressionBasedProperty )
461
- {
462
- setActivePrivate ( false );
463
- }
459
+ setActivePrivate ( false );
464
460
mProperty .setStaticValue ( QVariant () );
465
461
mProperty .setTransformer ( nullptr );
466
462
mExpressionString .clear ();
@@ -528,6 +524,13 @@ void QgsPropertyOverrideButton::showExpressionDialog()
528
524
529
525
void QgsPropertyOverrideButton::showAssistant ()
530
526
{
527
+ // first step - try to convert any existing expression to a transformer if one doesn't
528
+ // already exist
529
+ if ( !mProperty .transformer () )
530
+ {
531
+ ( void )mProperty .convertToTransformer ();
532
+ }
533
+
531
534
QgsPanelWidget* panel = QgsPanelWidget::findParentPanel ( this );
532
535
if ( panel && panel->dockMode () )
533
536
{
Original file line number Diff line number Diff line change 22
22
#include < QStandardItemModel>
23
23
#include < QItemDelegate>
24
24
#include " qgis_gui.h"
25
+ #include " qgsproperty.h"
25
26
26
27
class QgsVectorLayer ;
27
28
class QgsSymbol ;
You can’t perform that action at this time.
0 commit comments