set paper orientation in printer dialog from composition

git-svn-id: http://svn.osgeo.org/qgis/trunk@3045 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
rabla 2005-03-30 14:02:11 +00:00
parent 870da8403e
commit fe2b170ed0
3 changed files with 11 additions and 1 deletions

View File

@ -226,7 +226,12 @@ void QgsComposer::print(void)
mPrinter->setFullPage ( true );
mPrinter->setOutputToFile (true ) ;
mPrinter->setOutputFileName ( QDir::convertSeparators ( QDir::home().path() + "/" + "qgis.eps") );
mPrinter->setOrientation ( QPrinter::Landscape );
if ( mComposition->paperOrientation() == QgsComposition::Portrait ) {
mPrinter->setOrientation ( QPrinter::Portrait );
} else {
mPrinter->setOrientation ( QPrinter::Landscape );
}
mPrinter->setColorMode ( QPrinter::Color );
mPrinter->setPageSize ( QPrinter::A4 );
}

View File

@ -550,6 +550,8 @@ double QgsComposition::paperWidth ( void ) { return mPaperWidth; }
double QgsComposition::paperHeight ( void ) { return mPaperHeight; }
int QgsComposition::paperOrientation ( void ) { return mPaperOrientation; }
int QgsComposition::resolution ( void ) { return mResolution; }
int QgsComposition::scale( void ) {

View File

@ -104,6 +104,9 @@ public:
/** \brief Get paper height */
double paperHeight ( void );
/** \brief Get paper orientation */
int paperOrientation ( void );
/** \brief Get resolutin */
int resolution ( void );