86 Commits

Author SHA1 Message Date
Nyall Dawson
6ea616ef4b Fix compilation error on Travis 2017-03-30 11:38:16 +10:00
Nyall Dawson
c11ef583ce Generalise editor widget config saving/restoring props from gui 2017-03-10 11:02:16 +01:00
Matthias Kuhn
0170580019 Save QgsProperty related objects via QVariants 2017-03-09 20:54:44 +01:00
Denis Rouzaud
0a63d1f2c2 [spellcheck] properly look into various cases and add more fixes" 2017-01-16 16:39:20 +01:00
Nyall Dawson
231f6af0e1 Don't return const references to implicitly shared Qt classes
Instead return the inexpensive copies. Should provide extra safety
against issues like #14822

(refs #14822)
2017-01-14 15:53:45 +10:00
Denis Rouzaud
748be8de71 [spelling] replace behaviour by behavior 2017-01-11 11:35:19 +01:00
Harrissou Sant-anna
ef85cdcf83 Replace "eg" by "e.g." or "for example" 2016-12-30 00:03:22 +01:00
Matthias Kuhn
930ce545a8 Fix failing tests 2016-12-20 01:20:08 +01:00
Matthias Kuhn
c9f8ac2afe Remove editor widget project loading code from gui 2016-12-20 01:20:08 +01:00
Matthias Kuhn
9fd0802939 Remove QgsEditorWidgetConfig
This is replaced with a QVariantMap. It was never really more than this in the
past and with the switch to QgsConfigurationProperties, there is really no
longer any reason to assume that this will change.
2016-12-20 01:20:08 +01:00
Matthias Kuhn
82d1871f8c Put field kit into use 2016-12-20 01:20:08 +01:00
Matthias Kuhn
9a53b7df06 Add field kits for a lot of common field types 2016-12-20 01:20:08 +01:00
Patrick Valsecchi
91e4b24a39 Better reading/writting of editor widget config.
Avoid saving config parameters that are not set and support not
having them in the XML.
2016-11-07 09:00:17 +01:00
Nyall Dawson
3f2a7810cf Respect non-enforced constraints when editing/adding features
Warnings are shown, but features can be committed. Fields which
fail an unenforced constraint are now shaded in yellow to differentiate
from the red failure for enforced constraints.
2016-11-02 13:42:22 +10:00
Nyall Dawson
1cecf37b40 Enforce unique constraints in attribute form 2016-11-02 11:07:07 +10:00
Nyall Dawson
44289084e9 Optimise passing of variables by ref/value 2016-10-24 10:36:23 +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
Matthias Kuhn
8069154aad [Feature] Allow configuring link/unlink feature buttons on relation editor widget 2016-09-21 21:16:28 +02:00
Patrick Valsecchi
57d00949f7 Add an editor widget for QVariantList 2016-09-13 09:16:17 +02:00
Nyall Dawson
f16b3870fa Use QgsFilterLineEdit for Qgs(Double)SpinBox
Fixes issues with the current approach:
- poor appearance on certain environments (esp OSX)
- large area on spin boxes' right which "swallows" clicks
and blocks interactivity

Fix #12920
2016-09-08 22:10:36 +10:00
Patrick Valsecchi
7169079f91 Smarter default edit widgets with plugins to pick them
Now the widgets factories can give a score on how good they could handle
a widget.

Additionaly, plugins can be added to choose a widget factory in function
of an external information. One of them uses a table in PostgresQL to
allow specification of the widget type and configuration.

I took the opportunity to remove a few deprecated method in relation to
this.
2016-09-05 14:22:17 +02:00
Nyall Dawson
99405864ca Add a changed signal to QgsEditorConfigWidget
And update default value expression preview whenever editor
config changes

Sponsored by DB Fahrwegdienste GmbH
2016-08-30 12:40:52 +10:00
Matthias Kuhn
a529b448e7 Revert "Merge pull request #3338 from pvalsecc/editor_widgets_selection"
This reverts commit bbafbf48872eda48a2be8876cc89a0770552c6ad, reversing
changes made to 13ac0434e10fc7edd1eca665ea7c8b6cb5fd212d.
2016-08-29 19:22:04 +02:00
Patrick Valsecchi
24bde35ce6 Smarter default edit widgets with plugins to pick them
Now the widgets factories can give a score on how good they could handle
a widget.

Additionaly, plugins can be added to choose a widget factory in function
of an external information. One of them uses a table in PostgresQL to
allow specification of the widget type and configuration.

I took the opportunity to remove a few deprecated method in relation to
this.
2016-08-29 07:42:50 +02:00
Matthias Kuhn
6ae2daa145 Respect the "showLabel" flag on attribute editor elements 2016-08-19 14:50:22 +02:00
Matthias Kuhn
56a0af5bd8 Sort attribute table by representation value where useful
Fix #15096
And aligns some edge-cases of sort behavior
2016-07-07 16:39:13 +02:00
Matthias Kuhn
437cb85cd5 Left align mapped values
Fix #15101
2016-06-23 12:50:38 +02:00
Juergen E. Fischer
006b581870 fix warnings 2016-06-02 12:27:40 +02:00
Matthias Kuhn
c68eaeb929 Refactor widget constraints to keep variables private 2016-06-02 08:51:03 +02:00
Blottiere Paul
8449e42ae0 add constraint description 2016-05-31 20:16:22 +02:00
Blottiere Paul
a636319af6 fix sip 2016-05-31 20:16:21 +02:00
Blottiere Paul
020d20a968 [FEATURE] constraints on widgets 2016-05-31 20:16:21 +02:00
Nyall Dawson
9f325df9c7 Search widget wrapper for relation reference widget 2016-05-25 15:41:04 +10:00
Nyall Dawson
1c4811fa12 Add Is Not Null and Is Not Between type search/filters 2016-05-24 00:26:15 +10:00
Nyall Dawson
e00ea61be6 Add missing docs 2016-05-24 00:26:15 +10:00
Nyall Dawson
02c0174d41 Add a "Between" type search/filter in filter form mode
When Between searches are selected, two search widget wrappers
will be created to allow entry of the minimum/maximum allowed
values.
2016-05-24 00:26:15 +10:00
Nyall Dawson
026e352cd9 [FEATURE] Add a search widget wrapper for datetime widgets 2016-05-24 00:26:15 +10:00
Nyall Dawson
6d868598f5 Add an interderminant "empty" state for QgsDateTimeEdit 2016-05-24 00:26:14 +10:00
Nyall Dawson
195b4dee5a [FEATURE] Add search widget wrapper for check box widget 2016-05-24 00:26:14 +10:00
Nyall Dawson
ca5c7e2cd4 [FEATURE] Form based select/filter in attribute table
This commit adds a new mode to the attribute table dialog for searching
and filtering features. When activated (using a button on the toolbar
or by pressng CTRL+F), the dialog will switch to form view and all
widgets are replaced with their search widget wrapper variant.

Alongside each widget is a tool button with options for controlling
the search/filter behaviour for that field, eg "equal to", "not equal
to", "is null", "greater than", etc.., with the options presented
matching themselves to the corresponding field and widget type.

New buttons appear at the bottom of the form for either selecting
matching features (with options for add to selection/remove from
selection/select within current selection) or filtering features
in the table (with options for adding features to a current filter
or further restricting a current filter).

Sponsored by SIGE
2016-05-24 00:26:14 +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
Matthias Kuhn
226339cc9c Allow adding a new entry from the relation reference widget 2016-04-06 09:01:35 +02:00
Nyall Dawson
acb9281956 Add missing binding 2016-04-05 18:23:11 +10:00
Nyall Dawson
22f1a1dee7 Implement QgsEditorWidgetWrapper::showIndeterminateState() for setting
editor widgets into an indeterminant "unknown value" state

Works for all editor widgets except date time, range and uuid widgets.
2016-04-05 13:06:25 +10:00
Juergen E. Fischer
5c4bf99ce2 debian packaging update: manually merge some changes from PR#2818 and
some spelling fixes.
2016-02-20 16:55:16 +01:00
Juergen E. Fischer
a90be95f7b sip sync 2016-02-14 03:50:49 +01:00
Nyall Dawson
881074b194 Boost coverage of SIP bindings
Now all classes and members are either exposed to bindings or marked
as "not available in Python bindings" in the docs.

Drop test thresholds to 0. Now it should be much easier to determine
what missing members have been added which are causing test
failures.
2016-01-05 11:16:15 +11:00
Matthias Kuhn
be01b7eec5 [FEATURE] Add N:M relation editing possibilities
This adds the possibility to manage data on a normalized relational
database in N:M relations. On the relation editor in a form, the tools
to add, delete, link and unlink work (also) on the linking table if a
relation is visualized as N:M relation.

Configuration is done through the fields tab where on the relation a
second relation can be chosen (if there is a suitable relation in terms
of a second relation on the linking table).

Limitations
===========

QGIS is not a database management system.

It is based on assumptions about the underlying database system. In
particular it expects

 * A `ON DELETE CASCADE` or similar measure on the second relation
 * Does not take care of setting the primary key when adding features.
   Either users need to be instructed to set them manually or - if it's a
   database derived value - the layers need to be in transaction mode
   (currently only activatable through the API)
2015-12-08 15:49:01 +01:00
Matthias Kuhn
bbbf8a5a27 [sip] fix editor widget bindings 2015-11-20 15:31:58 +01:00
elpaso
8c24e1e2d4 Added const to config() method 2015-11-20 12:45:23 +01:00