76 Commits

Author SHA1 Message Date
Nyall Dawson
4643712a1e Fix missing transform contexts for QgsDistanceArea
QgsDistanceArea.setSourceCrs() now requires a QgsTransformContext
argument.
2017-12-20 17:37:46 +10:00
Mathieu Pellerin
e7a1c0440a
Trigger layer repaint when adding field-less features (fixes #17426) 2017-11-10 10:49:57 +07:00
Nyall Dawson
31c1ae1c6a Add missing QStringLiterals 2017-09-25 17:12:03 +10:00
Matthias Kuhn
9581fe0a10 [FEATURE] Add snapping results to default value calculation
... as @snapping_results variable
2017-07-07 12:58:55 +02:00
Matthias Kuhn
c973c83c8c Remove unused variable 2017-07-06 17:31:09 +02:00
Juergen E. Fischer
6dfcf40227 fix 20197c2fa (refs #13520) 2017-06-30 10:32:57 +02:00
Nyall Dawson
ae2c06c1fe Followup 20197c2, fix orphaned highlights remaining on maps 2017-04-27 14:38:21 +10:00
Juergen E. Fischer
20197c2fa3 avoid opening multiple attribute forms for a single feature in identify
(fixes #13520)

On behalf of Faunalia, sponsored by ENEL

(cherry picked from commit 7b8fb793cf63483477b8af1670541aca033e8ab9)
2017-04-20 21:35:29 +02:00
Nyall Dawson
cc5b9bfe17 More QgsDistanceArea API cleanups and simplification
- setEllipsoidalMode() was removed. Ellipsoidal calculations are
now enabled whenever a valid ellipsoid() has been set. Set the
ellipsoid to 'NONE' to disable ellipsoidal calculations.

- ellipsoidalEnabled() was removed. Ellipsoidal calculations
are now enabled whenever a valid ellipsoid() is set. Check
willUseEllipsoid() to determine whether ellipsoidal
calculations will be performed.

- sourceCrs() and setSourceCrs() now always take and return
QgsCoordinateReferenceSystem objects. All string/ID based CRS
methods were removed.

- geographic() was removed. This was only used internally
in one place, so was replaced with sourceCrs().isGeographic() instead.

- some largely overlapping measurement functions were consolidated
2017-04-18 08:14:16 +10:00
Nyall Dawson
943d1a2ca5 More Qt5 style connect conversions 2017-03-28 09:18:59 +10:00
Alessandro Pasotti
1822caa803 QgsSettings: removed leading slashs from keys 2017-03-08 11:11:47 +01:00
Juergen E. Fischer
a10c890383 More QgsSettings updates:
* revives WMS
* QgsSettings::clear() added
* section added to QgsSettings::contains()
* type parameter added to sip binding of QgsSettings.value()
* TODO: customization & evis
2017-03-04 02:37:59 +01:00
Denis Rouzaud
dccf8c9e13 run astyle on src/app 2017-03-03 09:09:37 +01:00
Nyall Dawson
aed6c735a6 Swap QScopedPointer to std::unique_ptr
Why?
- no benefits to QScopedPointer over std::unique_ptr
- unlike QScopedPointer, std::unique_ptr has no overhead
over regular pointers
- using standard language features makes it more likely that
compilers can optimise this use and static analysers can
correctly handle code using unique_ptrs
- QScopedPointer has an (IMO) uncertain future (given that
Qt is dropping features which have become part of the c++
standard). Better to port now before wider use of QScopedPointer
in the codebase!
2017-02-07 12:08:57 +10:00
Denis Rouzaud
0a63d1f2c2 [spellcheck] properly look into various cases and add more fixes" 2017-01-16 16:39:20 +01:00
Nyall Dawson
24c990f15f [needs-docs] Don't restrict project ellipsoid choice when
canvas OTF reprojection is disabled

These two settings aren't necessarily related - you may want
to disable OTF canvas reprojection while still wanting accurate
distance/area measurements using an ellipsoid.

This change should make distance/area calculation in QGIS more
reliable and predictable for users. Calculations are now
based entirely on the ellipsoid choice in project properties, so
it only takes checking a single setting to verify how
measurements are calculated.
2017-01-14 19:45:22 +10:00
Nyall Dawson
631bd48aa0 Port remaining map tools, paste features, offline editing
to use new constraint/default clause handling methods
2016-11-16 14:19:24 +01:00
Matthias Kuhn
f18d1c3083 Rename listActions to actions and fix test 2016-11-16 09:33:19 +01:00
Matthias Kuhn
a6eb7b6281 Convert action ids to uuid 2016-11-16 09:33:19 +01:00
Matthias Kuhn
e7d8b2cabf Rename scopes to "Field", "Feature", "Layer" 2016-11-16 09:33:19 +01:00
Matthias Kuhn
5b4a88f8e0 [feature] Add layer scoped actions
Within the attribute table, there is a new button to trigger actions
which are not based on individual features but instead on the whole layer.
Normally they will perform actions based on all features or the selection.

In addition to this, a lot of cleanup has been done.
2016-11-16 09:33:19 +01:00
Nyall Dawson
94413c38fd Show literal defaults in add feature form 2016-11-08 08:18:16 +10:00
Nyall Dawson
1fea20de50 Split handling of literal default values from provider side
default value SQL clauses

QgsVectorDataProvider now has two methods:

- defaultValueClause: returns SQL fragment which must be evaluated
by the provider to obtain the default value, eg sequence values
- defaultValue: returns the literal constant default value
for a field
2016-11-08 08:18:16 +10:00
Hugo Mercier
9ecdf61014 Don't delete QgsAttributeDialog too early. Fixes #15737 2016-10-28 11:17:46 +02:00
Nyall Dawson
4166a3ea62 Fix most clazy qstring-unneeded-heap-allocations warnings
By flipping string literals to QStringLiteral/QLatin1String

see

https://woboq.com/blog/qstringliteral.html
2016-10-24 15:26:24 +10:00
Nyall Dawson
a3968a29bd Fix clazy qmap-with-pointer-key warnings
From the clazy docs:

Finds cases where you're using QMap<K,T> and K is a pointer.

QMap has the particularity of sorting it's keys, but sorting
by memory address makes no sense. Use QHash instead, which
provides faster lookups.
2016-10-22 22:46:16 +10:00
Nyall Dawson
ecee43814a Fix changing project CRS from legend doesn't correctly set CRS
Also avoid fragile duplicated code for setting/retrieving
common project properties

Fixes #15717
2016-10-18 09:55:56 +10:00
Nyall Dawson
6d28eb5f2a Optimise expression context creation
Sponsored by DB Fahrwegdienste GmbH
2016-08-30 12:40:42 +10:00
Nyall Dawson
66cb422669 Add UI for setting default field value expressions in the
field property dialog

Sponsored by DB Fahrwegdienste GmbH
2016-08-30 12:39:55 +10:00
Matthias Kuhn
5c20f0782a Cleanup QgsEditFormConfig
* It's now implicitly shared, meaning that changes to the config
   can be supervised and a signal is sent from QgsVectorLayer and
   there is no risk of elements suddenly being deleted.
 * Remove a bunch of methods that were in QgsVectorLayer for legacy
   reasons.
2016-08-19 09:03:07 +02:00
Nyall Dawson
c628c0f434 Rework includes to forward declare as much as possible
Should speed up recompilation when headers change
2016-07-18 19:10:19 +10:00
Matthias Kuhn
66c47d7ae4 Keep feature form only on top of application and not system
Better fix #15103
2016-06-24 09:11:38 +02:00
Matthias Kuhn
0783e8fc1d Keep attribute dialog in front
Fix #15103
2016-06-23 10:47:28 +02:00
Nyall Dawson
ce7d79e495 Show scrollbars for attribute form as identify results 2016-06-09 16:48:27 +10:00
Nyall Dawson
66b51d4a81 [FEATURE] Edit attributes of multiple features simultaneously
This change allows the attributes of multiple features to be edited
simultaneously. It is enabled when the attribute table dialog is in
"form mode", via a new "multi edit" button on the toolbar.

In this mode, attribute value changes will apply to all selected
features. New widgets appear next to each editor widget allowing for
display of the current multi-edit state and for rolling back changes
on a field-by-field basis.

Changes are made as a single edit command, so pressing undo will
rollback the attribute changes for all selected features at once.

Multiedit mode is only available for auto generated and drag and
drop forms - it is not supported by custom ui forms.

Sponsored by Kanton Basel Stadt
2016-04-18 15:15:11 +10:00
Juergen E. Fischer
fdeff63542 don't use last used values on primary key fields (fixes #14154) 2016-01-21 22:22:39 +01:00
Nyall Dawson
576875e998 Followup 320c696 use clang-modernize to replace 0/NULL use with nullptr 2015-12-15 11:24:51 +11:00
Matthias Kuhn
25aa60e338 Fix crash on add feature 2015-12-02 20:13:38 +01:00
Matthias Kuhn
d2b506cccc Expose changed attributes in QgsFeatureAction and QgsVectorLayerTools 2015-11-30 14:19:35 +01:00
Matthias Kuhn
a50f2d051f Refactor edit form configuration out of QgsVectorLayer 2015-11-19 15:32:28 +01:00
Nyall Dawson
1969e09b6f Also avoid detaching QgsFields and QgsAttributes where possible 2015-10-20 20:36:08 +11:00
Matthias Kuhn
e832b2a28a Add QgsVectorLayer::fields() as alias to pendingFields()
pendingFields() is not very intuitive and leads to confusion for new developers.
2015-08-04 15:13:31 +02:00
Nyall Dawson
d393d268e1 Fix up non-const getters for attributes and geometry in QgsFeature
(preparation for implicit sharing)
2015-05-20 21:46:15 +10:00
Nyall Dawson
ee68332ed7 Suppress attribute form popup if layer has no fields
Prevents empty form popup for layers with no fields (eg memory layers).
If desired, this behaviour can be overriden by the layer's feature
form suppress option, eg if form has python logic which makes it useful
even with no fields.

(fix #10775)
2015-02-25 21:56:43 +11:00
Matthias Kuhn
e49adad1de Use cached feature for context menu feature action on attribute dialog
Dirty hack to
 * fix #11744
 * fix #11546
2015-01-21 17:56:19 +01:00
Juergen E. Fischer
b5f047d2d3 keep add feature action until non-modal attribute form is closed (fixes #11461) 2014-10-22 00:25:39 +02:00
Martin Dobias
aa46df2fad Fix one memory leak + add note to show() calls as they will delete the dialog 2014-10-21 18:11:51 +07:00
Denis Rouzaud
c5652a52e2 [fix #11300] make edit form non modal on feature creation too 2014-10-02 17:38:29 +02:00
Matthias Kuhn
4b8288c026 openFeatureForm: Update attributes on provided when used modal
Fix #11099
2014-08-26 16:07:17 +02:00
Denis Rouzaud
bc187ba953 identify shows a non-modal feature form 2014-08-19 09:08:57 +02:00