Commit 094dae9d authored by EXT Arnaud Clère's avatar EXT Arnaud Clère

Update README.md

parent 21e1f1be
......@@ -25,7 +25,6 @@ See:
- [Our conclusion](#conclusion)
- [The design](DESIGN.md)
## The requirements
* **RW1. Easily customizable** for user-defined and third-part types
......@@ -305,7 +304,10 @@ QJsonReader(&baIn).bind(QCborWriter(&baOut).value());
// baOut = 0x bf656e616d65739f644a6f686e63446f65ff66686569676874fa3fe0000063616765206670686f6e65739f6b2b343420313233343536376b2b34342032333435363738ff68636f6d6d656e747360686368696c6472656e9fffff
```
Last but not least, providing in advance some `meta` data allows binding deep C++ data structures in custom ways for use with multi-dimensional Q...View classes:
### Customizing bind operations
Last but not least, one can customize the bind operation to suit specific needs in various ways.
First, Providing in advance some `meta` data allows binding deep C++ data structures in custom ways for use with multi-dimensional Q...View classes:
```cpp
QStandardItemModel tree, table, matrix;
QModelWriter<>(&matrix).meta(qmSizes ,"4,3" ).bind(transform);
......@@ -324,7 +326,7 @@ By convention:
- `qmName` allows naming data items for, e.g. XML root element and sequence items
- ...
The latest customized binds require using ad-hoc std::function like [flatten](tests/QBind/main.cpp#L996) or lambda below (mimicking Python list comprehensions):
One can also customize binds using ad-hoc std::function like [flatten](tests/QBind/main.cpp#L996) or lambda below (mimicking Python list comprehensions):
```cpp
QStandardItemModel custom;
QModelWriter<>(&custom).sequence().with([&](Seq<Cursor>&& s) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment