64 Commits

Author SHA1 Message Date
Pierre-Yves Siret
a96701bb85 [test] Add a new test revealing a bug in IndexFilter 2017-09-03 17:43:17 +02:00
Pierre-Yves Siret
84519a2a8e [doc] Generate documentation 2017-09-02 18:32:31 +02:00
Pierre-Yves Siret
9009d18554 Merge branch 'feature/filters-and-sorters' 2017-09-02 18:31:04 +02:00
Pierre-Yves Siret
14c0acc993 [doc] Adding some documentation
🔥 📖
2017-09-02 18:10:01 +02:00
Pierre-Yves Siret
985c5b0e55 refactor: ascendingSortOrder property becomes sortOrder
Changed type from a bool to the Qt::SortOrder enum.

It's still possible to use the ascendingSortOrder bool property (for
now).
2017-09-02 16:07:22 +02:00
Pierre-Yves Siret
1c0731a38c refactor: copy PatternSyntax enum to RegExpFilter 2017-09-02 16:03:34 +02:00
Tim Angus
598bd7295b Improve warning to handle C++14 case (#42) 2017-08-16 10:49:22 +02:00
Alberto Mardegan
c723de3fb5 Update version number in README.md (#39) 2017-07-26 12:14:41 +02:00
Pierre-Yves Siret
070597a9d4 refactor: remove superfluous signal to slot connection
Now Filter::filterChanged and Sorter::sorterChanged are both protected
functions and not anymore signals.
Derived classes call these functions directly to indicated that they have
changed.
2017-06-07 16:12:27 +02:00
Pierre-Yves Siret
e109c91553 Add *.qmlc in .gitignore 2017-06-07 02:19:47 +02:00
Pierre-Yves Siret
ac45b581d6 fix: workaround for ListModel starting with no roles
A ListModel with no roles first won't emit modelReset when its roles
change (QTBUG-57971).

Fixes #26
2017-06-07 02:10:22 +02:00
Pierre-Yves Siret
7c72171c7a test: add some tests for the builtin convenience filters 2017-06-07 01:28:59 +02:00
Pierre-Yves Siret
f2edc17ad6 test: Enable no_keywords config for the test project 2017-02-28 01:04:22 +01:00
Pierre-Yves Siret
79b651c9fd feat: Add mapToSource and mapFromSource helpers
Add helper functions to map a row number to and from a source model.
This avoids the need of creating a QModelIndex first when mapping
indexes between the proxy model and the source model.
Mapping with a QModelIndex is still possible, the return type of the
helpers will be the same as the one of the input parameter, a QModelIndex
or a row number.

Fix #23
2017-02-28 00:46:59 +01:00
Pierre-Yves Siret
cb26d890b9 Added 2 helper functions : get & roleForName
Closes #24
2017-02-16 19:07:25 +01:00
Pierre-Yves Siret
56f78c7037 Fixes the capitalization of RegExpFilter
From RegexpFilter to RegExpFilter (both in C++ and QML)
Fixes #21
2017-01-24 19:25:55 +01:00
Pierre-Yves Siret
fcd8d07fc9 Fixes the sorting not being invalidated when disabling a Sorter
Fixes #22
2017-01-24 19:19:33 +01:00
Pierre-Yves Siret
8fc7679ab8 Fixes a bug where sorters wouldn't get cleared
This bug was exposed by commit 9a72c73226ce193c733513484ecf9292bce8601b
Also fixes a cosmetic typo in a variable name
2017-01-24 19:16:35 +01:00
Pierre-Yves Siret
9a72c73226 Added tests to verify the core sorter functionnality
Issue #22 where a Sorter being disabled doesn't trigger a sort change is
exposed.
2017-01-24 19:07:15 +01:00
Pierre-Yves Siret
a3d95d2290 Check the roles after a row is added for a model with no roles intially
Fixes #13
2017-01-08 22:54:44 +01:00
Pierre-Yves Siret
edf53b56ef Add tests to check if the proxy roles are synched with the source model 2017-01-08 22:07:45 +01:00
PYS
10e03e32b6 Add the possibility to specify a negative index in IndexFilter to start from the end 2016-12-02 15:35:53 +01:00
PYS
65fb8595f8 Modify .gitignore to hide shadow builds 2016-12-02 14:22:53 +01:00
Pierre-Yves Siret
ace384cd22 Fixes bug where a 0 minimum/maximumIndex has no effect in IndexFilter
Closes #15
2016-12-02 02:29:17 +01:00
Pierre-Yves Siret
90d0c567a8 Fixes the filtering not being invalidated when disabling a filter
Fixes #14
2016-12-02 02:24:44 +01:00
Pierre-Yves Siret
f542f18976 Allow compilation when using CONFIG += no_keywords
Fixes #19
2016-12-02 02:13:16 +01:00
Keith Kyzivat
fea3718d99 Add tests infrastructure, starting with RangeFilter and IndexFilter
* Add infrastructure for testing SortFilterProxyModel
* Add tests for RangeFilter.
* Add tests for IndexFilter.
2016-12-02 01:38:22 +01:00
Keith Kyzivat
472b344ff6 Add a basic .gitignore
* Ignore basic stuff, like qt creator user project files, object
  files, vim backup files, Makefiles, etc.
2016-12-02 01:36:28 +01:00
Keith Kyzivat
7e2dff0703 Consistent initial min,max values for IndexFilter
* Set initial min,max values for IndexFilter to 0.
* Improves testability, allows one to leave-off setting min, max
  if they want 0 for the value.
2016-12-02 01:36:27 +01:00
Keith Kyzivat
a898810c24 Add min/maximumInclusive properties to RangeFilter (#16)
* Allow one to configure RangeFilters to be able to exclude the
  minimum and/or maximum values in the range.
* Defaults to including both minimum and maximum values, leaving prior
  behavior unchanged.
2016-11-17 20:24:04 +01:00
oKcerG
94c1c36436 Updated README with removed and renamed properties 2016-10-20 13:59:44 +02:00
oKcerG
c1fe48369d Added an usage for the filters and sorters list properties in the README 2016-10-20 13:47:24 +02:00
oKcerG
d3bee768f9 added ExpresionSorter 2016-10-12 20:28:01 +02:00
oKcerG
9a467ca288 Sort even though there's no sortRoleName set
Fixes #7
2016-10-12 19:37:35 +02:00
oKcerG
0b850c37ec Added a ascendingSortOrder bool property in QSFPM (and removed the sortOrder property) 2016-10-12 02:23:45 +02:00
oKcerG
5db29ca53d Added a sorters list property in QSFPM 2016-10-12 02:14:28 +02:00
oKcerG
0ec51c16bd Register Sorters types to QML 2016-10-12 01:47:08 +02:00
oKcerG
6513ae8489 added RoleSorter 2016-10-12 01:44:55 +02:00
oKcerG
e96f821e28 Create the Sorter class 2016-10-12 01:41:48 +02:00
oKcerG
e8e212df9c added FilterContainer, AnyOfFilter, NoneOfFilter 2016-10-12 01:36:05 +02:00
oKcerG
407e596ab7 Don't filter rows until the proxy is completely initialized 2016-10-12 01:34:55 +02:00
oKcerG
6224f853f6 added ExpressionFilter 2016-10-12 01:11:07 +02:00
oKcerG
41f61077f1 added RangeFilter 2016-10-12 01:06:01 +02:00
oKcerG
9f97b12e8f added RegexpFilter 2016-10-12 01:02:34 +02:00
oKcerG
ac63048d87 added IndexFilter 2016-10-12 00:56:17 +02:00
oKcerG
fc7fec5e1d Bump module version to 0.2 2016-10-12 00:45:51 +02:00
oKcerG
c6cd9792ea Added a filters list property in QQSFPM 2016-10-12 00:45:00 +02:00
oKcerG
14ef004a21 Register Filters type to QML 2016-10-12 00:31:11 +02:00
oKcerG
76c588cbea Created a qqsfpm namespace 2016-10-12 00:15:26 +02:00
oKcerG
f2f4450d92 Added RoleNameFilter and ValueFilter 2016-10-12 00:09:24 +02:00