Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Initialize portrait / landscape in print dialog based on composition …
…width and height. Fixes bug #2080

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@12101 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Nov 13, 2009
1 parent 2dca1cb commit 534e1bc
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/app/composer/qgscomposer.cpp
Expand Up @@ -453,8 +453,20 @@ void QgsComposer::on_mActionExportAsPDF_triggered()
void QgsComposer::on_mActionPrint_triggered()
{
QPrinter printer;
//portrait or landscape
if ( mComposition )
{
if ( mComposition->paperWidth() >= mComposition->paperHeight() )
{
printer.setOrientation( QPrinter::Landscape );
}
else
{
printer.setOrientation( QPrinter::Portrait );
}
}
QPrintDialog printDialog( &printer, 0 );

QPrintDialog printDialog( &printer );
if ( printDialog.exec() != QDialog::Accepted )
return;

Expand Down

0 comments on commit 534e1bc

Please sign in to comment.