K
K
Kastuś2018-04-07 22:50:50
QML
Kastuś, 2018-04-07 22:50:50

Qml global variables?

I need to display in a window depending on settings in another window.
To do this, you need to create these settings in c ++ and import them.
Or is it possible in some other way?
property int/string/bool is not interesting to breed a bunch of lines

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
Jacob E, 2018-04-08
@Gytim

property int/string/bool is not interesting to breed a bunch of lines

It's not clear what the question is:
  • You can make properties in main.qml, they will be available from any QML file/window.
  • You can wrap them in a separate component and create it in main.qml, it will be prettier, treated as object_id.property_name.
  • You can wrap all this in a C ++ object with a Q_PROPERTY set and throw it into the global context, it will also be available from anywhere.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question