@@ -57,7 +57,6 @@ QgsExpressionBuilderWidget::QgsExpressionBuilderWidget( QWidget *parent )
57
57
connect ( mValuesListView , &QListView::doubleClicked, this , &QgsExpressionBuilderWidget::mValuesListView_doubleClicked );
58
58
59
59
mValueGroupBox ->hide ();
60
- mLoadGroupBox ->hide ();
61
60
// highlighter = new QgsExpressionHighlighter( txtExpressionString->document() );
62
61
63
62
mModel = new QStandardItemModel ();
@@ -94,6 +93,19 @@ QgsExpressionBuilderWidget::QgsExpressionBuilderWidget( QWidget *parent )
94
93
95
94
editorSplit->setSizes ( QList<int >( {175 , 300 } ) );
96
95
96
+ functionsplit->setCollapsible ( 0 , false );
97
+ connect ( mShowHelpButton , &QPushButton::clicked, this , [ = ]()
98
+ {
99
+ functionsplit->setSizes ( QList<int >( {mOperationListGroup ->width () - mHelpAndValuesWidget ->minimumWidth (),
100
+ mHelpAndValuesWidget ->minimumWidth ()} ) );
101
+ mShowHelpButton ->setEnabled ( false );
102
+ } );
103
+ connect ( functionsplit, &QSplitter::splitterMoved, this , [ = ]( int , int )
104
+ {
105
+ mShowHelpButton ->setEnabled ( functionsplit->sizes ().at ( 1 ) == 0 );
106
+ } );
107
+
108
+
97
109
QgsSettings settings;
98
110
splitter->restoreState ( settings.value ( QStringLiteral ( " Windows/QgsExpressionBuilderWidget/splitter" ) ).toByteArray () );
99
111
editorSplit->restoreState ( settings.value ( QStringLiteral ( " Windows/QgsExpressionBuilderWidget/editorsplitter" ) ).toByteArray () );
@@ -228,8 +240,9 @@ void QgsExpressionBuilderWidget::currentChanged( const QModelIndex &index, const
228
240
mValuesModel ->setStringList ( values );
229
241
}
230
242
231
- mLoadGroupBox ->setVisible ( item->getItemType () == QgsExpressionItem::Field && mLayer );
232
- mValueGroupBox ->setVisible ( item->getItemType () == QgsExpressionItem::Field && mLayer );
243
+ bool isField = mLayer && item->getItemType () == QgsExpressionItem::Field;
244
+ mValueGroupBox ->setVisible ( isField );
245
+ mShowHelpButton ->setText ( isField ? tr ( " Show Values" ) : tr ( " Show Help" ) );
233
246
234
247
// Show the help for the current item.
235
248
QString help = loadFunctionHelp ( item );
@@ -1094,7 +1107,7 @@ void QgsExpressionBuilderWidget::indicatorClicked( int line, int index, Qt::Keyb
1094
1107
if ( state & Qt::ControlModifier )
1095
1108
{
1096
1109
int position = txtExpressionString->positionFromLineIndex ( line, index );
1097
- long fncIndex = txtExpressionString->SendScintilla ( QsciScintilla::SCI_INDICATORVALUEAT, FUNCTION_MARKER_ID, ( long int ) position );
1110
+ long fncIndex = txtExpressionString->SendScintilla ( QsciScintilla::SCI_INDICATORVALUEAT, FUNCTION_MARKER_ID, static_cast < long int >( position ) );
1098
1111
QgsExpressionFunction *func = QgsExpression::Functions ()[fncIndex];
1099
1112
QString help = getFunctionHelp ( func );
1100
1113
txtHelpText->setText ( help );
0 commit comments