Skip to content

Commit

Permalink
Add tab order and enable help button
Browse files Browse the repository at this point in the history
  • Loading branch information
DelazJ authored and m-kuhn committed Nov 13, 2017
1 parent 3b2228a commit e1f5348
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/app/qgsattributesforminitcode.cpp
Expand Up @@ -35,6 +35,7 @@ QgsAttributesFormInitCode::QgsAttributesFormInitCode()
mInitFileWidget->setFilter( tr( "Python files (*.py *.PY)" ) );

connect( mInitCodeSourceComboBox, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, &QgsAttributesFormInitCode::mInitCodeSourceComboBox_currentIndexChanged );
connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsAttributesFormInitCode::showHelp );
}

void QgsAttributesFormInitCode::setCodeSource( QgsEditFormConfig::PythonInitCodeSource initCodeSource )
Expand Down Expand Up @@ -81,3 +82,8 @@ void QgsAttributesFormInitCode::mInitCodeSourceComboBox_currentIndexChanged( int
mInitFileWidget->setVisible( codeSource == QgsEditFormConfig::CodeSourceFile );
mInitCodeEditorPython->setVisible( codeSource == QgsEditFormConfig::CodeSourceDialog );
}

void QgsAttributesFormInitCode::showHelp()
{
QgsHelp::openHelp( QStringLiteral( "working_with_vector/vector_properties.html#enhance-your-form-with-custom-functions" ) );
}
1 change: 1 addition & 0 deletions src/app/qgsattributesforminitcode.h
Expand Up @@ -49,6 +49,7 @@ class APP_EXPORT QgsAttributesFormInitCode: public QDialog, private Ui::QgsAttri

private slots:
void mInitCodeSourceComboBox_currentIndexChanged( int codeSource );
void showHelp();
};

#endif // QGSATTRIBUTESFORMINITCODE_H
6 changes: 5 additions & 1 deletion src/ui/qgsattributesforminitcode.ui
Expand Up @@ -101,7 +101,7 @@ Reference in function name: my_form_open
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Help|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
Expand Down Expand Up @@ -143,6 +143,10 @@ Reference in function name: my_form_open
<header>qgsfilewidget.h</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>mInitCodeSourceComboBox</tabstop>
<tabstop>mInitFunctionLineEdit</tabstop>
</tabstops>
<resources/>
<connections>
<connection>
Expand Down

0 comments on commit e1f5348

Please sign in to comment.