Skip to content

Commit bf7dd52

Browse files
committedDec 6, 2013
Various fixes to make it compile on Windows
1 parent e1ea342 commit bf7dd52

File tree

9 files changed

+24
-14
lines changed

9 files changed

+24
-14
lines changed
 

‎python/core/qgspallabeling.sip

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -597,6 +597,9 @@ public:
597597
QList<QgsLabelPosition> labelsAtPosition( const QgsPoint& p ) const;
598598
//! return infos about labels within a given (map) rectangle
599599
QList<QgsLabelPosition> labelsWithinRect( const QgsRectangle& r ) const;
600+
601+
private:
602+
QgsLabelingResults( const QgsLabelingResults& );
600603
};
601604

602605

‎src/core/qgsfeaturerequest.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ class QgsAbstractFeatureIterator;
152152
/** base class that can be used for any class that is capable of returning features
153153
* @note added in 2.1
154154
*/
155-
class QgsAbstractFeatureSource
155+
class CORE_EXPORT QgsAbstractFeatureSource
156156
{
157157
public:
158158
virtual ~QgsAbstractFeatureSource();

‎src/core/qgsmaplayerrenderer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
* 3. renderer job (in worker thread) calls QgsMapLayerRenderer::render()
2424
* 4. renderer job (again in GUI thread) will check errors() and report them
2525
*/
26-
class QgsMapLayerRenderer
26+
class CORE_EXPORT QgsMapLayerRenderer
2727
{
2828
public:
2929
QgsMapLayerRenderer( const QString& layerID ) : mLayerID( layerID ) {}

‎src/core/qgsmaprendererjob.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,9 @@ void QgsMapRendererSequentialJob::internalFinished()
131131

132132
mErrors = mInternalJob->errors();
133133

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

137139
emit finished();
@@ -818,7 +820,7 @@ void QgsMapRendererParallelJob::renderLabelsStatic(QgsMapRendererParallelJob* se
818820
QImage QgsMapRendererParallelJob::composeImage()
819821
{
820822
QImage image( mSettings.outputSize(), QImage::Format_ARGB32_Premultiplied );
821-
image.fill( mSettings.backgroundColor() );
823+
image.fill( mSettings.backgroundColor().rgb() );
822824

823825
QPainter painter(&image);
824826

‎src/core/qgsmaprendererjob.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ typedef QList<LayerRenderJob> LayerRenderJobs;
2929

3030

3131
/** abstract base class renderer jobs that asynchronously start map rendering */
32-
class QgsMapRendererJob : public QObject
32+
class CORE_EXPORT QgsMapRendererJob : public QObject
3333
{
3434
Q_OBJECT
3535
public:
@@ -101,7 +101,7 @@ class QgsMapRendererJob : public QObject
101101
/** Intermediate base class adding functionality that allows client to query the rendered image.
102102
* The image can be queried even while the rendering is still in progress to get intermediate result
103103
*/
104-
class QgsMapRendererQImageJob : public QgsMapRendererJob
104+
class CORE_EXPORT QgsMapRendererQImageJob : public QgsMapRendererJob
105105
{
106106
public:
107107
QgsMapRendererQImageJob( const QgsMapSettings& settings );
@@ -115,7 +115,7 @@ class QgsMapRendererCustomPainterJob;
115115

116116

117117
/** job implementation that renders everything sequentially in one thread */
118-
class QgsMapRendererSequentialJob : public QgsMapRendererQImageJob
118+
class CORE_EXPORT QgsMapRendererSequentialJob : public QgsMapRendererQImageJob
119119
{
120120
Q_OBJECT
121121
public:
@@ -148,7 +148,7 @@ public slots:
148148

149149

150150
/** job implementation that renders all layers in parallel */
151-
class QgsMapRendererParallelJob : public QgsMapRendererQImageJob
151+
class CORE_EXPORT QgsMapRendererParallelJob : public QgsMapRendererQImageJob
152152
{
153153
Q_OBJECT
154154
public:
@@ -200,7 +200,7 @@ protected slots:
200200
/** job implementation that renders everything sequentially using a custom painter.
201201
* The returned image is always invalid (because there is none available).
202202
*/
203-
class QgsMapRendererCustomPainterJob : public QgsMapRendererJob
203+
class CORE_EXPORT QgsMapRendererCustomPainterJob : public QgsMapRendererJob
204204
{
205205
Q_OBJECT
206206
public:

‎src/core/qgsmapsettings.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,11 @@
1313
#include "qgsxmlutils.h"
1414

1515

16+
Q_GUI_EXPORT extern int qt_defaultDpiX();
17+
18+
1619
QgsMapSettings::QgsMapSettings()
17-
: mDpi( 96 ) // what to set?
20+
: mDpi( qt_defaultDpiX() ) // DPI that will be used by default for QImage instances
1821
, mSize( QSize( 0, 0 ) )
1922
, mExtent()
2023
, mProjectionsEnabled( false )

‎src/core/qgsmapsettings.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class QgsMapRendererJob;
1818
class QgsMapLayer;
1919

2020

21-
class QgsMapSettings
21+
class CORE_EXPORT QgsMapSettings
2222
{
2323
public:
2424
QgsMapSettings();

‎src/core/qgspallabeling.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ class CORE_EXPORT QgsLabelComponent
661661
* Class that stores computed placement from labeling engine.
662662
* @note added in 2.1
663663
*/
664-
class QgsLabelingResults
664+
class CORE_EXPORT QgsLabelingResults
665665
{
666666
public:
667667
QgsLabelingResults();
@@ -672,7 +672,7 @@ class QgsLabelingResults
672672
//! return infos about labels within a given (map) rectangle
673673
QList<QgsLabelPosition> labelsWithinRect( const QgsRectangle& r ) const;
674674

675-
protected:
675+
private:
676676
QgsLabelingResults( const QgsLabelingResults& ) {} // no copying allowed
677677

678678
QgsLabelSearchTree* mLabelSearchTree;

‎src/gui/qgsmapcanvas.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,9 @@ void QgsMapCanvas::rendererJobFinished()
636636
mLabelingResults = mJob->takeLabelingResults();
637637
}
638638

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

0 commit comments

Comments
 (0)
Please sign in to comment.