27
27
#include < QFileDialog>
28
28
#include < QMatrix>
29
29
#include < QMessageBox>
30
- #include < Q3PaintDeviceMetrics>
31
30
#include < QPainter>
32
31
#include < Q3Picture>
33
32
#include < QPrinter>
34
33
#include < QSettings>
35
34
#include < QIcon>
36
35
#include < QPixmap>
37
36
#include < QToolBar>
37
+ #include < QImageWriter>
38
38
#include < iostream>
39
39
40
40
@@ -454,11 +454,9 @@ void QgsComposer::on_mActionPrint_activated(void)
454
454
bool print = true ;
455
455
456
456
// Check size
457
- Q3PaintDeviceMetrics pm (mPrinter );
458
-
459
- std::cout << " Paper: " << pm.widthMM () << " x " << pm.heightMM () << std::endl;
460
- if ( mComposition ->paperWidth () != pm.widthMM () ||
461
- mComposition ->paperHeight () != pm.heightMM () )
457
+ std::cout << " Paper: " << mPrinter ->widthMM () << " x " << mPrinter ->heightMM () << std::endl;
458
+ if ( mComposition ->paperWidth () != mPrinter ->widthMM () ||
459
+ mComposition ->paperHeight () != mPrinter ->heightMM () )
462
460
{
463
461
int answer = QMessageBox::warning ( 0 , " Paper does not match" ,
464
462
" The selected paper size does not match the composition size" ,
@@ -531,9 +529,9 @@ void QgsComposer::on_mActionExportAsImage_activated(void)
531
529
int myCounterInt=0 ;
532
530
QString myFilters;
533
531
QString myLastUsedFilter;
534
- for ( ; myCounterInt < QPictureIO::outputFormats ().count (); myCounterInt++ )
532
+ for ( ; myCounterInt < QImageWriter::supportedImageFormats ().count (); myCounterInt++ )
535
533
{
536
- QString myFormat=QString (QPictureIO::outputFormats ().at ( myCounterInt ));
534
+ QString myFormat=QString (QImageWriter::supportedImageFormats ().at ( myCounterInt ));
537
535
QString myFilter = myFormat + " format (*." + myFormat.lower () + " *." + myFormat.upper () + " )" ;
538
536
if ( myCounterInt > 0 ) myFilters += " ;;" ;
539
537
myFilters += myFilter;
@@ -557,7 +555,7 @@ void QgsComposer::on_mActionExportAsImage_activated(void)
557
555
new QFileDialog (
558
556
this ,
559
557
tr (" Choose a filename to save the map image as" ),
560
- " " ,
558
+ " . " ,
561
559
myFilters
562
560
)
563
561
);
@@ -569,6 +567,9 @@ void QgsComposer::on_mActionExportAsImage_activated(void)
569
567
// set the filter to the last one used
570
568
myQFileDialog->selectFilter (myLastUsedFilter);
571
569
570
+ // set the 'Open' button to something that makes more sense
571
+ myQFileDialog->setLabelText (QFileDialog::Accept, tr (" Save" ));
572
+
572
573
// prompt the user for a filename
573
574
QString myOutputFileNameQString; // = myQFileDialog->getSaveFileName(); //delete this
574
575
0 commit comments