Skip to content
Permalink
Browse files
Merge remote branch 'origin/master' into wcs2
  • Loading branch information
blazek committed Jul 12, 2012
2 parents c840ce1 + b70a0c6 commit 37ab9516cb775699d87acb87b6c684197525fe4f
Show file tree
Hide file tree
Showing 71 changed files with 9,345 additions and 5,846 deletions.
@@ -44,3 +44,4 @@ Alessandro Furieri <a.furieri at lqt.it>
Alexander Bruy <alexander.bruy@gmail.com>
Marco Bernasocchi <marco at bernawebdesign dot ch>
Nathan Woodrow <woodrow.nathan at gmail.com>
Etienne Tourigny <etourigny.dev at gmail.com>

Large diffs are not rendered by default.

BIN +225 Bytes (100%) doc/qgis-download-stats.ods
Binary file not shown.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

@@ -6,4 +6,4 @@ call "%OSGEO4W_ROOT%"\apps\grass\grass-@grassversion@\etc\env.bat
@echo off
path %PATH%;%OSGEO4W_ROOT%\apps\@package@\bin;%OSGEO4W_ROOT%\apps\grass\grass-@grassversion@\lib
set QGIS_PREFIX_PATH=%OSGEO4W_ROOT:\=/%/apps/@package@
start "Quantum GIS Browser" /B "%OSGEO4W_ROOT%"\@package@-browser.exe %*
start "Quantum GIS Browser" /B "%OSGEO4W_ROOT%"\bin\@package@-browser.exe %*
@@ -100,3 +100,5 @@
%Include qgsgpsdconnection.sip
%Include qgsnmeaconnection.sip
%Include qgsgpsdetector.sip

%Include qgspaintenginehack.sip
@@ -36,7 +36,8 @@ class QgsComposerMap : QgsComposerItem
enum GridAnnotationPosition
{
InsideMapFrame = 0,
OutsideMapFrame
OutsideMapFrame,
Disabled
};

enum GridAnnotationDirection
@@ -47,6 +48,21 @@ class QgsComposerMap : QgsComposerItem
BoundaryDirection
};

/**Enum for different frame borders*/
enum Border
{
Left,
Right,
Bottom,
Top
};

enum GridFrameStyle
{
NoGridFrame = 0,
Zebra //black / white pattern
};

/**@deprecated*/
void draw( QPainter *painter, const QgsRectangle& extent, const QSize& size, int dpi );

@@ -195,20 +211,32 @@ class QgsComposerMap : QgsComposerItem
void setShowGridAnnotation( bool show );
bool showGridAnnotation() const;

/**Sets position of grid annotations. Possibilities are inside or outside of the map frame
@note this function was added in version 1.4*/
void setGridAnnotationPosition( GridAnnotationPosition p );
GridAnnotationPosition gridAnnotationPosition() const;
/**Sets position of grid annotations. Possibilities are inside / outside of the map frame or disabled
@note this function was added in version 1.9*/
void setGridAnnotationPosition( GridAnnotationPosition p, QgsComposerMap::Border border );
/**@note: this function was added in version 1.9*/
GridAnnotationPosition gridAnnotationPosition( QgsComposerMap::Border border ) const;

/**Sets distance between map frame and annotations
@note this function was added in version 1.4*/
void setAnnotationFrameDistance( double d );
double annotationFrameDistance() const;

/**Sets grid annotation direction. Can be horizontal, vertical, direction of axis and horizontal and vertical
@note this function was added in version 1.4*/
void setGridAnnotationDirection( GridAnnotationDirection d );
GridAnnotationDirection gridAnnotationDirection() const;
/**Sets grid annotation direction. Can be horizontal or vertical
@note this function was added in version 1.9*/
void setGridAnnotationDirection( GridAnnotationDirection d, QgsComposerMap::Border border );
/**@note: this function was added in version 1.9*/
GridAnnotationDirection gridAnnotationDirection( QgsComposerMap::Border border ) const;

/**Set grid frame style (NoGridFrame or Zebra)
@note: this function was added in version 1.9*/
void setGridFrameStyle( GridFrameStyle style );
GridFrameStyle gridFrameStyle() const;

/**Set grid frame width
@note: this function was added in version 1.9*/
void setGridFrameWidth( double w );
double gridFrameWidth() const;

/**In case of annotations, the bounding rectangle can be larger than the map item rectangle
@note this function was added in version 1.4*/
@@ -226,6 +254,13 @@ class QgsComposerMap : QgsComposerItem

void updateItem();

/**Sets overview frame map. -1 disables the overview frame
@note: this function was added in version 1.9*/
void setOverviewFrameMap( int mapId );
/**Returns id of overview frame (or -1 if no overfiew frame)
@note: this function was added in version 1.9*/
int overviewFrameMapId() const;

public slots:

/**Called if map canvas has changed*/
@@ -0,0 +1,8 @@
class QgsPaintEngineHack : QPaintEngine
{
%TypeHeaderCode
#include <qgspaintenginehack.h>
%End
public:
static void fixEngineFlags( QPaintEngine *engine );
};
@@ -99,7 +99,7 @@ def __init__(self, iface):
def closeEvent(self, e):
settings = QSettings()
settings.setValue( "/fTools/ValidateDialog/geometry", QVariant(self.saveGeometry()) )
QMainWindow.closeEvent(self, e)
QDialog.closeEvent(self, e)
del self.marker

def keyPressEvent( self, e ):
BIN +0 Bytes (100%) resources/srs.db
Binary file not shown.
@@ -61,7 +61,7 @@
uk => 'Сергей Якунин',
vi => 'Bùi Hữu Mạnh',
zh_CN => 'Zhang Jun',
zh_TW => 'Nungyao Lin',
zh_TW => 'Nung-yao Lin',
};

my $maxn;
@@ -45,6 +45,7 @@
#include "qgsmessageviewer.h"
#include "qgscontexthelp.h"
#include "qgscursors.h"
#include "qgspaintenginehack.h"

#include <QCloseEvent>
#include <QCheckBox>
@@ -524,38 +525,6 @@ void QgsComposer::on_mActionRefreshView_triggered()
mComposition->update();
}

// Hack to workaround Qt #5114 by disabling PatternTransform
class QgsPaintEngineHack : public QPaintEngine
{
public:
void fixFlags()
{
gccaps = 0;
gccaps |= ( QPaintEngine::PrimitiveTransform
// | QPaintEngine::PatternTransform
| QPaintEngine::PixmapTransform
| QPaintEngine::PatternBrush
// | QPaintEngine::LinearGradientFill
// | QPaintEngine::RadialGradientFill
// | QPaintEngine::ConicalGradientFill
| QPaintEngine::AlphaBlend
// | QPaintEngine::PorterDuff
| QPaintEngine::PainterPaths
| QPaintEngine::Antialiasing
| QPaintEngine::BrushStroke
| QPaintEngine::ConstantOpacity
| QPaintEngine::MaskedBrush
// | QPaintEngine::PerspectiveTransform
| QPaintEngine::BlendModes
// | QPaintEngine::ObjectBoundingModeGradients
#if QT_VERSION >= 0x040500
| QPaintEngine::RasterOpModes
#endif
| QPaintEngine::PaintOutsidePaintEvent
);
}
};

void QgsComposer::on_mActionExportAsPDF_triggered()
{
QSettings myQSettings; // where we keep last used filter in persistent state
@@ -582,13 +551,7 @@ void QgsComposer::on_mActionExportAsPDF_triggered()
printer.setOutputFileName( outputFileName );
printer.setPaperSize( QSizeF( mComposition->paperWidth(), mComposition->paperHeight() ), QPrinter::Millimeter );

QPaintEngine *engine = printer.paintEngine();
if ( engine )
{
QgsPaintEngineHack *hack = static_cast<QgsPaintEngineHack*>( engine );
hack->fixFlags();
}

QgsPaintEngineHack::fixEngineFlags( printer.paintEngine() );
print( printer );
}

@@ -1131,23 +1094,8 @@ void QgsComposer::showEvent( QShowEvent* event )
{
if ( event->spontaneous() ) //event from the window system
{
//go through maps and restore original preview modes (show on demand after loading from project file)
QMap< QgsComposerMap*, int >::iterator mapIt = mMapsToRestore.begin();
for ( ; mapIt != mMapsToRestore.end(); ++mapIt )
{
mapIt.key()->setPreviewMode(( QgsComposerMap::PreviewMode )( mapIt.value() ) );
mapIt.key()->cache();
mapIt.key()->update();
}
mMapsToRestore.clear();

//create composer picture widget previews
QList< QgsComposerPictureWidget* >::iterator picIt = mPicturePreviews.begin();
for ( ; picIt != mPicturePreviews.end(); ++picIt )
{
( *picIt )->addStandardDirectoriesToPreview();
}
mPicturePreviews.clear();
restoreComposerMapStates();
initialiseComposerPicturePreviews();
}

#ifdef Q_WS_MAC
@@ -1542,6 +1490,9 @@ void QgsComposer::cleanupAfterTemplateRead()
}
}
}

restoreComposerMapStates();
initialiseComposerPicturePreviews();
}

void QgsComposer::on_mActionPageSetup_triggered()
@@ -1554,3 +1505,27 @@ void QgsComposer::on_mActionPageSetup_triggered()
QPageSetupDialog pageSetupDialog( &mPrinter, this );
pageSetupDialog.exec();
}

void QgsComposer::restoreComposerMapStates()
{
//go through maps and restore original preview modes (show on demand after loading from project file)
QMap< QgsComposerMap*, int >::iterator mapIt = mMapsToRestore.begin();
for ( ; mapIt != mMapsToRestore.end(); ++mapIt )
{
mapIt.key()->setPreviewMode(( QgsComposerMap::PreviewMode )( mapIt.value() ) );
mapIt.key()->cache();
mapIt.key()->update();
}
mMapsToRestore.clear();
}

void QgsComposer::initialiseComposerPicturePreviews()
{
//create composer picture widget previews
QList< QgsComposerPictureWidget* >::iterator picIt = mPicturePreviews.begin();
for ( ; picIt != mPicturePreviews.end(); ++picIt )
{
( *picIt )->addStandardDirectoriesToPreview();
}
mPicturePreviews.clear();
}
@@ -289,6 +289,14 @@ class QgsComposer: public QMainWindow, private Ui::QgsComposerBase
//! Removes all the item from the graphics scene and deletes them
void deleteItems();

//! Restores composer map preview states.
//! Initially after reading from xml, states are set to rectangle to achieve faster project loading.
void restoreComposerMapStates();

//! Fills icons into composer picture widgets
//! To make loading from project faster, the previews are generated when the composer becomes visible.
void initialiseComposerPicturePreviews();

/**Composer title*/
QString mTitle;

0 comments on commit 37ab951

Please sign in to comment.