mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-14 00:07:35 -04:00
skip malformed key-values pairs
add options example in docs
This commit is contained in:
parent
d718eb0f18
commit
85d40937b9
@ -50,7 +50,8 @@ class QgsRasterFormatSaveOptionsWidget : QWidget
|
||||
QStringList options() const;
|
||||
|
||||
/**
|
||||
* Populate widget with user-defined options
|
||||
* Populate widget with user-defined options. String should contain
|
||||
* key=value pairs separated by spaces, e.g. "TILED=YES TFW=YES"
|
||||
* @see options()
|
||||
* @note added in QGIS 3.0
|
||||
*/
|
||||
|
@ -644,10 +644,13 @@ void QgsRasterFormatSaveOptionsWidget::setOptions( const QString& options )
|
||||
mOptionsTable->insertRow( rowCount );
|
||||
|
||||
values = opt.split( '=' );
|
||||
QTableWidgetItem* nameItem = new QTableWidgetItem( values.at( 0 ) );
|
||||
mOptionsTable->setItem( rowCount, 0, nameItem );
|
||||
QTableWidgetItem* valueItem = new QTableWidgetItem( values.at( 1 ) );
|
||||
mOptionsTable->setItem( rowCount, 0, valueItem );
|
||||
if ( values.count() == 2 )
|
||||
{
|
||||
QTableWidgetItem* nameItem = new QTableWidgetItem( values.at( 0 ) );
|
||||
mOptionsTable->setItem( rowCount, 0, nameItem );
|
||||
QTableWidgetItem* valueItem = new QTableWidgetItem( values.at( 1 ) );
|
||||
mOptionsTable->setItem( rowCount, 0, valueItem );
|
||||
}
|
||||
}
|
||||
|
||||
mOptionsMap[ currentProfileKey()] = options.trimmed();
|
||||
|
@ -76,7 +76,8 @@ class GUI_EXPORT QgsRasterFormatSaveOptionsWidget: public QWidget,
|
||||
QStringList options() const;
|
||||
|
||||
/**
|
||||
* Populate widget with user-defined options
|
||||
* Populate widget with user-defined options. String should contain
|
||||
* key=value pairs separated by spaces, e.g. "TILED=YES TFW=YES"
|
||||
* @see options()
|
||||
* @note added in QGIS 3.0
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user