Skip to content
Browse files

Merge branch 'release-1_7_0' of into rele…

  • Loading branch information
mhugent committed Jul 2, 2011
2 parents 6cbb9f0 + eb89be3 commit 52ca39c7ca5d18a5fd991d75b1f6c1b837d132d1
@@ -1220,6 +1220,174 @@ CMakeLists.txt parts) are still being worked on so that the testing framework
works in a truly platform way. I will update this document as things

= Getting up and running with QtCreator and QGIS =

QtCreator is a newish IDE from the makers of the Qt library. With QtCreator you
can build any C++ project, but it's really optimised for people working on
Qt(4) based applications (including mobile apps). Everything I describe below
assumes you are running Ubuntu 11.04 'Natty'.

== Installing QtCreator ==

This part is easy:

sudo apt-get install qtcreator qtcreator-doc

After installing you should find it in your gnome menu.

== Setting up your project ==

I'm assuming you have already got a local Quantum-GIS clone containing the
source code, and have installed all needed build dependencies etc. There are
detailed in instructions on doing that here:

On my system I have checked out the code into $HOME/dev/cpp/Quantum-GIS and the
rest of the article is written assuming that, you should update these paths as
appropriate for your local system.

On launching QtCreator do:

File->Open File or Project

Then use the resulting file selection dialog to browse to and open this file:



Next you will be prompted for a build location. I create a specific build dir
for QtCreator to work in under:


Its probably a good idea to create separate build directories for different
branches if you can afford the disk space.


Next you will be asked if you have any CMake build options to pass to CMake. We
will tell CMake that we want a debug build by adding this option:



Thats the basics of it. When you complete the Wizard, QtCreator will start
scanning the source tree for autocompletion support and do some other
housekeeping stuff in the background. We want to tweak a few things before we
start to build though.

== Setting up your build environment ==

Click on the 'Projects' icon on the left of the QtCreator window.


Select the build settings tab (normally active by default).


We now want to add a custom process step. Why? Because QGIS can currently only
run from an install directory, not its build directory, so we need to ensure
that it is installed whenever we build it. Under 'Build Steps', click on the
'Add Build Step' combo button and choose 'Custom Process Step'.


Now we set the following details:

Enable custom process step [yes]
Command: make
Working directory: $HOME/dev/cpp/Quantum-GIS/build-master-qtcreator
Command arguments: install


You are almost ready to build. Just one note: QtCreator will need write
permissions on the install prefix. By default (which I am using here) QGIS is
going to get installed to /usr/local. For my purposes on my development
machine, I just gave myself write permissions to the /usr/local directory.

To start the build, click that big hammer icon on the bottom left of the


== Setting your run environment ==

As mentioned above, we cannot run QGIS from directly in the build directly, so
we need to create a custom run target to tell QtCreator to run QGIS from the
install dir (in my case /usr/local/). To do that, return to the projects
configuration screen.


Now select the 'Run Settings' tab


We need to update the default run settings from using the 'qgis' run
configuration to using a custom one.


Do do that, click the 'Add v' combo button next to the **Run** configuration
combo and choose 'Custom Executable' from the top of the list.


Now in the properties area set the following details:

Executable: /usr/local/bin/qgis
Arguments :
Working directory: $HOME
Run in terminal: [no]
Debugger: C++ [yes]
Qml [no]

Then click the 'Rename' button and give your custom executable a meaning full
name e.g. 'Installed QGIS'


== Running and debugging ==

Now you are ready to run and debug QGIS. To set a break point, simply open a
source file and click in the left column.


Now launch QGIS under the debugger by clicking the icon with a bug on it in the
bottom left of the window.


= HIG (Human Interface Guidelines) =

In order for all graphical user interface elements to appear consistant and to
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN +27.6 KB (260%) images/splash/web_banner.jpg
Binary file not shown.
BIN +1.02 MB (790%) images/splash/web_banner.xcf.bz2
Binary file not shown.
@@ -46,6 +46,7 @@ class CORE_EXPORT QgsRasterBandStats
stdDev = 0.0;
sum = 0.0;
elementCount = 0;
histogramVector = new HistogramVector();
isHistogramEstimated = false;
isHistogramOutOfRange = false;
@@ -2345,7 +2345,7 @@ void QgsRasterLayer::setDataProvider( QString const & provider,
myRasterBandStats.bandName = mDataProvider->generateBandName( i );
myRasterBandStats.bandNumber = i;
myRasterBandStats.statsGathered = false;
myRasterBandStats.histogramVector = new QgsRasterBandStats::HistogramVector();
//Store the default color table
//readColorTable( i, &myRasterBandStats.colorTable );
QList<QgsColorRampShader::ColorRampItem> ct;
@@ -19,8 +19,8 @@
#include "qgsvectorlayer.h"
#include "qgsmapserverlogger.h"

//maximum number of layers in the cache (and upper limit for layers in one published project)
//maximum number of layers in the cache

QgsMSLayerCache* QgsMSLayerCache::mInstance = 0;

@@ -50,6 +50,7 @@
#include <QBuffer>
#include <QPrinter>
#include <QSvgGenerator>
#include <QUrl>

QgsWMSServer::QgsWMSServer( std::map<QString, QString> parameters, QgsMapRenderer* renderer )
: mParameterMap( parameters )
@@ -106,15 +107,12 @@ QDomDocument QgsWMSServer::getCapabilities()
//Some client requests already have http://<SERVER_NAME> in the REQUEST_URI variable
QString hrefString;
QString requestUrl = getenv( "REQUEST_URI" );
requestUrl.truncate( requestUrl.indexOf( "?" ) + 1 );
if ( requestUrl.contains( "http" ) )
hrefString = requestUrl;
hrefString = "http://" + QString( getenv( "SERVER_NAME" ) ) + requestUrl;
QUrl mapUrl( requestUrl );
mapUrl.setHost( QString( getenv( "SERVER_NAME" ) ) );
mapUrl.removeQueryItem( "REQUEST" );
mapUrl.removeQueryItem( "VERSION" );
mapUrl.removeQueryItem( "SERVICE" );
hrefString = mapUrl.toString();

// SOAP platform
@@ -1320,8 +1320,16 @@ void QgsGdalProvider::populateHistogram( int theBandNo, QgsRasterBandStats & t

for ( int myBin = 0; myBin < theBinCount; myBin++ )
theBandStats.histogramVector->push_back( myHistogramArray[myBin] );
QgsDebugMsg( "Added " + QString::number( myHistogramArray[myBin] ) + " to histogram vector" );
if ( myHistogramArray[myBin] < 0 ) //can't have less than 0 pixels of any value
theBandStats.histogramVector->push_back( 0 );
QgsDebugMsg( "Added 0 to histogram vector as freq was negative!" );
theBandStats.histogramVector->push_back( myHistogramArray[myBin] );
QgsDebugMsg( "Added " + QString::number( myHistogramArray[myBin] ) + " to histogram vector" );


0 comments on commit 52ca39c

Please sign in to comment.
You can’t perform that action at this time.