Warning, /sdk/cutehmi/tools/cutehmi.view.4/README.md is written in an unsupported language. File is not indexed.

0001 # View
0002 
0003 ![Development status](doc/status-gamma.svg)
0004 
0005 Client, GUI application, which allows one to run CuteHMI project in a window.
0006 
0007 By default this tool shows only a simple help screen.
0008 
0009 ![Default view screenshot](doc/screenshot.png)
0010 
0011 CuteHMI approach is to treat each project as a first-class QML extension, so the purpose of the tool is to load specified extension
0012 and display one of its QML components. Any extension that provides graphical UI QML component can be loaded as *cutehmi.view.4*
0013 project. Use command line argument to specify an extension.
0014 
0015 For example to run [Simple View](../../extensions/CuteHMI/Examples/SimpleView.2/) example use following command.
0016 ```
0017 cutehmi.view.4 CuteHMI.Examples.SimpleView.2
0018 ```
0019 
0020 To run project from QtCreator click `Projects` -> `Run`. Select `cutehmi.view.4` from `Run configuration`. In the
0021 `Command line arguments` box type: `CuteHMI.Examples.SimpleView.2`.
0022 The window should look similar to the screenshot below.
0023 
0024 ![SimpleView screenshot](doc/SimpleView.png)
0025 
0026 Default loader picks `View` as default QML component to load. Component can be specified with second positional argument. For
0027 example following displays `RectangularElement` component from the previous example.
0028 ```
0029 cutehmi.view.4 CuteHMI.Examples.SimpleView.2 RectangularElement
0030 ```
0031 
0032 One can also use `--init` option to replace default loader with custom one.
0033 
0034 You can use `--help` command line argument to see a list of all possible command line options.
0035 
0036 For debug builds use `cutehmi.view.4.debug` instead of `cutehmi.view.4`.
0037 
0038 ## Providing Qt Quick Controls configuration file
0039 
0040 Qt allows for configuring the style of application with a special `qtquickcontrols2.conf` file. This file has to be built into
0041 application resources. Extension may provide it within `cutehmi.view.rcc` resource file, which shall be intalled into extension
0042 dedicated directory. For this `cutehmi.rcc` Qbs module can be used, which generates `rcc` artifacts from `qrc` files. Extension just
0043 needs to put `qtquickcontrols2.conf` (root prefix) inside `cutehmi.view.qrc`, declare dependency on `cutehmi.rcc` module and assign
0044 `cutehmi.qrc` tag to the `cutehmi.view.qrc` file (module `cutehmi.rcc` uses distinct tag to prevent `Qt.core` from creating `cpp`
0045 files with `qrc` resources, which is not desired for simple QML extensions).
0046 
0047 ```
0048 Depends { name: "cutehmi.rcc" }
0049 
0050 Group {
0051     files: "cutehmi.view.qrc"
0052     fileTags: "cutehmi.qrc"
0053 }
0054 ```
0055 
0056 Resource file can be also specified with `--resource` option.
0057 
0058 ## Changes
0059 
0060 Compared to previous major version following changes were made.
0061 - View looks for `View` component instead of `Main`.
0062 - Extension is specified with first positional argument instead of `--extension` argument.
0063 - Component is specified with second positional argument instead of `--component` argument.
0064 - It is possible to register resource on startup (by the extension with `cutehmi.view.rcc` lookup or by the user with `--resource`
0065   argument).