17 #include "ui_qgsattributesforminitcode.h"
20 #include <QFileDialog>
27 mInitCodeSourceComboBox->addItem( QString() );
28 mInitCodeSourceComboBox->addItem( tr(
"Load from External File" ) );
29 mInitCodeSourceComboBox->addItem( tr(
"Provide Code in this Dialog" ) );
30 mInitCodeSourceComboBox->addItem( tr(
"Load from the Environment" ) );
33 mInitFileWidget->setDefaultRoot( settings.
value( QStringLiteral(
"style/lastInitFilePathDir" ),
"." ).toString() );
34 mInitFileWidget->setDialogTitle( tr(
"Select Python File" ) );
35 mInitFileWidget->setFilter( tr(
"Python files (*.py *.PY)" ) );
37 connect( mInitCodeSourceComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsAttributesFormInitCode::mInitCodeSourceComboBox_currentIndexChanged );
38 connect( buttonBox, &QDialogButtonBox::helpRequested,
this, &QgsAttributesFormInitCode::showHelp );
43 mInitCodeSourceComboBox->setCurrentIndex( initCodeSource );
44 mInitCodeSourceComboBox_currentIndexChanged( mInitCodeSourceComboBox->currentIndex() );
57 mInitCodeEditorPython->setText(
initCode );
67 return mInitFunctionLineEdit->text();
71 return mInitFileWidget->filePath();
75 return mInitCodeEditorPython->text();
78 void QgsAttributesFormInitCode::mInitCodeSourceComboBox_currentIndexChanged(
int codeSource )
86 void QgsAttributesFormInitCode::showHelp()
88 QgsHelp::openHelp( QStringLiteral(
"working_with_vector/vector_properties.html#enhance-your-form-with-custom-functions" ) );
static void openHelp(const QString &key)
Opens help topic for the given help key using default system web browser.
This class is a composition of two QSettings instances:
QVariant value(const QString &key, const QVariant &defaultValue=QVariant(), Section section=NoSection) const
Returns the value for setting key.