17#include "ui_qgsattributesforminitcode.h"
29 mInitCodeSourceComboBox->addItem( QString() );
30 mInitCodeSourceComboBox->addItem( tr(
"Load from External File" ) );
31 mInitCodeSourceComboBox->addItem( tr(
"Provide Code in this Dialog" ) );
32 mInitCodeSourceComboBox->addItem( tr(
"Load from the Environment" ) );
35 mInitFileWidget->setDefaultRoot( settings.
value( QStringLiteral(
"style/lastInitFilePathDir" ),
"." ).toString() );
36 mInitFileWidget->setDialogTitle( tr(
"Select Python File" ) );
37 mInitFileWidget->setFilter( tr(
"Python files (*.py *.PY)" ) );
39 connect( mInitCodeSourceComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsAttributesFormInitCode::mInitCodeSourceComboBox_currentIndexChanged );
40 connect( buttonBox, &QDialogButtonBox::helpRequested,
this, &QgsAttributesFormInitCode::showHelp );
45 mInitCodeSourceComboBox->setCurrentIndex( initCodeSource );
46 mInitCodeSourceComboBox_currentIndexChanged( mInitCodeSourceComboBox->currentIndex() );
59 mInitCodeEditorPython->setText(
initCode );
69 return mInitFunctionLineEdit->text();
73 return mInitFileWidget->filePath();
77 return mInitCodeEditorPython->text();
80void QgsAttributesFormInitCode::mInitCodeSourceComboBox_currentIndexChanged(
int codeSource )
88void QgsAttributesFormInitCode::showHelp()
90 QgsHelp::openHelp( QStringLiteral(
"working_with_vector/vector_properties.html#enhance-your-form-with-custom-functions" ) );
static void enableAutoGeometryRestore(QWidget *widget, const QString &key=QString())
Register the widget to allow its position to be automatically saved and restored when open and closed...
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.