File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ class QgsFieldExpressionWidget : QWidget
63
63
//! when expression has been edited (finished) it will be added to the model
64
64
void expressionEditingFinished();
65
65
66
- void currentFieldChanged( int i = 0 );
66
+ void currentFieldChanged();
67
67
68
68
/**
69
69
* @brief updateLineEditStyle will re-style (color/font) the line edit depending on content and status
Original file line number Diff line number Diff line change @@ -195,6 +195,18 @@ void QgsFieldExpressionWidget::currentFieldChanged( int i /* =0 */ )
195
195
196
196
bool isExpression, isValid;
197
197
QString fieldName = currentField ( &isExpression, &isValid );
198
+
199
+ // display tooltip if widget is shorter than expression
200
+ QFontMetrics metrics ( mCombo ->lineEdit ()->font () );
201
+ if ( metrics.width ( fieldName ) > mCombo ->lineEdit ()->width () )
202
+ {
203
+ mCombo ->setToolTip ( fieldName );
204
+ }
205
+ else
206
+ {
207
+ mCombo ->setToolTip ( " " );
208
+ }
209
+
198
210
emit fieldChanged ( fieldName );
199
211
emit fieldChanged ( fieldName, isValid );
200
212
}
You can’t perform that action at this time.
0 commit comments