Skip to content

Commit d74fbff

Browse files
committedFeb 1, 2017
Make QgsMapRendererCache protected members private
This class isn't designed to be subclassed
1 parent 54d8d11 commit d74fbff

File tree

3 files changed

+14
-35
lines changed

3 files changed

+14
-35
lines changed
 

‎doc/api_break.dox

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1335,6 +1335,11 @@ be returned instead of a null pointer if no transformation is required.
13351335
- destinationSrsChanged() was renamed to destinationCrsChanged()
13361336
- getCompositionMode(), getBlendModeEnum() and BlendMode enum have been moved to QgsPainting utility class.
13371337

1338+
QgsMapRendererCache {#qgis_api_break_3_0_QgsMapRendererCache}
1339+
-------------------
1340+
1341+
- All protected members have been made private. This class is not designed to be subclassed.
1342+
13381343

13391344
QgsMapRendererJob {#qgis_api_break_3_0_QgsMapRendererJob}
13401345
-----------------

‎python/core/qgsmaprenderercache.sip

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,3 @@
1-
2-
/**
3-
* This class is responsible for keeping cache of rendered images of individual layers.
4-
*
5-
* Once a layer has rendered image stored in the cache (using setCacheImage(...)),
6-
* the cache listens to repaintRequested() signals from layer. If triggered, the cache
7-
* removes the rendered image (and disconnects from the layer).
8-
*
9-
* The class is thread-safe (multiple classes can access the same instance safely).
10-
*
11-
* @note added in 2.4
12-
*/
131
class QgsMapRendererCache : QObject
142
{
153
%TypeHeaderCode
@@ -20,27 +8,14 @@ class QgsMapRendererCache : QObject
208

219
QgsMapRendererCache();
2210

23-
//! invalidate the cache contents
2411
void clear();
2512

26-
//! initialize cache: set new parameters and erase cache if parameters have changed
27-
//! @return flag whether the parameters are the same as last time
2813
bool init( const QgsRectangle& extent, double scale );
2914

30-
//! set cached image for the specified layer ID
3115
void setCacheImage( const QString& layerId, const QImage& img );
3216

33-
//! get cached image for the specified layer ID. Returns null image if it is not cached.
3417
QImage cacheImage( const QString& layerId );
3518

36-
//! remove layer from the cache
3719
void clearCacheImage( const QString& layerId );
3820

39-
protected slots:
40-
//! remove layer (that emitted the signal) from the cache
41-
void layerRequestedRepaint();
42-
43-
protected:
44-
//! invalidate cache contents (without locking)
45-
void clearInternal();
4621
};

‎src/core/qgsmaprenderercache.h

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,31 +42,30 @@ class CORE_EXPORT QgsMapRendererCache : public QObject
4242

4343
QgsMapRendererCache();
4444

45-
//! invalidate the cache contents
45+
//! Invalidate the cache contents
4646
void clear();
4747

48-
//! initialize cache: set new parameters and erase cache if parameters have changed
48+
//! Initialize cache: set new parameters and erase cache if parameters have changed
4949
//! @return flag whether the parameters are the same as last time
5050
bool init( const QgsRectangle& extent, double scale );
5151

52-
//! set cached image for the specified layer ID
52+
//! Set the cached image for the specified layer ID
5353
void setCacheImage( const QString& layerId, const QImage& img );
5454

55-
//! get cached image for the specified layer ID. Returns null image if it is not cached.
55+
//! Returns the cached image for the specified layer ID. Returns null image if it is not cached.
5656
QImage cacheImage( const QString& layerId );
5757

58-
//! remove layer from the cache
58+
//! Removes a layer from the cache
5959
void clearCacheImage( const QString& layerId );
6060

61-
protected slots:
62-
//! remove layer (that emitted the signal) from the cache
61+
private slots:
62+
//! Remove layer (that emitted the signal) from the cache
6363
void layerRequestedRepaint();
6464

65-
protected:
66-
//! invalidate cache contents (without locking)
65+
private:
66+
//! Invalidate cache contents (without locking)
6767
void clearInternal();
6868

69-
protected:
7069
QMutex mMutex;
7170
QgsRectangle mExtent;
7271
double mScale;

0 commit comments

Comments
 (0)
Please sign in to comment.