@@ -24,13 +24,14 @@ Developers guide for QGIS
24
24
1.7.1. Tabs
25
25
1.7.2. Indentation
26
26
1.7.3. Braces
27
- 1.8. Coding Style
28
- 1.8.1. Where-ever Possible Generalize Code
29
- 1.8.2. Prefer Having Constants First in Predicates
30
- 1.8.3. Whitespace Can Be Your Friend
31
- 1.8.4. Add Trailing Identifying Comments
32
- 1.8.5. Use Braces Even for Single Line Statements
33
- 1.8.6. Book recommendations
27
+ 1.8. API Compatibility
28
+ 1.9. Coding Style
29
+ 1.9.1. Where-ever Possible Generalize Code
30
+ 1.9.2. Prefer Having Constants First in Predicates
31
+ 1.9.3. Whitespace Can Be Your Friend
32
+ 1.9.4. Add Trailing Identifying Comments
33
+ 1.9.5. Use Braces Even for Single Line Statements
34
+ 1.9.6. Book recommendations
34
35
2. SVN Access
35
36
2.1. Accessing the Repository
36
37
2.2. Anonymous Access
@@ -273,13 +274,41 @@ Braces should start on the line following the expression:
273
274
274
275
275
276
276
- 1.8. Coding Style
277
+ 1.8. API Compatibility
278
+ ======================
279
+
280
+ From QGIS 1.0 we will provide a stable, backwards compatible API. This will
281
+ provide a stable basis for people to develop against, knowing their code will
282
+ work against any of the 1.x QGIS releases (although recompiling may be
283
+ required).Cleanups to the API should be done in a manner similar to the
284
+ Trolltech developers e.g.
285
+
286
+
287
+ class Foo
288
+ {
289
+ public:
290
+ /** This method will be deprecated, you are encouraged to use
291
+ doSomethingBetter() rather.
292
+ @see doSomethingBetter()
293
+ */
294
+ bool doSomething();
295
+
296
+ /** Does something a better way.
297
+ @note This method was introduced in QGIS version 1.1
298
+ */
299
+ bool doSomethingBetter();
300
+
301
+ }
302
+
303
+
304
+
305
+ 1.9. Coding Style
277
306
=================
278
307
279
308
Here are described some programming hints and tips that will hopefully reduce errors, development time, and maintenance.
280
309
281
310
282
- 1.8 .1. Where-ever Possible Generalize Code
311
+ 1.9 .1. Where-ever Possible Generalize Code
283
312
==========================================
284
313
285
314
@@ -294,7 +323,7 @@ This will:
294
323
maintain for others
295
324
296
325
297
- 1.8 .2. Prefer Having Constants First in Predicates
326
+ 1.9 .2. Prefer Having Constants First in Predicates
298
327
==================================================
299
328
300
329
Prefer to put constants first in predicates.
@@ -308,7 +337,7 @@ logic bugs. The compiler will generate an error if you accidentally use "=" ins
308
337
inherently cannot be assigned values.
309
338
310
339
311
- 1.8 .3. Whitespace Can Be Your Friend
340
+ 1.9 .3. Whitespace Can Be Your Friend
312
341
====================================
313
342
314
343
Adding spaces between operators, statements, and functions makes it easier for humans to parse code.
@@ -326,7 +355,7 @@ or this:
326
355
327
356
328
357
329
- 1.8 .4. Add Trailing Identifying Comments
358
+ 1.9 .4. Add Trailing Identifying Comments
330
359
========================================
331
360
332
361
Adding comments at the end of function, struct and class implementations makes it easier to find them later.
@@ -346,7 +375,7 @@ E.g.,
346
375
347
376
348
377
349
- 1.8 .5. Use Braces Even for Single Line Statements
378
+ 1.9 .5. Use Braces Even for Single Line Statements
350
379
=================================================
351
380
352
381
Using braces for code in if/then blocks or similar code structures even for single line statements means that adding another
@@ -378,7 +407,7 @@ So, prefer this:
378
407
379
408
380
409
381
- 1.8 .6. Book recommendations
410
+ 1.9 .6. Book recommendations
382
411
===========================
383
412
384
413
* Effective C++ (http://www.awprofessional.com/title/0321334876), Scott Meyers
@@ -1234,10 +1263,10 @@ guidelines are followed in layout and design of GUIs.
1234
1263
1235
1264
1. Group related elements using group boxes:
1236
1265
Try to identify elements that can be grouped together and then use
1237
- group boxes with a label identify the topic of that group.
1266
+ group boxes with a label to identify the topic of that group.
1238
1267
Avoid using group boxes with only a single widget / item inside.
1239
- 2. Capitalise first letter only in group box labels:
1240
- Group box labels should be written as a phrase with leading capital letter,
1268
+ 2. Capitalise first letter only in labels:
1269
+ Labels (and group box labels) should be written as a phrase with leading capital letter,
1241
1270
and all remaing words written with lower case first letters
1242
1271
3. Do not end labels for widgets or group boxes with a colon:
1243
1272
Adding a colon causes visual noise and does not impart additional meaning,
0 commit comments