45 Commits

Author SHA1 Message Date
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
elpaso
7cc0a21bf8 Added config() to QgsEditorWidgetWrapper SIP wrapper 2015-11-20 10:47:57 +01:00
Nyall Dawson
f1633a1796 Change all signals to use const refs for non trivial objects 2015-10-26 22:46:25 +11:00
Nyall Dawson
c49b5b777f Change a lot of arguments to const references in core/gui
Rationale:
- there was a lot of large objects passed by value, so potentially
there's a speed bump from this
- even for implicitly shared classes like QString/QList there's still
a (small) cost for copying the objects when there's no reason to
- it's the right thing to do!
2015-10-07 12:02:04 +11:00
Matthias Kuhn
1e6f673a23 Update email address 2015-08-30 13:00:15 +02:00
Juergen E. Fischer
9752c468c1 indentation update 2015-07-29 11:52:14 +02:00
Matthias Kuhn
de547adc19 Find a suitable editor widget if widget and config mismatch
If a .ui file is specified and the widget specified in the .ui file is not
supported by the widgetwrapper which is configured in the layer properties
the system will automatically try to find a better suitable widgetwrapper.

To do this, widgetwrappers (respectively their factories) can return a map of
supported widget types with priority values.
The widgetwrapper which offers the heighest priority for a certain widget type
will be used in case of a mismatch.

Sponsored by OPENGIS.ch special projects team (aka gis.se troubleshooting
section)
2015-07-23 12:04:18 +02:00
Matthias Kuhn
a58a2f28d7 Add unit test for edit widget "TextEdit"
QGIS Dev conference Denmark
2015-05-20 11:53:34 +02:00
Matthias Kuhn
24417fd75d Add python bindings for QgsWidgetWrapper
Allows the usage of `widget.wrapper()` from a form's python init script.
2015-05-13 09:49:55 +02:00
Juergen E. Fischer
bfb8ab6893 edit widgets: keep default values of new feature's attributes until they are added
(fixes #12391 & #12386)
2015-03-18 16:09:47 +01:00
Matthias Kuhn
fec3bd83f6 Custom widgets: make sure config can loaded from the project
Apparently sip cannot handle private virtual methods
2015-03-18 09:36:18 +01:00
Nyall Dawson
c1fe68c821 Fix big parameter passed by value warnings 2015-02-16 16:11:57 +11:00
Juergen E. Fischer
a959960587 relation reference widget: add methods to sip (followup 52c2e4e90) 2015-02-03 18:34:58 +01:00
Nyall Dawson
b05e789c57 Fix build 2015-02-03 20:47:29 +11:00
Juergen E. Fischer
abd4a04399 sip update 2015-02-03 02:21:52 +01:00
Nyall Dawson
0cde4f103b Ensure that clear button is shown for QgsSpinBox/DoubleSpinBox
Previously the clear button might not show if the value of the
widget was set while its signals were blocked.
2015-01-19 23:23:59 +11:00
Juergen E. Fischer
28c344325f indentation update 2014-12-08 21:30:29 +01:00
Nyall Dawson
697ef510b7 Also evaluate expressions entered in QgsSpinBox
and flip all composer spin boxes to QgsSpinBox (refs #10544)
2014-12-05 23:39:50 +11:00
Nyall Dawson
7400106e41 [FEATURE] Evaluate expressions entered in QgsDoubleSpinBox
Allows entry of QGIS expressions into the spin box. The expression
is evaluated on enter or loss of focus and then discarded.

(refs #10544)
2014-12-05 20:39:09 +11:00
Nyall Dawson
0fa40a657b Change some spin boxes in symbology to QgsDoubleSpinBox
Adds the handy 'clear' buttons to these spin boxes, such as
offsets and rotation.
Also standardises the display of some widgets in symbology.
2014-12-04 21:19:43 +11:00
Denis Rouzaud
1a4b8bb40d define the special text directly with the clear value 2014-12-04 10:15:05 +01:00
Denis Rouzaud
2b37e40b17 allow defining custom clear value for Qgs(Double)SpinBox 2014-12-03 15:14:03 +01:00
Juergen E. Fischer
98c0771b1a update scripts/fix_allows_to.sh and run it 2014-11-30 01:42:27 +01:00
Juergen E. Fischer
d4f64d9bde indentation update and typo fixes 2014-11-13 23:13:13 +01:00
Denis Rouzaud
48cdd749eb add Qgs(Double)SpinBox to SIP 2014-09-25 15:08:51 +02:00
Denis Rouzaud
11be64db85 more public methods, fix delete map tool 2014-09-18 16:41:03 +02:00
Denis Rouzaud
096d9417cb [QgsRelationReferenceWidget] correctly enable/disable set null button, do not disable line edit (already read only), make openForm and mapIdentification public, more documentation 2014-09-17 09:22:04 +02:00
Denis Rouzaud
d05d83ed79 Fix widget registry (SIP), few fixes for relation reference widget 2014-09-16 15:39:55 +02:00
Denis Rouzaud
bcc6647376 [SIP] add missing argument in QgsEditorWidgetRegistry::QgsEditorWidgetWrapper 2014-09-16 12:01:30 +02:00
Denis Rouzaud
8cd5e59e89 add RelationReferenceWidgetWrapper to SIP + complete RelationReferenceWidget 2014-09-15 18:24:47 +02:00
Matthias Kuhn
f63a01cc7c Fix memory leak and pass ownership of py editor widgets to C++ 2014-08-03 18:49:02 +02:00
Juergen E. Fischer
62e59c896f fix saving of edittype configuration and remove redundant storage of labelontop
and editable state.
2014-07-24 19:07:28 +02:00
Juergen E. Fischer
c4c131ef75 sip sync 2014-05-27 23:32:42 +02:00
Matthias Kuhn
ea91b6fe4a [FEATURE] Port editor widgets to new API
Create a new widget for for attribute form

fix #10281
fix #7319
fix #7013
fix #9335
fix #4417
2014-05-22 22:50:36 +02:00
Juergen E. Fischer
74e7314c36 update sip bindings II 2014-01-27 09:22:53 +01:00
Matthias Kuhn
77dce0fbf8 sip: expose QgsEditorWidgetWrapper.initWidget to python 2013-10-16 08:21:19 +02:00
Matthias Kuhn
770e52b0e5 Modularize editor widgets 2013-09-26 16:06:29 +02:00