Jos van den Oever
385ae17bb7
Pass the emitter as mutable. It is pointless otherwise.
2018-10-26 00:32:02 +02:00
Jos van den Oever
b603a2262b
Only allow mutable objects to call back into C++
...
When an object calls into C++, that C++ code may again call into Rust.
The original call might have an immutable reference and the nested
call could receive a mutable reference. That is not allowed and
undefined behaviour. For this reason, calling into C++ is only allowed
from mutable objects.
2018-10-25 18:06:19 +02:00
Jos van den Oever
4a38793882
Add documentation and tweak function name
2018-10-10 00:07:25 +02:00
Jos van den Oever
08876fd757
Take changes in .h and .cpp files into account during build
2018-10-09 18:11:37 +02:00
Jos van den Oever
ea876ec81d
Add functions for building Qt applications with Cargo
2018-10-09 00:05:56 +02:00
Jos van den Oever
df91226979
Expose function for reading the configuration
2018-09-30 00:10:22 +02:00
Jos van den Oever
fac04fd6d4
Remove unneeded annotations
2018-09-29 23:47:23 +02:00
Jos van den Oever
13d8d1cf1d
Use AtomicPtr instead of Mutex
2018-09-29 23:28:24 +02:00
Jos van den Oever
fe9731819f
Use the version number from Cargo.toml
2018-09-28 23:54:42 +02:00
Jos van den Oever
6ee8ca626d
Add function to create bindings from runtime Config object
2018-09-28 23:38:44 +02:00
Jos van den Oever
baaa8f230c
Use full include path to Qt headers
2018-09-28 22:36:56 +02:00
Jos van den Oever
d7860d9031
Also check for module directory
2018-09-28 18:40:01 +02:00
Jos van den Oever
034e5526cf
Add missing ?
2018-09-28 18:08:19 +02:00
Jos van den Oever
b3e43ae1d2
Handle result of write! and writeln!
...
This is probably the patch with the largest amount of question marks added to code ever.
2018-09-28 18:05:10 +02:00
Jos van den Oever
d6e88b0ab6
Add missing file
2018-09-28 12:24:30 +02:00
Jos van den Oever
d7e4f1362d
Port rust_qt_binding_generator from C++ to Rust
2018-09-28 12:11:57 +02:00
Friedrich W. H. Kossebau
d5029d7217
Use Q_SIGNALS/Q_EMIT instead of signals/emit in generated sources
...
Summary:
Avoid potential clashes on symbols/macros from other libraries
Allows to use the generated header in projects which have
DQT_NO_SIGNALS_SLOTS_KEYWORDS or DQT_NO_KEYWORDS set
Reviewers: vandenoever
Reviewed By: vandenoever
Differential Revision: https://phabricator.kde.org/D15545
2018-09-16 19:25:26 +02:00
Friedrich W. H. Kossebau
dff4e2a0d2
Use nullptr in generated C++ sources
...
Reviewers: vandenoever
Reviewed By: vandenoever
Differential Revision: https://phabricator.kde.org/D15553
2018-09-16 19:14:54 +02:00
Friedrich W. H. Kossebau
1ce86bd5d5
Add break; statements in the generated switch code for model::data()
...
Summary:
Compiler complains about generated code with
warning: this statement may fall through
and is slightly right, as the code might fall through if a role is used
which is not catched for a column.
Reviewers: vandenoever
Reviewed By: vandenoever
Differential Revision: https://phabricator.kde.org/D15541
2018-09-15 22:02:17 +02:00
Jos van den Oever
0192124c70
Fix some clippy issues in written and generated code
2018-09-11 23:29:06 +02:00
Jos van den Oever
9549c50217
Automatically update index when calling layoutChanged
2018-09-11 23:06:52 +02:00
Jos van den Oever
f0eb78457b
Make the model struct that emits model signals clonable
2018-09-08 23:13:20 +02:00
Jos van den Oever
96376517c6
Add bindings for layoutAboutToBeChanged and layoutChanged
2018-09-08 22:48:59 +02:00
Jos van den Oever
b702c980af
Add bindings for beginMoveRows and endMoveRows
2018-09-08 21:54:34 +02:00
Jos van den Oever
2a3123eda3
Consistently use Option instead of two arguments (value and bool)
2018-09-08 21:12:00 +02:00
Jos van den Oever
754214e7b4
snapshot
2018-09-08 20:47:48 +02:00
Jos van den Oever
32fed925e9
Intruduce rustByFunction
...
rustByFunction lets a getter get a value even if it is not possible
to return a value by reference.
rustByFunction passes a getter function in the getter. This can be
called with the value instead of returning a reference.
2018-08-26 19:47:25 +02:00
Jos van den Oever
73b9c89b30
Check function parameters and return type for use of QString and QByteArray
2018-08-05 19:51:38 +02:00
Jos van den Oever
cdc50304b3
Remove unneeded boolean hasStringWrite
2018-08-05 19:36:50 +02:00
Jos van den Oever
c5b09ca04c
Fix the generated implementation.rs variable name
...
It was "item" but should be "index".
2018-08-05 14:41:22 +02:00
Jos van den Oever
7f2f4b71a4
Prefix signal with property name
2018-06-30 20:23:29 +02:00
Jos van den Oever
7d4b55b90a
Use "index" instead of "item" for the index in the model
2018-06-08 14:21:35 +02:00
Jos van den Oever
b8fcb67112
Add function to look up role number from role name
2018-05-19 17:08:18 +02:00
Jos van den Oever
e3bfa85849
Make the roles property in the bindings.json optional
2018-05-19 14:01:11 +02:00
Jos van den Oever
c27e451066
Check conversion between c_int and usize
2018-05-18 09:36:05 +02:00
Jos van den Oever
8949026c63
Make primitive types more precise and add test
2018-05-17 10:47:18 +02:00
Jos van den Oever
75d5406943
Add more tests
2018-05-16 22:38:30 +02:00
Jos van den Oever
e636d82da5
More precise types
2018-05-16 19:19:21 +02:00
Jos van den Oever
392153f9a9
Allow optional primitive object properties
2018-05-15 21:45:05 +02:00
Jos van den Oever
a051556990
Add more tests
2018-05-15 17:08:58 +02:00
Jos van den Oever
6099ee3c3d
Add more integer types
2018-05-13 14:25:32 +02:00
Jos van den Oever
12cebe88bb
Make sure that the optional types in the bindings are POD types
2018-05-13 13:10:59 +02:00
Jos van den Oever
848b472c3f
Use QVariant::fromValue and QVariant::setValue to avoid type conversion
2018-05-13 12:48:32 +02:00
Jos van den Oever
4dba74acbd
Beter whitespace
2018-05-13 02:27:16 +02:00
Jos van den Oever
c87339ed6a
Add type check when converting QVariant in QAbstractItemModel::setData
2018-05-13 02:21:36 +02:00
Jos van den Oever
8ccb2e519b
cleanup
2018-05-12 14:28:41 +02:00
Jos van den Oever
67e6e8a9bf
Convert test_functions
2018-05-12 13:58:43 +02:00
Jos van den Oever
af7b64b82d
Convert demo
2018-05-02 22:18:37 +02:00
Jos van den Oever
5bcb96b561
Convert test_object_list
2018-05-02 17:02:07 +02:00
Jos van den Oever
18368ee142
Convert test_object_types
2018-05-02 01:23:06 +02:00