Skip to content

Commit 1c94672

Browse files
committed
Regenerated docs post raster-stats merge
1 parent 58c737d commit 1c94672

17 files changed

+580
-311
lines changed

CODING

+166-4
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,14 @@ Developers guide for QGIS
5858
3.4. The ADD_QGIS_TEST macro explained
5959
3.5. Building your unit test
6060
3.6. Run your tests
61-
4. HIG (Human Interface Guidelines)
62-
5. Authors
61+
4. Getting up and running with QtCreator and QGIS
62+
4.1. Installing QtCreator
63+
4.2. Setting up your project
64+
4.3. Setting up your build environment
65+
4.4. Setting your run environment
66+
4.5. Running and debugging
67+
5. HIG (Human Interface Guidelines)
68+
6. Authors
6369

6470

6571
------------------------------------------------------------------------
@@ -1208,7 +1214,163 @@ works in a truly platform way. I will update this document as things
12081214
progress.
12091215

12101216

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

12141376
In order for all graphical user interface elements to appear consistant and to
@@ -1257,7 +1419,7 @@ guidelines are followed in layout and design of GUIs.
12571419
suffixed to the button text.
12581420

12591421

1260-
5. Authors
1422+
6. Authors
12611423
==========
12621424

12631425
- Tim Sutton (author and editor)

INSTALL

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
Quantum GIS (QGIS)
22
Building QGIS from source - step by step
3-
Sunday June 12, 2011
3+
Thursday August 04, 2011
44

55

6-
Last Updated: Sunday June 12, 2011
7-
Last Change : Sunday June 05, 2011
6+
Last Updated: Thursday August 04, 2011
7+
Last Change : Tuesday June 28, 2011
88

99

1010
1. Introduction

doc/INSTALL.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@
4545
<DIV CLASS="header" ID="header">
4646
<H1>Quantum GIS (QGIS)</H1>
4747
<H2>Building QGIS from source - step by step</H2>
48-
<H3>Sunday June 12, 2011</H3>
48+
<H3>Thursday August 04, 2011</H3>
4949
</DIV>
5050

5151
<DIV CLASS="body" ID="body">
5252
<P>
53-
Last Updated: Sunday June 12, 2011
54-
Last Change : Sunday June 05, 2011
53+
Last Updated: Thursday August 04, 2011
54+
Last Change : Tuesday June 28, 2011
5555
</P>
5656
<DIV CLASS="toc">
5757

src/app/qgsrasterlayerproperties.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1882,7 +1882,7 @@ void QgsRasterLayerProperties::refreshHistogram()
18821882
// bin in all selected layers, and the min. It then draws a scaled line between min
18831883
// and max - scaled to image height. 1 line drawn per selected band
18841884
//
1885-
const int BINCOUNT = 255;
1885+
const int BINCOUNT = 256;
18861886
bool myIgnoreOutOfRangeFlag = true;
18871887
bool myThoroughBandScanFlag = false;
18881888
int myBandCountInt = mRasterLayer->bandCount();

src/core/qgsapplication.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ QString QgsApplication::mBuildOutputPath;
6464
*/
6565
QgsApplication::QgsApplication( int & argc, char ** argv, bool GUIenabled, QString customConfigPath )
6666
: QApplication( argc, argv, GUIenabled )
67+
{
68+
init( customConfigPath ); //initi can also be called directly by e.g. unit tests that dont inherit QApplication.
69+
}
70+
void QgsApplication::init( QString customConfigPath )
6771
{
6872
// check if QGIS is run from build directory (not the install directory)
6973
QDir appDir( applicationDirPath() );

src/core/qgsapplication.h

+4
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ class CORE_EXPORT QgsApplication: public QApplication
3232
QgsApplication( int & argc, char ** argv, bool GUIenabled, QString customConfigPath = QString() );
3333
virtual ~QgsApplication();
3434

35+
/** This method initialises paths etc for QGIS. Called by the ctor or call it manually
36+
when your app does not extend the QApplication class. */
37+
static void init( QString customConfigPath = QString() );
38+
3539
//! Watch for QFileOpenEvent.
3640
virtual bool event( QEvent * event );
3741

0 commit comments

Comments
 (0)