Skip to content

Commit 52ca39c

Browse files
committed
Merge branch 'release-1_7_0' of github.com:qgis/Quantum-GIS into release-1_7_0
2 parents 6cbb9f0 + eb89be3 commit 52ca39c

22 files changed

+189
-14
lines changed

doc/CODING.t2t

+168
Original file line numberDiff line numberDiff line change
@@ -1220,6 +1220,174 @@ CMakeLists.txt parts) are still being worked on so that the testing framework
12201220
works in a truly platform way. I will update this document as things
12211221
progress.
12221222

1223+
1224+
= Getting up and running with QtCreator and QGIS =
1225+
1226+
QtCreator is a newish IDE from the makers of the Qt library. With QtCreator you
1227+
can build any C++ project, but it's really optimised for people working on
1228+
Qt(4) based applications (including mobile apps). Everything I describe below
1229+
assumes you are running Ubuntu 11.04 'Natty'.
1230+
1231+
1232+
== Installing QtCreator ==
1233+
1234+
This part is easy:
1235+
1236+
```
1237+
sudo apt-get install qtcreator qtcreator-doc
1238+
```
1239+
1240+
After installing you should find it in your gnome menu.
1241+
1242+
1243+
== Setting up your project ==
1244+
1245+
I'm assuming you have already got a local Quantum-GIS clone containing the
1246+
source code, and have installed all needed build dependencies etc. There are
1247+
detailed in instructions on doing that here:
1248+
1249+
http://github.com/qgis/Quantum-GIS/blob/master/CODING
1250+
1251+
1252+
On my system I have checked out the code into $HOME/dev/cpp/Quantum-GIS and the
1253+
rest of the article is written assuming that, you should update these paths as
1254+
appropriate for your local system.
1255+
1256+
On launching QtCreator do:
1257+
1258+
```
1259+
File->Open File or Project
1260+
```
1261+
1262+
Then use the resulting file selection dialog to browse to and open this file:
1263+
1264+
```
1265+
$HOME/dev/cpp/Quantum-GIS/CMakeLists.txt
1266+
```
1267+
1268+
[images/image01.jpeg]
1269+
1270+
Next you will be prompted for a build location. I create a specific build dir
1271+
for QtCreator to work in under:
1272+
1273+
```
1274+
$HOME/dev/cpp/Quantum-GIS/build-master-qtcreator
1275+
```
1276+
1277+
Its probably a good idea to create separate build directories for different
1278+
branches if you can afford the disk space.
1279+
1280+
[images/image02.jpeg]
1281+
1282+
1283+
Next you will be asked if you have any CMake build options to pass to CMake. We
1284+
will tell CMake that we want a debug build by adding this option:
1285+
1286+
```
1287+
-DCMAKE_BUILD_TYPE=Debug
1288+
```
1289+
1290+
[images/image03.jpeg]
1291+
1292+
Thats the basics of it. When you complete the Wizard, QtCreator will start
1293+
scanning the source tree for autocompletion support and do some other
1294+
housekeeping stuff in the background. We want to tweak a few things before we
1295+
start to build though.
1296+
1297+
1298+
1299+
== Setting up your build environment ==
1300+
1301+
Click on the 'Projects' icon on the left of the QtCreator window.
1302+
1303+
[images/image04.jpeg]
1304+
1305+
Select the build settings tab (normally active by default).
1306+
1307+
[images/image05.jpeg]
1308+
1309+
We now want to add a custom process step. Why? Because QGIS can currently only
1310+
run from an install directory, not its build directory, so we need to ensure
1311+
that it is installed whenever we build it. Under 'Build Steps', click on the
1312+
'Add Build Step' combo button and choose 'Custom Process Step'.
1313+
1314+
[images/image06.jpeg]
1315+
1316+
Now we set the following details:
1317+
1318+
```
1319+
Enable custom process step [yes]
1320+
Command: make
1321+
Working directory: $HOME/dev/cpp/Quantum-GIS/build-master-qtcreator
1322+
Command arguments: install
1323+
```
1324+
1325+
[images/image07.jpeg]
1326+
1327+
You are almost ready to build. Just one note: QtCreator will need write
1328+
permissions on the install prefix. By default (which I am using here) QGIS is
1329+
going to get installed to /usr/local. For my purposes on my development
1330+
machine, I just gave myself write permissions to the /usr/local directory.
1331+
1332+
To start the build, click that big hammer icon on the bottom left of the
1333+
window.
1334+
1335+
[images/image08.jpeg]
1336+
1337+
== Setting your run environment ==
1338+
1339+
As mentioned above, we cannot run QGIS from directly in the build directly, so
1340+
we need to create a custom run target to tell QtCreator to run QGIS from the
1341+
install dir (in my case /usr/local/). To do that, return to the projects
1342+
configuration screen.
1343+
1344+
[images/image04.jpeg]
1345+
1346+
Now select the 'Run Settings' tab
1347+
1348+
[images/image09.jpeg]
1349+
1350+
We need to update the default run settings from using the 'qgis' run
1351+
configuration to using a custom one.
1352+
1353+
[images/image10.jpeg]
1354+
1355+
Do do that, click the 'Add v' combo button next to the **Run** configuration
1356+
combo and choose 'Custom Executable' from the top of the list.
1357+
1358+
[images/image11.jpeg]
1359+
1360+
Now in the properties area set the following details:
1361+
1362+
```
1363+
Executable: /usr/local/bin/qgis
1364+
Arguments :
1365+
Working directory: $HOME
1366+
Run in terminal: [no]
1367+
Debugger: C++ [yes]
1368+
Qml [no]
1369+
```
1370+
1371+
Then click the 'Rename' button and give your custom executable a meaning full
1372+
name e.g. 'Installed QGIS'
1373+
1374+
[images/image12.jpeg]
1375+
1376+
1377+
== Running and debugging ==
1378+
1379+
1380+
Now you are ready to run and debug QGIS. To set a break point, simply open a
1381+
source file and click in the left column.
1382+
1383+
[images/image14.jpeg]
1384+
1385+
Now launch QGIS under the debugger by clicking the icon with a bug on it in the
1386+
bottom left of the window.
1387+
1388+
[images/image13.jpeg]
1389+
1390+
12231391
= HIG (Human Interface Guidelines) =
12241392

12251393
In order for all graphical user interface elements to appear consistant and to

doc/images/image01.jpeg

70.9 KB
Loading

doc/images/image02.jpeg

32.8 KB
Loading

doc/images/image03.jpeg

29.4 KB
Loading

doc/images/image04.jpeg

7.3 KB
Loading

doc/images/image05.jpeg

11.4 KB
Loading

doc/images/image06.jpeg

5.77 KB
Loading

doc/images/image07.jpeg

37.7 KB
Loading

doc/images/image08.jpeg

1.16 KB
Loading

doc/images/image09.jpeg

11.2 KB
Loading

doc/images/image10.jpeg

48.3 KB
Loading

doc/images/image11.jpeg

3.6 KB
Loading

doc/images/image12.jpeg

32.7 KB
Loading

doc/images/image13.jpeg

1.33 KB
Loading

doc/images/image14.jpeg

31.1 KB
Loading

images/splash/web_banner.jpg

27.6 KB
Loading

images/splash/web_banner.xcf.bz2

1.02 MB
Binary file not shown.

src/core/raster/qgsrasterbandstats.h

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ class CORE_EXPORT QgsRasterBandStats
4646
stdDev = 0.0;
4747
sum = 0.0;
4848
elementCount = 0;
49+
histogramVector = new HistogramVector();
4950
isHistogramEstimated = false;
5051
isHistogramOutOfRange = false;
5152
}

src/core/raster/qgsrasterlayer.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -2345,7 +2345,7 @@ void QgsRasterLayer::setDataProvider( QString const & provider,
23452345
myRasterBandStats.bandName = mDataProvider->generateBandName( i );
23462346
myRasterBandStats.bandNumber = i;
23472347
myRasterBandStats.statsGathered = false;
2348-
myRasterBandStats.histogramVector = new QgsRasterBandStats::HistogramVector();
2348+
myRasterBandStats.histogramVector->clear();
23492349
//Store the default color table
23502350
//readColorTable( i, &myRasterBandStats.colorTable );
23512351
QList<QgsColorRampShader::ColorRampItem> ct;

src/mapserver/qgsmslayercache.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
#include "qgsvectorlayer.h"
2020
#include "qgsmapserverlogger.h"
2121

22-
//maximum number of layers in the cache (and upper limit for layers in one published project)
23-
#define DEFAULT_MAX_N_LAYERS 50
22+
//maximum number of layers in the cache
23+
#define DEFAULT_MAX_N_LAYERS 100
2424

2525
QgsMSLayerCache* QgsMSLayerCache::mInstance = 0;
2626

src/mapserver/qgswmsserver.cpp

+7-9
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
#include <QBuffer>
5151
#include <QPrinter>
5252
#include <QSvgGenerator>
53+
#include <QUrl>
5354

5455
QgsWMSServer::QgsWMSServer( std::map<QString, QString> parameters, QgsMapRenderer* renderer )
5556
: mParameterMap( parameters )
@@ -106,15 +107,12 @@ QDomDocument QgsWMSServer::getCapabilities()
106107
//Some client requests already have http://<SERVER_NAME> in the REQUEST_URI variable
107108
QString hrefString;
108109
QString requestUrl = getenv( "REQUEST_URI" );
109-
requestUrl.truncate( requestUrl.indexOf( "?" ) + 1 );
110-
if ( requestUrl.contains( "http" ) )
111-
{
112-
hrefString = requestUrl;
113-
}
114-
else
115-
{
116-
hrefString = "http://" + QString( getenv( "SERVER_NAME" ) ) + requestUrl;
117-
}
110+
QUrl mapUrl( requestUrl );
111+
mapUrl.setHost( QString( getenv( "SERVER_NAME" ) ) );
112+
mapUrl.removeQueryItem( "REQUEST" );
113+
mapUrl.removeQueryItem( "VERSION" );
114+
mapUrl.removeQueryItem( "SERVICE" );
115+
hrefString = mapUrl.toString();
118116

119117

120118
// SOAP platform

src/providers/gdal/qgsgdalprovider.cpp

+10-2
Original file line numberDiff line numberDiff line change
@@ -1320,8 +1320,16 @@ void QgsGdalProvider::populateHistogram( int theBandNo, QgsRasterBandStats & t
13201320

13211321
for ( int myBin = 0; myBin < theBinCount; myBin++ )
13221322
{
1323-
theBandStats.histogramVector->push_back( myHistogramArray[myBin] );
1324-
QgsDebugMsg( "Added " + QString::number( myHistogramArray[myBin] ) + " to histogram vector" );
1323+
if ( myHistogramArray[myBin] < 0 ) //can't have less than 0 pixels of any value
1324+
{
1325+
theBandStats.histogramVector->push_back( 0 );
1326+
QgsDebugMsg( "Added 0 to histogram vector as freq was negative!" );
1327+
}
1328+
else
1329+
{
1330+
theBandStats.histogramVector->push_back( myHistogramArray[myBin] );
1331+
QgsDebugMsg( "Added " + QString::number( myHistogramArray[myBin] ) + " to histogram vector" );
1332+
}
13251333
}
13261334

13271335
}

0 commit comments

Comments
 (0)