Details
-
Suggestion
-
Resolution: Out of scope
-
Not Evaluated
-
None
-
None
Description
There are some use cases where you would like to make a QML binding to a function that can change based on e.g. some system level properties.
For example:
class Screen : public QObject
{
...
Q_INVOKABLE QString resourcePath(const QString &path);
}
...where the return value of "resourcePath" depends on the screen resolution and/or dpi
And in QML you would write:
Loader
{ source: screen.resourcePath("SomeItem.qml") }(Yes... Screen properties do not change in run-time in real life, but they could do so in testing environment)