Skip to content
Permalink
Browse files

Expose world file option in image settings dialog

  • Loading branch information
nyalldawson committed Dec 11, 2017
1 parent 953d2c4 commit 0f9aaf4c44b567ab68ffa202448c7f2bb86d27f9
@@ -1456,6 +1456,7 @@ void QgsLayoutDesignerDialog::exportToRaster()
imageDlg.setResolution( dpi );
imageDlg.setCropToContents( cropToContents );
imageDlg.setCropMargins( marginTop, marginRight, marginBottom, marginLeft );
imageDlg.setGenerateWorldFile( mLayout->customProperty( QStringLiteral( "exportWorldFile" ), false ).toBool() );

#if 0 //TODO
QgsAtlasComposition *atlasMap = &mComposition->atlasComposition();
@@ -1505,7 +1506,7 @@ void QgsLayoutDesignerDialog::exportToRaster()
{
settings.imageSize = QSize( imageDlg.imageWidth(), imageDlg.imageHeight() );
}
settings.generateWorldFile = mLayout->customProperty( QStringLiteral( "exportWorldFile" ), false ).toBool();
settings.generateWorldFile = imageDlg.generateWorldFile();

switch ( exporter.exportToImage( fileNExt.first, settings ) )
{
@@ -95,6 +95,16 @@ bool QgsLayoutImageExportOptionsDialog::cropToContents() const
return mClipToContentGroupBox->isChecked();
}

void QgsLayoutImageExportOptionsDialog::setGenerateWorldFile( bool generate )
{
mGenerateWorldFile->setChecked( generate );
}

bool QgsLayoutImageExportOptionsDialog::generateWorldFile() const
{
return mGenerateWorldFile->isChecked();
}

void QgsLayoutImageExportOptionsDialog::getCropMargins( int &topMargin, int &rightMargin, int &bottomMargin, int &leftMargin ) const
{
topMargin = mTopMarginSpinBox->value();
@@ -84,6 +84,18 @@ class QgsLayoutImageExportOptionsDialog: public QDialog, private Ui::QgsLayoutIm
*/
bool cropToContents() const;

/**
* Sets whether the generate world file option should be checked.
* \see generateWorldFile()
*/
void setGenerateWorldFile( bool generate );

/**
* Returns whether the generate world file option is checked in the dialog.
* \see setGenerateWorldFile()
*/
bool generateWorldFile() const;

/**
* Fetches the current crop to contents margin values, in pixels.
* \param topMargin destination for top margin
@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>533</width>
<height>651</height>
<height>394</height>
</rect>
</property>
<property name="windowTitle">
@@ -234,6 +234,16 @@
</layout>
</widget>
</item>
<item>
<widget class="QCheckBox" name="mGenerateWorldFile">
<property name="toolTip">
<string>If checked, a separate world file which georeferences exported images will be created</string>
</property>
<property name="text">
<string>Generate world file</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">

0 comments on commit 0f9aaf4

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