Skip to content

Commit

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

git-svn-id: http://svn.osgeo.org/qgis/trunk@12101 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Nov 13, 2009
1 parent 1a90d51 commit 878e9c8
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 878e9c8

Please sign in to comment.