Commit graph

7 commits

Author SHA1 Message Date
Olivier Goffart
5030431caa C++: make sure we do not crash if a Model::row_data returns nullopt
Rust had a test for it, but C++ not yet

Reported on https://chat.slint.dev/public/pl/pcqefc3fbff3xfuio3uhp58ate
2025-05-30 15:47:13 +02:00
Olivier Goffart
cd8ab8ce53
Fix array index access at negative index
Conversion from negative float to unsigned is saturating to 0 in rust
and undefined behavior in C++, we should therefore handle the case
properly

Fixes #8222
2025-04-22 11:28:09 +02:00
Olivier Goffart
12a2493269
C++: add notify_ prefix to the Model functions and add docs
* C++: add `notify_` prefix to the Model functions and add docs

The `notify_*` function are used by the model to notify the view.
As opposed to the function without the prefix, which are used to get
notified when a source model change

Fixes #3888
CC #3945 (for the docs about thread safety)
2025-04-03 07:59:15 +02:00
Olivier Goffart
4145eafe14 C++: Fix segfault when calling Model::row_changed() after Model::reset()
Fixes #8021
2025-04-02 12:41:57 +02:00
Olivier Goffart
bf3c47f1fa C++: add code sample form model adapters
Fixes #4967
2025-03-31 16:13:45 +02:00
Olivier Goffart
a80f14e7d8 Fix re-instentiating if elements when the condition is dirty
Fixes #3953
2025-03-27 15:37:07 +01:00
Olivier Goffart
54a3506f4d C++: move model code to its own file
Most of the slint.h file is used for model code, so before doing some
work on the model i wanted to refactor the code in its own file.
Since the model need access to the ComponentHandle, i also had to move
that in its own file
2025-03-25 10:37:20 +01:00