Skip to content

Commit

Permalink
Various fixes to make it compile on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
wonder-sk committed Dec 6, 2013
1 parent e1ea342 commit bf7dd52
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 14 deletions.
3 changes: 3 additions & 0 deletions python/core/qgspallabeling.sip
Expand Up @@ -597,6 +597,9 @@ public:
QList<QgsLabelPosition> labelsAtPosition( const QgsPoint& p ) const;
//! return infos about labels within a given (map) rectangle
QList<QgsLabelPosition> labelsWithinRect( const QgsRectangle& r ) const;

private:
QgsLabelingResults( const QgsLabelingResults& );
};


Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsfeaturerequest.h
Expand Up @@ -152,7 +152,7 @@ class QgsAbstractFeatureIterator;
/** base class that can be used for any class that is capable of returning features
* @note added in 2.1
*/
class QgsAbstractFeatureSource
class CORE_EXPORT QgsAbstractFeatureSource
{
public:
virtual ~QgsAbstractFeatureSource();
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsmaplayerrenderer.h
Expand Up @@ -23,7 +23,7 @@
* 3. renderer job (in worker thread) calls QgsMapLayerRenderer::render()
* 4. renderer job (again in GUI thread) will check errors() and report them
*/
class QgsMapLayerRenderer
class CORE_EXPORT QgsMapLayerRenderer
{
public:
QgsMapLayerRenderer( const QString& layerID ) : mLayerID( layerID ) {}
Expand Down
6 changes: 4 additions & 2 deletions src/core/qgsmaprendererjob.cpp
Expand Up @@ -131,7 +131,9 @@ void QgsMapRendererSequentialJob::internalFinished()

mErrors = mInternalJob->errors();

delete mInternalJob;
// now we are in a slot called from mInternalJob - do not delete it immediately
// so the class is still valid when the execution returns to the class
mInternalJob->deleteLater();
mInternalJob = 0;

emit finished();
Expand Down Expand Up @@ -818,7 +820,7 @@ void QgsMapRendererParallelJob::renderLabelsStatic(QgsMapRendererParallelJob* se
QImage QgsMapRendererParallelJob::composeImage()
{
QImage image( mSettings.outputSize(), QImage::Format_ARGB32_Premultiplied );
image.fill( mSettings.backgroundColor() );
image.fill( mSettings.backgroundColor().rgb() );

QPainter painter(&image);

Expand Down
10 changes: 5 additions & 5 deletions src/core/qgsmaprendererjob.h
Expand Up @@ -29,7 +29,7 @@ typedef QList<LayerRenderJob> LayerRenderJobs;


/** abstract base class renderer jobs that asynchronously start map rendering */
class QgsMapRendererJob : public QObject
class CORE_EXPORT QgsMapRendererJob : public QObject
{
Q_OBJECT
public:
Expand Down Expand Up @@ -101,7 +101,7 @@ class QgsMapRendererJob : public QObject
/** Intermediate base class adding functionality that allows client to query the rendered image.
* The image can be queried even while the rendering is still in progress to get intermediate result
*/
class QgsMapRendererQImageJob : public QgsMapRendererJob
class CORE_EXPORT QgsMapRendererQImageJob : public QgsMapRendererJob
{
public:
QgsMapRendererQImageJob( const QgsMapSettings& settings );
Expand All @@ -115,7 +115,7 @@ class QgsMapRendererCustomPainterJob;


/** job implementation that renders everything sequentially in one thread */
class QgsMapRendererSequentialJob : public QgsMapRendererQImageJob
class CORE_EXPORT QgsMapRendererSequentialJob : public QgsMapRendererQImageJob
{
Q_OBJECT
public:
Expand Down Expand Up @@ -148,7 +148,7 @@ public slots:


/** job implementation that renders all layers in parallel */
class QgsMapRendererParallelJob : public QgsMapRendererQImageJob
class CORE_EXPORT QgsMapRendererParallelJob : public QgsMapRendererQImageJob
{
Q_OBJECT
public:
Expand Down Expand Up @@ -200,7 +200,7 @@ protected slots:
/** job implementation that renders everything sequentially using a custom painter.
* The returned image is always invalid (because there is none available).
*/
class QgsMapRendererCustomPainterJob : public QgsMapRendererJob
class CORE_EXPORT QgsMapRendererCustomPainterJob : public QgsMapRendererJob
{
Q_OBJECT
public:
Expand Down
5 changes: 4 additions & 1 deletion src/core/qgsmapsettings.cpp
Expand Up @@ -13,8 +13,11 @@
#include "qgsxmlutils.h"


Q_GUI_EXPORT extern int qt_defaultDpiX();


QgsMapSettings::QgsMapSettings()
: mDpi( 96 ) // what to set?
: mDpi( qt_defaultDpiX() ) // DPI that will be used by default for QImage instances
, mSize( QSize( 0, 0 ) )
, mExtent()
, mProjectionsEnabled( false )
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsmapsettings.h
Expand Up @@ -18,7 +18,7 @@ class QgsMapRendererJob;
class QgsMapLayer;


class QgsMapSettings
class CORE_EXPORT QgsMapSettings
{
public:
QgsMapSettings();
Expand Down
4 changes: 2 additions & 2 deletions src/core/qgspallabeling.h
Expand Up @@ -661,7 +661,7 @@ class CORE_EXPORT QgsLabelComponent
* Class that stores computed placement from labeling engine.
* @note added in 2.1
*/
class QgsLabelingResults
class CORE_EXPORT QgsLabelingResults
{
public:
QgsLabelingResults();
Expand All @@ -672,7 +672,7 @@ class QgsLabelingResults
//! return infos about labels within a given (map) rectangle
QList<QgsLabelPosition> labelsWithinRect( const QgsRectangle& r ) const;

protected:
private:
QgsLabelingResults( const QgsLabelingResults& ) {} // no copying allowed

QgsLabelSearchTree* mLabelSearchTree;
Expand Down
4 changes: 3 additions & 1 deletion src/gui/qgsmapcanvas.cpp
Expand Up @@ -636,7 +636,9 @@ void QgsMapCanvas::rendererJobFinished()
mLabelingResults = mJob->takeLabelingResults();
}

delete mJob;
// now we are in a slot called from mJob - do not delete it immediately
// so the class is still valid when the execution returns to the class
mJob->deleteLater();
mJob = 0;
}

Expand Down

0 comments on commit bf7dd52

Please sign in to comment.