Skip to content
Discussion options

You must be logged in to vote

The global<T>() accessor is generated, but only for globals that are exported (or re-exported) from the main file

 // in your main .slint file:
 export { Logic } from "logic.slint";

Then app->global<Logic>() will be available in the generated header.

Please don't use the globals member you found, it's an internal implementation detail of the generated code, not part of the public API. It can change or be renamed at any time without notice. Always go through global<T>().

Working C++ example in the repo: https://github.com/slint-ui/slint/blob/master/demos/printerdemo/cpp/main.cpp printer_demo->global<PrinterQueue>()

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@mathisloge
Comment options

Answer selected by mathisloge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants