Skip to content

Commit 9fb835f

Browse files
committed
Merge branch 'master' into measure_dialog
2 parents 09074ad + c11319b commit 9fb835f

File tree

157 files changed

+2876
-301237
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

157 files changed

+2876
-301237
lines changed

.travis.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ before_install:
1818
install:
1919
- mkdir build
2020
- cd build
21-
- cmake -DWITH_SERVER=ON -DWITH_STAGED_PLUGINS=OFF -DWITH_GRASS=OFF -DSUPPRESS_QT_WARNINGS=ON ..
21+
- cmake -DWITH_SERVER=ON -DWITH_STAGED_PLUGINS=OFF -DWITH_GRASS=OFF \
22+
-DSUPPRESS_QT_WARNINGS=ON -DENABLE_MODELTEST=ON ..
2223

2324
script: xvfb-run ctest -V -E 'Atlas|atlas|PyQgsPalLabelingCanvas|PyQgsPalLabelingServer|qgis_wcsprovidertest' -S ../qgis-test-travis.ctest --output-on-failure
2425

CMakeLists.txt

+8-23
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,7 @@ SET (WITH_INTERNAL_QWTPOLAR TRUE CACHE BOOL "Use internal build of QwtPolar")
7070

7171
SET (WITH_INTERNAL_QEXTSERIALPORT TRUE CACHE BOOL "Use internal build of Qextserialport")
7272

73-
SET (WITH_INTERNAL_SPATIALITE FALSE CACHE BOOL "Determines whether SPATIALITE support should be built internally")
7473
SET (WITH_QSPATIALITE FALSE CACHE BOOL "Determines whether QSPATIALITE sql driver should be built")
75-
IF(WITH_INTERNAL_SPATIALITE)
76-
SET(SPATIALITE_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/src/core/spatialite/headers)
77-
IF(WIN32 OR APPLE OR CYGWIN)
78-
FIND_PACKAGE(Iconv REQUIRED)
79-
ENDIF(WIN32 OR APPLE OR CYGWIN)
80-
ENDIF (WITH_INTERNAL_SPATIALITE)
8174

8275
SET (WITH_ORACLE FALSE CACHE BOOL "Determines whether Oracle support should be built")
8376
IF(WITH_ORACLE)
@@ -200,21 +193,17 @@ ELSE (WITH_INTERNAL_QEXTSERIALPORT)
200193
FIND_PACKAGE(Qextserialport REQUIRED)
201194
ENDIF(WITH_INTERNAL_QEXTSERIALPORT)
202195

203-
IF (NOT WITH_INTERNAL_SPATIALITE)
204-
FIND_PACKAGE(Sqlite3)
205-
IF (NOT SQLITE3_FOUND)
206-
MESSAGE (SEND_ERROR "sqlite3 dependency was not found (try compiling with internal spatialite)!")
207-
ENDIF (NOT SQLITE3_FOUND)
208-
ENDIF (NOT WITH_INTERNAL_SPATIALITE)
196+
FIND_PACKAGE(Sqlite3)
197+
IF (NOT SQLITE3_FOUND)
198+
MESSAGE (SEND_ERROR "sqlite3 dependency was not found!")
199+
ENDIF (NOT SQLITE3_FOUND)
209200

210201
# optional
211202
IF (WITH_POSTGRESQL)
212203
FIND_PACKAGE(Postgres) # PostgreSQL provider, SPIT plugin
213204
ENDIF (WITH_POSTGRESQL)
214205

215-
IF (NOT WITH_INTERNAL_SPATIALITE)
216-
FIND_PACKAGE(SPATIALITE REQUIRED)
217-
ENDIF (NOT WITH_INTERNAL_SPATIALITE)
206+
FIND_PACKAGE(SPATIALITE REQUIRED)
218207

219208
IF (NOT PROJ_FOUND OR NOT GEOS_FOUND OR NOT GDAL_FOUND)
220209
MESSAGE (SEND_ERROR "Some dependencies were not found!")
@@ -251,27 +240,23 @@ IF (ENABLE_QT5)
251240
FIND_PACKAGE(Qt5Script REQUIRED)
252241
FIND_PACKAGE(Qt5Sql REQUIRED)
253242
SET(QT5_BUILD TRUE)
254-
255243
INCLUDE("cmake/modules/ECMQt4To5Porting.cmake")
244+
MESSAGE(STATUS "Found Qt version: ${Qt5Core_VERSION_STRING}")
256245
ELSE()
257246
FIND_PACKAGE(Qt4 ${QT_MIN_VERSION} REQUIRED)
258247
SET(QT_USE_QTXML 1)
259248
SET(QT_USE_QTNETWORK 1)
260249
SET(QT_USE_QTSVG 1)
261250
SET(QT_USE_QTSQL 1)
262251
SET(QT_USE_QTWEBKIT 1)
263-
IF (WITH_CUSTOM_WIDGETS)
264-
SET(QT_USE_QTDESIGNER 1)
265-
ENDIF (WITH_CUSTOM_WIDGETS)
266-
267252
IF (NOT QT_QTXML_FOUND OR NOT QT_QTNETWORK_FOUND OR NOT QT_QTSVG_FOUND OR NOT QT_QTSQL_FOUND OR NOT QT_QTWEBKIT_FOUND OR (WITH_CUSTOM_WIDGETS AND NOT QT_QTDESIGNER_FOUND))
268253
MESSAGE(SEND_ERROR "Some Qt4 modules haven't been found!")
269254
ENDIF (NOT QT_QTXML_FOUND OR NOT QT_QTNETWORK_FOUND OR NOT QT_QTSVG_FOUND OR NOT QT_QTSQL_FOUND OR NOT QT_QTWEBKIT_FOUND OR (WITH_CUSTOM_WIDGETS AND NOT QT_QTDESIGNER_FOUND))
270255

271256
INCLUDE( ${QT_USE_FILE} )
272-
ENDIF()
273257

274-
MESSAGE(STATUS "Found Qt version: ${QTVERSION}")
258+
MESSAGE(STATUS "Found Qt version: ${QTVERSION}")
259+
ENDIF()
275260

276261
IF (WITH_QTMOBILITY)
277262
FIND_PACKAGE(QtMobility 1.1.0)

INSTALL

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
QGIS
22
Building QGIS from source - step by step
3-
Monday November 24, 2014
3+
Tuesday December 30, 2014
44

55

6-
Last Updated: Monday November 24, 2014
6+
Last Updated: Tuesday December 30, 2014
77
Last Change : Monday November 24, 2014
88

99

@@ -1748,7 +1748,7 @@ Leopard and Snow Leopard, but was dropped at Lion. To build the Mapserver
17481748
component on Leopard and Snow, add the following line before the last line in
17491749
the above configuration:
17501750

1751-
-D WITH_MAPSERVER=TRUE \
1751+
-D WITH_SERVER=TRUE \
17521752

17531753
On Lion you are on your own to figure out how to install libfcgi and add fcgi
17541754
support to the system Apache. Not recommended for the average user.

NEWS

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
QGIS News
22
Change history for the QGIS Project
3-
Thursday November 13, 2014
3+
Tuesday December 30, 2014
44

55

66
------------------------------------------------------------------------
@@ -34,8 +34,8 @@ Thursday November 13, 2014
3434
------------------------------------------------------------------------
3535

3636

37-
Last Updated: Thursday November 13, 2014
38-
Last Change : Thursday November 13, 2014
37+
Last Updated: Tuesday December 30, 2014
38+
Last Change : Monday December 01, 2014
3939

4040

4141
1. What's new in Version 2.6.0 'Brighton'?

cmake/modules/ECMQt4To5Porting.cmake

+3
Original file line numberDiff line numberDiff line change
@@ -243,3 +243,6 @@ macro(qt4_add_resources)
243243
qt5_add_resources(${ARGN})
244244
endmacro()
245245

246+
# get the Qt plugins directory
247+
GET_TARGET_PROPERTY(QMAKE_EXECUTABLE Qt5::qmake LOCATION)
248+
EXEC_PROGRAM(${QMAKE_EXECUTABLE} ARGS "-query QT_INSTALL_PLUGINS" RETURN_VALUE return_code OUTPUT_VARIABLE QT_PLUGINS_DIR )

doc/INSTALL.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,12 @@
7777
<DIV CLASS="header" ID="header">
7878
<H1>QGIS</H1>
7979
<H2>Building QGIS from source - step by step</H2>
80-
<H3>Monday November 24, 2014</H3>
80+
<H3>Tuesday December 30, 2014</H3>
8181
</DIV>
8282

8383
<DIV CLASS="body" ID="body">
8484
<P>
85-
Last Updated: Monday November 24, 2014
85+
Last Updated: Tuesday December 30, 2014
8686
Last Change : Monday November 24, 2014
8787
</P>
8888
<DIV CLASS="toc">
@@ -2424,7 +2424,7 @@ <H2>5.7. Configure the build</H2>
24242424
</P>
24252425

24262426
<div class="code"><PRE>
2427-
-D WITH_MAPSERVER=TRUE \
2427+
-D WITH_SERVER=TRUE \
24282428
</PRE></div>
24292429

24302430
<P>

doc/news.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
<DIV CLASS="header" ID="header">
7878
<H1>QGIS News</H1>
7979
<H2>Change history for the QGIS Project</H2>
80-
<H3>Thursday November 13, 2014</H3>
80+
<H3>Tuesday December 30, 2014</H3>
8181
</DIV>
8282

8383
<DIV CLASS="toc">
@@ -111,8 +111,8 @@ <H3>Thursday November 13, 2014</H3>
111111
</DIV>
112112
<DIV CLASS="body" ID="body">
113113
<P>
114-
Last Updated: Thursday November 13, 2014
115-
Last Change : Thursday November 13, 2014
114+
Last Updated: Tuesday December 30, 2014
115+
Last Change : Monday December 01, 2014
116116
</P>
117117

118118
<A NAME="toc1"></A>

doc/osx.t2t

+1-1
Original file line numberDiff line numberDiff line change
@@ -812,7 +812,7 @@ mkdir build
812812
cd build
813813
cmake -D CMAKE_INSTALL_PREFIX=~/Applications \
814814
-D CMAKE_BUILD_TYPE=MINSIZEREL -D ENABLE_TESTS=FALSE \
815-
-D WITH_INTERNAL_SPATIALITE=FALSE -D WITH_PYSPATIALITE=FALSE \
815+
-D WITH_PYSPATIALITE=FALSE \
816816
-D SPATIALINDEX_LIBRARY=/usr/local/lib/libspatialindex.dylib \
817817
-D SPATIALINDEX_INCLUDE_DIR=/usr/local/include/spatialindex \
818818
-D QWT_LIBRARY=/usr/local/qwt-6.0.2/lib/libqwt.dylib \

ms-windows/cygwin/package.sh

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ cd build
88
cmake -D BUILDNAME="cygwin" \
99
-D SITE="qgis.org" \
1010
-D PEDANTIC=TRUE \
11-
-D WITH_INTERNAL_SPATIALITE=TRUE \
1211
-D WITH_GRASS=FALSE \
1312
-D WITH_SPATIALITE=TRUE \
1413
-D WITH_QSPATIALITE=TRUE \

python/CMakeLists.txt

-7
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
11
SET(PYTHON_OUTPUT_DIRECTORY ${QGIS_OUTPUT_DIRECTORY}/python)
22

3-
IF (WITH_INTERNAL_SPATIALITE)
4-
INCLUDE_DIRECTORIES(
5-
../src/core/spatialite/headers
6-
../src/core/spatialite/headers/spatialite
7-
)
8-
ENDIF (WITH_INTERNAL_SPATIALITE)
9-
103
SET (QGIS_PYTHON_OUTPUT_DIRECTORY ${PYTHON_OUTPUT_DIRECTORY}/qgis)
114
FILE (MAKE_DIRECTORY ${QGIS_PYTHON_OUTPUT_DIRECTORY})
125
SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${QGIS_PYTHON_OUTPUT_DIRECTORY})

python/core/core.sip

+1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
%Include qgsmaplayerlegend.sip
5555
%Include qgsmaplayerregistry.sip
5656
%Include qgsmaplayerrenderer.sip
57+
%Include qgsmaplayerstylemanager.sip
5758
%Include qgsmaprenderer.sip
5859
%Include qgsmaprenderercache.sip
5960
%Include qgsmaprenderercustompainterjob.sip

python/core/qgsmaplayer.sip

+20
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,21 @@ class QgsMapLayer : QObject
370370
*/
371371
QgsMapLayerLegend* legend() const;
372372

373+
/**
374+
* Enable or disable layer's style manager. When disabled (default), the styleManager() will return null pointer.
375+
* By enabling the style manager will be created with one default style (same as the layer's active style).
376+
* By disabling the style manager all associated styles will be lost (only the layer's active style will stay).
377+
* @note added in 2.8
378+
*/
379+
void enableStyleManager( bool enable = true );
380+
381+
/**
382+
* Get access to the layer's style manager. Style manager allows switching between multiple styles.
383+
* If the style manager is not enabled, null pointer will be returned.
384+
* @note added in 2.8
385+
*/
386+
QgsMapLayerStyleManager* styleManager() const;
387+
373388
/**Returns the minimum scale denominator at which the layer is visible.
374389
* Scale based visibility is only used if hasScaleBasedVisibility is true.
375390
* @returns minimum scale denominator at which the layer will render
@@ -517,6 +532,11 @@ class QgsMapLayer : QObject
517532
/** Write custom properties to project file. */
518533
void writeCustomProperties( QDomNode & layerNode, QDomDocument & doc ) const;
519534

535+
/** Read style manager's configuration (if any). To be called by subclasses. */
536+
void readStyleManager( const QDomNode& layerNode );
537+
/** Write style manager's configuration (if exists). To be called by subclasses. */
538+
void writeStyleManager( QDomNode& layerNode, QDomDocument& doc ) const;
539+
520540
/** debugging member - invoked when a connect() is made to this object */
521541
void connectNotify( const char * signal );
522542

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
2+
class QgsMapLayerStyle
3+
{
4+
%TypeHeaderCode
5+
#include <qgsmaplayerstylemanager.h>
6+
%End
7+
public:
8+
//! construct invalid style
9+
QgsMapLayerStyle();
10+
11+
//! Tell whether the style is valid (i.e. there is something stored in it)
12+
bool isValid() const;
13+
14+
//! Return information about the style - for debugging purposes only
15+
QString dump() const;
16+
17+
//! Store layer's active style information in the instance
18+
void readFromLayer( QgsMapLayer* layer );
19+
//! Apply stored layer's style information to the layer
20+
void writeToLayer( QgsMapLayer* layer ) const;
21+
22+
//! Read style configuration (for project file reading)
23+
void readXml( const QDomElement& styleElement );
24+
//! Write style configuration (for project file writing)
25+
void writeXml( QDomElement& styleElement ) const;
26+
};
27+
28+
29+
class QgsMapLayerStyleManager
30+
{
31+
%TypeHeaderCode
32+
#include <qgsmaplayerstylemanager.h>
33+
%End
34+
public:
35+
//! Construct a style manager associated with a map layer (must not be null)
36+
QgsMapLayerStyleManager( QgsMapLayer* layer );
37+
38+
//! Read configuration (for project loading)
39+
void readXml( const QDomElement& mgrElement );
40+
//! Write configuration (for project saving)
41+
void writeXml( QDomElement& mgrElement ) const;
42+
43+
//! Return list of all defined style names
44+
QStringList styles() const;
45+
//! Return data of a stored style - accessed by its unique name
46+
QgsMapLayerStyle style( const QString& name ) const;
47+
48+
//! Add a style with given name and data
49+
//! @return true on success (name is unique and style is valid)
50+
bool addStyle( const QString& name, const QgsMapLayerStyle& style );
51+
//! Add style by cloning the current one
52+
//! @return true on success
53+
bool addStyleFromLayer( const QString& name );
54+
//! Remove a stored style
55+
//! @return true on success (style exists and it is not the last one)
56+
bool removeStyle( const QString& name );
57+
58+
//! Return name of the current style
59+
QString currentStyle() const;
60+
//! Set a different style as the current style - will apply it to the layer
61+
//! @return true on success
62+
bool setCurrentStyle( const QString& name );
63+
};

python/ext-libs/pyspatialite/CMakeLists.txt

+1-12
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PYTHON_OUTPUT_DIRECTORY}/pyspatialite)
22
SET (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PYTHON_OUTPUT_DIRECTORY}/pyspatialite)
33

4-
IF(WITH_INTERNAL_SPATIALITE)
5-
INCLUDE_DIRECTORIES(
6-
../../src/core/spatialite/headers
7-
../../src/core/spatialite/headers/spatialite
8-
)
9-
ENDIF(WITH_INTERNAL_SPATIALITE)
10-
114
INCLUDE_DIRECTORIES(
125
${PYTHON_INCLUDE_PATH}
136
${GEOS_INCLUDE_DIR}
@@ -44,11 +37,7 @@ IF (NOT APPLE)
4437
TARGET_LINK_LIBRARIES(pyspatialite ${PYTHON_LIBRARY})
4538
ENDIF (NOT APPLE)
4639

47-
TARGET_LINK_LIBRARIES(pyspatialite qgis_core)
48-
49-
IF(NOT WITH_INTERNAL_SPATIALITE)
50-
TARGET_LINK_LIBRARIES(pyspatialite ${SPATIALITE_LIBRARY})
51-
ENDIF(NOT WITH_INTERNAL_SPATIALITE)
40+
TARGET_LINK_LIBRARIES(pyspatialite qgis_core ${SPATIALITE_LIBRARY})
5241

5342
IF (APPLE)
5443
SET_TARGET_PROPERTIES(pyspatialite PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")

python/gui/gui.sip

+1
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@
9191
%Include qgsnumericsortlistviewitem.sip
9292
%Include qgsowssourceselect.sip
9393
%Include qgsprojectbadlayerguihandler.sip
94+
%Include qgsprojectionselectionwidget.sip
9495
%Include qgsprojectionselector.sip
9596
%Include qgsquerybuilder.sip
9697
%Include qgsrasterformatsaveoptionswidget.sip

python/gui/qgsgenericprojectionselector.sip

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class QgsGenericProjectionSelector : QDialog //, private Ui::QgsGenericProjectio
3131
void setSelectedCrsId( long theID );
3232
void setSelectedAuthId( QString authId );
3333

34-
void on_buttonBox_helpRequested();
34+
void on_mButtonBox_helpRequested();
3535

3636
/**
3737
* \brief filters this dialog by the given CRSs

python/gui/qgsmapcanvasitem.sip

+5-5
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,17 @@ class QgsMapCanvasItem : QGraphicsItem
4141
//! @deprecated since v2.4 - not called by QgsMapCanvas anymore
4242
void setPanningOffset( const QPoint& point ) /Deprecated/;
4343

44-
//! returns canvas item rectangle
44+
//! returns canvas item rectangle in map units
4545
QgsRectangle rect() const;
4646

47-
//! sets canvas item rectangle
48-
void setRect( const QgsRectangle& r );
47+
//! sets canvas item rectangle in map units
48+
void setRect( const QgsRectangle& r, bool resetRotation = true );
4949

5050
//! transformation from screen coordinates to map coordinates
51-
QgsPoint toMapCoordinates( const QPoint& point );
51+
QgsPoint toMapCoordinates( const QPoint& point ) const;
5252

5353
//! transformation from map coordinates to screen coordinates
54-
QPointF toCanvasCoordinates( const QgsPoint& point );
54+
QPointF toCanvasCoordinates( const QgsPoint& point ) const;
5555
};
5656

5757

python/gui/qgsnewmemorylayerdialog.sip

+2-5
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,10 @@ class QgsNewMemoryLayerDialog : QDialog
1818
/**Returns the selected geometry type*/
1919
QGis::WkbType selectedType() const;
2020

21-
/**Returns the selected crs id*/
22-
QString selectedCrsId() const;
21+
/**Returns the selected crs*/
22+
QgsCoordinateReferenceSystem crs() const;
2323

2424
/**Returns the layer name*/
2525
QString layerName() const;
2626

27-
protected slots:
28-
29-
void on_mChangeSrsButton_clicked();
3027
};

0 commit comments

Comments
 (0)