97 Commits

Author SHA1 Message Date
Nyall Dawson
0caf944747 Misc optimisations identified by clazy:
- call reserve on container classes where applicable
- make sure Q_FOREACH uses references
- remove dynamic casts to base classes
- fix some implicit bool conversions
2015-10-05 18:43:18 +11:00
Nathan Woodrow
2f60a5f85c [Conditional Styles] Better defaults
Add QgsConditionalLayerStyles to hold row and field styles
2015-08-25 21:08:55 +10:00
Nathan Woodrow
83115cd16a Merge row style support for attribute table
Conflicts:
	python/core/qgsconditionalstyle.sip
	python/core/qgsfielduiproperties.sip
	src/core/qgsfielduiproperties.cpp
	src/core/qgsfielduiproperties.h
	src/gui/attributetable/qgsattributetablemodel.cpp
	src/ui/qgsfieldconditionalformatwidget.ui
	tests/src/python/test_qgsconditionalstyle.py
2015-08-23 12:35:29 +10:00
Nathan Woodrow
b87073e146 Refresh attribute table for row styles. Tests 2015-08-23 10:53:03 +10:00
Nyall Dawson
4bf8b131e3 Port conditional styles to expression contexts 2015-08-22 19:01:43 +10:00
Nathan Woodrow
b355420131 Add cell style on top of row 2015-08-22 10:28:24 +10:00
Nathan Woodrow
323977fb6e Add full row styles 2015-08-21 23:02:18 +10:00
Nathan Woodrow
db563073d6 Allow fall though of conditional rules 2015-08-21 16:24:16 +10:00
Nyall Dawson
9d984b163e Immediately apply conditional formatting changes to table 2015-08-21 10:04:22 +10:00
Nathan Woodrow
faa32f36cf [FEATURE] Conditional formatting for attribute table cells 2015-08-20 23:06:31 +10:00
Nyall Dawson
b7187ed057 Followup 9508f8b, fix other potential crashes 2015-08-06 15:35:37 +10:00
Nyall Dawson
df4c1311ad Fix crash when opening attribute table on non-spatial layer 2015-08-05 15:00:40 +10: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
Nathan Woodrow
bf6f62cd05 Revert "[FEATURE] Show symbol as icon for attribute row"
This reverts commit e3b2a2daf2a5368c8e5565cd83acc26e706e00c2.

Revert until I fix the speed issues
2015-07-11 18:21:42 +10:00
Nathan Woodrow
e3b2a2daf2 [FEATURE] Show symbol as icon for attribute row 2015-07-10 22:04:53 +10:00
Martin Dobias
6215f773e2 Fix crash when deleting a field in attribute table (fixes #12930)
Also fixes:
- multiple reloads of table (due to additional connections to cache invalidation)
- crash in attribute form (on redo of deleted field when it was not the last)
- crash in editor widget wrapper (during table reload)
2015-06-19 12:17:49 +08:00
Matthias Kuhn
fccd8e58cd Disable view updates while reloading attribute table
Fix #12930
2015-06-12 09:41:27 +02:00
Denis Rouzaud
9e3183c63f Revert "sort includes"
This reverts commit 2b7d3d3c73b50ba6dc74abec6dd652ff1b87c0ec.
2015-06-10 14:54:47 +02:00
Denis Rouzaud
2b7d3d3c73 sort includes 2015-06-10 13:59:08 +02:00
Matthias Kuhn
7d7cdcd376 Repack shapefiles when saving after deleting features
* QgsVectorDataProvider::dataChanged() will be emitted
 * QgsVectorLayer::dataChanged() will be emitted
 * Clears QgsVectorLayerCache
 * Reloads the attribute table
 * Clears the selection

Looking forward to people complaining about their lost selection...

Fix #10560
Fix #11989
Refs #8317
Refs #8822
Refs #10483
Refs #11007
Refs #7540
Refs #11398
Refs #11296
2015-05-28 12:34:40 +02:00
Matthias Kuhn
a02e694818 Fix attribute table remove row, Followup 8eca38c
Was an off-by-one error emitted by the attribute table model
2015-05-28 11:25:51 +02:00
Matthias Kuhn
8eca38ca5f Attribute table performance when deleting features
This fixes performance issues with the attribute table visible when deleting a
large number of features.

The attribute table tries to behave smart in the following way:

 * It tries to remove only the deleted rows as long as they are in one or a few
   single blocks
 * If there are more than 100 rows to delete and it starts to delete blocks
   of a size smaller than 10 it assumes that the selection to delete is widely
   distributed and that a reload of the whole model is less expensive than a
   differential update.

Fix #10167
2015-05-27 22:28:23 +02:00
Juergen E. Fischer
86d08b6c39 restore option to open the attribute table with only currently visible features
to improve performance (actually to make it usable with large tables again).

When used as initial setting in options the open attribute table will have a
fixed spatial filter to the canvas extent when it was opened.  That extent is
also highlighted to indicate the filter.

fixes #10619
2015-02-14 21:45:39 +01:00
Juergen E. Fischer
f9ace43a0f emit is not a function 2015-02-11 03:19:45 +01:00
Juergen E. Fischer
2073c03931 attribute table: fix update of sort column (fixes #10976) 2015-02-10 18:27:42 +01:00
Matthias Kuhn
0f0d16af8e [attrtable] hide "hidden" widgets 2014-06-20 10:06:22 +02:00
Martin Dobias
36988f1ac5 Few fixes in the attribute table model
They were triggering assertions in debug mode...
2014-06-18 20:48:13 +07:00
Juergen E. Fischer
2f6e6ca060 fix browser crash (fixes #10461) 2014-06-08 16:06:16 +02:00
Matthias Kuhn
ee770c4f81 Better implementation of 20015e72
Fix #10345
2014-05-27 18:20:55 +02:00
Matthias Kuhn
20015e723a Attribute table: Fix repaint on change
Fix #10345
2014-05-27 11:20:02 +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
Carl Simonson
29c8bc5375 Use begin/endResetModel instead of reset
Qt 4.6 introduced a better way of resetting models with beginResetModel()/
endResetModel(). Call beginResetModel() before resetting internal data
structures, and then endResetModel() when finished. beginResetModel()
followed by endResetModel() is the same as calling reset().

Note: reset() is deprecated and is removed in Qt 5.
2014-04-01 19:59:39 -05:00
Carl Simonson
690e7b096d Remove include of QtGui in favor of individual includes
The reason for removing instances of "#include <QtGui>" is twofold:

1) Including it will probably include more than is actually needed. Plus,
   it hide what is actually needed, especially if in a header

2) Qt 5 splits Gui into Gui and Widgets, so being explict about what is
   needed gets around this problem
2014-03-16 12:18:43 -05:00
Martin Dobias
db29ebcffb Fix #9376 (crash when sorting attribute table with no attributes) 2014-02-10 11:35:37 +07:00
Matthias Kuhn
d378f942a5 [attrtable] No checks when the model is not based on a request
Huge speedup
Fix #9315
2014-01-30 22:30:09 +01:00
Matthias Kuhn
3ba33d73fb [attrtable] Only update table at the end of an edit command
Fix #9315
2014-01-30 22:30:09 +01:00
Matthias Kuhn
5f1c8f4980 [attrtable] Don't update sort column cache when unaffected
Fix #9424
2014-01-29 22:33:26 +01:00
Nyall Dawson
85a17c246a Add QgsMapLayerAction and QgsMapLayerActionRegistry, which can be
used as a generic api for registering actions which can apply to
a specific map layer or layer type.

Create a QgsMapLayerAction for setting features as the current
atlas feature for compositions.

This work was kindly sponsored by SIGE (www.sige.ch).
2014-01-20 21:35:56 +11:00
Juergen E. Fischer
ccde424dc1 reduce debugging noise in attribute table (fixes #9315) 2014-01-10 00:51:02 +01:00
Matthias Kuhn
c0b8e9abdf [attrtable] Minimize feature requests on load (Fix #8851) 2013-11-15 15:43:41 +01:00
Matthias Kuhn
38030fdb93 [attrtable] Be less verbose by default in debug mode 2013-11-14 17:21:46 +01:00
Matthias Kuhn
331f71acba [attrtable] Selection model and request filter
* With a selection model, the way the attribute table handles selections
  can be customized. E.g. synchronized to layer selection or used to pick
  features.
* With request filters, the visible features on an attribute table can be
  limited. This will effectively reduce the subset of features the attribute
  table works on. Additional filters by means of a proxy model can of course
  further reduce the visible subset subsequently.
2013-10-07 16:17:42 +02:00
Juergen E. Fischer
814ae4c781 fix data retrieval in attribute table from geometryless spatialite tables 2013-09-30 13:34:34 +02:00
Matthias Kuhn
0c90f32007 QgsFeatureRequest: New filters FilterExpression and FilterFids 2013-09-18 18:57:52 +01:00
Matthias Kuhn
16f24112f5 [attrtable] Dismiss cached data when column is removed (Fix #8405) 2013-08-08 12:20:54 +02:00
Matthias Kuhn
a98ffed2c6 [attrtable] Fix column synchronization
Columns have been missing, after removing all columns and readding them
2013-05-18 16:25:59 +02:00
Matthias Kuhn
142223b901 [Fix #7698] Attributetable crashes on close when valuemap is used 2013-05-13 11:06:35 +02:00
Matthias Kuhn
31cecdbc51 Fix attributetable and vectorlayercache
* In the attributetable there was a mess with references and pointers, originating from 66fadee8ef.
* QgsVectorLayerCache did sometimes cache features which did not contain all information which needs to be cached and therefore corrupting the cache and leading to incomplete cache hits.
* Add a unit test for the cache problem
* Fix QgsCacheIndexFeatureId
* QgsAbstractCacheIndex::getCacheIterator now produces a QgsFeatureIterator (instead of a list of Feature Ids). This allows to combine a mixed response, partly satisfied by the cache and partly by an additional query to the backend.
2013-04-19 10:59:11 +02:00
Matthias Kuhn
66fadee8ef [FIX #7609] Fetch and cache data for sorting column in one query 2013-04-18 15:18:02 +02:00
Matthias Kuhn
268c03745f [Fix #7597] Attribute Table: Reintroduce locale aware sorting 2013-04-15 18:17:32 +02:00