We currently forward declare classes as we use them in functions.
But this breaks if classes with the same name were declared in the
parent namespace. As shown with this example
```C++
// Uncomment that line to make the code break
//struct SharedGlobals;
namespace ns {
// Is that a forward declaration in `ns`?
// Depends if it was declared before in the parent namespace
void foo(struct SharedGlobals *x) {}
// Actualy define ns::SharedGlobal
struct SharedGlobals { int x; };
int xyz() {
SharedGlobals globals;
foo(&globals);
}
}
```
So make sure we forward-declare the classes properly to be more robust
and be able to include generated file with namespace after a file
without namespace
CC #2909
I found `mise` a tool to help manage development projects.
https://mise.jdx.dev/
It basically can manage ENV vars based on the directory you are in,
manages tools you need (and makes thoser available based on the
directory you are in), and allows to define simple tasks that can
then be shared between developers.
Tools can be found in npm, pipx, aqua, binaries on github, ...
and it tries to verify signatures and all that (if supported by the
repo the data comes from).
I replaces the entire autofix workflow with mise tooling and tasks,
just to give it a try :-)
To reproduce:
```sh
> cargo install mise # to get the tool itself
# Follow the necessary step
# https://mise.jdx.dev/installing-mise.html#shells
# to intergate into your shell
> cd /your/slint/folder
# Mise will now ask whether or not to trust this dir and prints the
# command needed to do so. Run that.
> mise install # Install all the tools defined in .mise/config.toml
# Add a .mise.local.toml with local overrides. Git will ignore this file.
# Or add tasks into .mise/tasks/local ... Git will also ignore those.
> mise run 'ci:autofix:**:all' # To run all the ci:autofix tasks.
```
It is so much fatser to see these checks fail locally than it is to
bother CI with them :-)
The length is an important property of a string and should be available
as a getter. The new size() method is consistent with std::string.
ChangeLog: [C++] Added `SharedString::size()`
Updated the version from 1.1 to 1.2
Renamed the header to "Slint Royalty-free Desktop, Mobile, and Web Applications License"
Added definition of "Mobile Application" and grant of right
Moved "Limitations" to 3rd section and "License Conditions - Attributions" to 2nd section
Added flexibility to choose between showing "MadeWithSlint" as a dialog/splash screen or on a public webpage
Moved the para on copyright notices to section under "Limitations"
They were causing infinite recursion because they were calling
themselves.
Also add the missing MapModel::reset
Yet another motivation for https://github.com/slint-ui/slint/issues/3888
as the code was mixing the `reset` function on the adapter meaning
"please re-apply the adapter filter/map/sort function" with the `reset`
function on Model which means "the subclass has changed and we should
notify listeners".
Fixes#4968
This was requested by a customer recently and it seems rather straight-forward to implement and offer. `clear()` mirrors `std::vector::clear()` and `set_vector` mirrors the `set_vec` we have in Rust.
... after firing once. `running()` will now return `true` for such timers
till just before the callback is run and `false` after that point.
Add test a new test and update existing C++ tests to make them comply
with the changed behavior.
... and to use an external compiler
For example, this is how one only build the compiler:
```
cmake .. -DSLINT_BUILD_RUNTIME=OFF -DCMAKE_INSTALL_PREFIX=/tmp/slint_compiler
make install
```
And this only build the runtime
```
cmake .. -DSLINT_FEATURE_COMPILER=OFF -DCMAKE_INSTALL_PREFIX=/tmp/install_runtime
make install
```
And then this can be used in a project like so:
```
cmake .. -DCMAKE_PREFIX_PATH=/tmp/install_runtime/ -DSLINT_COMPILER=/tmp/install_compiler/bin/slint-compiler
```