mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-01 14:21:16 +00:00
Complete the generated C++ code docs to mention globals
But there's an entire section still missing with an example.
This commit is contained in:
parent
fe94f93755
commit
6d05959c93
1 changed files with 5 additions and 0 deletions
|
@ -23,6 +23,7 @@ This class will have the following public member functions:
|
|||
* `invoke_<callback_name>` function which takes the callback argument as parameter and call the callback.
|
||||
* `on_<callback_name>` function which takes a functor as an argument and sets the callback handler
|
||||
for this callback. the functor must accept the type parameter of the callback
|
||||
* A `global` function, to provide access to any exported global singletons.
|
||||
|
||||
## Example
|
||||
|
||||
|
@ -77,6 +78,10 @@ public:
|
|||
/// Sets the callback handler for the `hello` callback.
|
||||
template<typename Functor> inline void on_hello (Functor && callback_handler) const;
|
||||
|
||||
// Returns a reference to a global singleton that's exported.
|
||||
inline template<typename T>
|
||||
const T &global() const;
|
||||
|
||||
private:
|
||||
/// private fields omitted
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue