Skip to content
Permalink
Browse files

Add tab order and enable help button

  • Loading branch information
DelazJ authored and m-kuhn committed Nov 11, 2017
1 parent 3b2228a commit e1f5348a9707bd2691b96d4d7ef16a95497f68ce
@@ -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 )
@@ -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" ) );
}
@@ -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
@@ -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>
@@ -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>

0 comments on commit e1f5348

Please sign in to comment.
You can’t perform that action at this time.