summaryrefslogtreecommitdiffstats
path: root/sample-qml
diff options
context:
space:
mode:
authorTasuku Suzuki <tasuku.suzuki@qt.io>2016-12-02 11:37:58 +0900
committerTasuku Suzuki <tasuku.suzuki@qt.io>2016-12-02 11:44:24 +0900
commit346d1b3492fcbc26e7bff085b5d480fd7a627911 (patch)
tree33aa09304daa26b9c47d86d6bd6e9949fb0360ce /sample-qml
parent6130b67afe48de7eb0e4594d3210963b88e93fe5 (diff)
sample-qml: load qml from Qt resources
embed every assets in the binary and load its contents from there Change-Id: If0ca9342f82ab3ac8badf6bd75755a24001d2da7 Signed-off-by: Tasuku Suzuki <tasuku.suzuki@qt.io>
Diffstat (limited to 'sample-qml')
-rw-r--r--sample-qml/dummyimports/Automotive/ClimateControl/ClimateControlItem.qml13
-rw-r--r--sample-qml/dummyimports/Automotive/ClimateControl/ClimateControlItem.qmlcbin0 -> 1389 bytes
-rw-r--r--sample-qml/dummyimports/Automotive/ClimateControl/qmldir1
-rw-r--r--sample-qml/main.cpp18
-rw-r--r--sample-qml/qml.qrc96
5 files changed, 113 insertions, 15 deletions
diff --git a/sample-qml/dummyimports/Automotive/ClimateControl/ClimateControlItem.qml b/sample-qml/dummyimports/Automotive/ClimateControl/ClimateControlItem.qml
new file mode 100644
index 0000000..2688db6
--- /dev/null
+++ b/sample-qml/dummyimports/Automotive/ClimateControl/ClimateControlItem.qml
@@ -0,0 +1,13 @@
+import QtQuick 2.0
+
+QtObject {
+ property int zone: 0
+ property int fanSpeedLevel: 0
+ property int targetTemperature: 0
+ property bool airConditioning: false
+ property bool heater: false
+ property int seatHeater: 0
+ property int seatCooler: 0
+ property bool airCirculation: false
+ property int steeringWheelHeater: 0
+}
diff --git a/sample-qml/dummyimports/Automotive/ClimateControl/ClimateControlItem.qmlc b/sample-qml/dummyimports/Automotive/ClimateControl/ClimateControlItem.qmlc
new file mode 100644
index 0000000..9961cde
--- /dev/null
+++ b/sample-qml/dummyimports/Automotive/ClimateControl/ClimateControlItem.qmlc
Binary files differ
diff --git a/sample-qml/dummyimports/Automotive/ClimateControl/qmldir b/sample-qml/dummyimports/Automotive/ClimateControl/qmldir
new file mode 100644
index 0000000..8a44272
--- /dev/null
+++ b/sample-qml/dummyimports/Automotive/ClimateControl/qmldir
@@ -0,0 +1 @@
+ClimateControlItem 1.0 ClimateControlItem.qml
diff --git a/sample-qml/main.cpp b/sample-qml/main.cpp
index 9238a9b..670decc 100644
--- a/sample-qml/main.cpp
+++ b/sample-qml/main.cpp
@@ -30,22 +30,10 @@ int main(int argc, char *argv[])
enabled = mp_libHomeScreen->renderAppToAreaAllowed(appcategory, FULLSCREEN);
if(enabled)
{
- QString target(getenv("AFM_APP_INSTALL_DIR"));
- qDebug("AFM_APP_INSTALL_DIR is " + target.toLatin1());
+ engine.addImportPath(QStringLiteral(":/imports"));
+ engine.addImportPath(QStringLiteral(":/dummyimports"));
- if(NULL == target)
- {
- target = ".";
- }
-
- QString load_path;
- load_path = target + "/imports";
- engine.addImportPath(load_path);
- load_path = target + "/dummyimports";
- engine.addImportPath(load_path);
- load_path = target + "/main.qml";
-
- engine.load(QUrl(load_path));
+ engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
std::vector<int> surfaceIdList;
int pid = getpid();
diff --git a/sample-qml/qml.qrc b/sample-qml/qml.qrc
index 680a07e..52e2f08 100644
--- a/sample-qml/qml.qrc
+++ b/sample-qml/qml.qrc
@@ -18,5 +18,101 @@
<file>dummyimports/radio/qmldir</file>
<file>dummyimports/com/pelagicore/qmldevinfo/qmldir</file>
<file>dummyimports/amb/qmldir</file>
+ <file>apps/HVAC/models/HVACModel.qml</file>
+ <file>apps/HVAC/models/qmldir</file>
+ <file>apps/HVAC/models/TemperatureModel.qml</file>
+ <file>imports/system/App.qml</file>
+ <file>imports/system/System.qml</file>
+ <file>imports/components/AwesomeIcon.qml</file>
+ <file>imports/components/Box.qml</file>
+ <file>imports/components/BoxButton.qml</file>
+ <file>imports/components/BoxHeading.qml</file>
+ <file>imports/components/Button.qml</file>
+ <file>imports/components/DateTime.qml</file>
+ <file>imports/components/HexGrid.qml</file>
+ <file>imports/components/HexSwitch.qml</file>
+ <file>imports/components/InsetShadow.qml</file>
+ <file>imports/components/InShadow.qml</file>
+ <file>imports/components/Label.qml</file>
+ <file>imports/components/NumberPad.qml</file>
+ <file>imports/components/OutShadow.qml</file>
+ <file>imports/components/Switch.qml</file>
+ <file>imports/radio/Radio.qml</file>
+ <file>imports/utils/Marker.qml</file>
+ <file>imports/utils/Style.qml</file>
+ <file>imports/vehicle/ClimateModel.qml</file>
+ <file>imports/vehicle/FuelModel.qml</file>
+ <file>imports/vehicle/PositionModel.qml</file>
+ <file>imports/vehicle/SpeedModel.qml</file>
+ <file>imports/vehicle/TemperatureModel.qml</file>
+ <file>dummyimports/amb/AutomotivePropertyItem.qml</file>
+ <file>dummyimports/com/pelagicore/qmldevinfo/DevInfo.qml</file>
+ <file>dummyimports/radio/Radio.qml</file>
+ <file>dummyimports/Automotive/ClimateControl/ClimateControlItem.qml</file>
+ <file>dummyimports/Automotive/ClimateControl/ClimateControlItem.qmlc</file>
+ <file>dummyimports/Automotive/ClimateControl/qmldir</file>
+ <file>apps/HVAC/images/defrost_front_off.png</file>
+ <file>apps/HVAC/images/defrost_front_on.png</file>
+ <file>apps/HVAC/images/defrost_max_off.png</file>
+ <file>apps/HVAC/images/defrost_max_on.png</file>
+ <file>apps/HVAC/images/defrost_rear_off.png</file>
+ <file>apps/HVAC/images/defrost_rear_on.png</file>
+ <file>apps/HVAC/images/fan_bar_off.png</file>
+ <file>apps/HVAC/images/fan_bar_on.png</file>
+ <file>apps/HVAC/images/fan_control_ac_off.png</file>
+ <file>apps/HVAC/images/fan_control_ac_on.png</file>
+ <file>apps/HVAC/images/fan_control_auto_off.png</file>
+ <file>apps/HVAC/images/fan_control_auto_on.png</file>
+ <file>apps/HVAC/images/fan_control_circ_off.png</file>
+ <file>apps/HVAC/images/fan_control_circ_on.png</file>
+ <file>apps/HVAC/images/fan_dir_down_off.png</file>
+ <file>apps/HVAC/images/fan_dir_down_on.png</file>
+ <file>apps/HVAC/images/fan_dir_right_off.png</file>
+ <file>apps/HVAC/images/fan_dir_right_on.png</file>
+ <file>apps/HVAC/images/fan_dir_up_off.png</file>
+ <file>apps/HVAC/images/fan_dir_up_on.png</file>
+ <file>apps/HVAC/images/fan_icon_off.png</file>
+ <file>apps/HVAC/images/hazard_blink.png</file>
+ <file>apps/HVAC/images/hazard_off.png</file>
+ <file>apps/HVAC/images/hazard_on.png</file>
+ <file>apps/HVAC/images/left_heat_seat_off.png</file>
+ <file>apps/HVAC/images/left_heat_seat_on.png</file>
+ <file>apps/HVAC/images/right_heat_seat_off.png</file>
+ <file>apps/HVAC/images/right_heat_seat_on.png</file>
+ <file>apps/HVAC/images/separator.png</file>
+ <file>apps/HVAC/images/defrost_front_off.svg</file>
+ <file>apps/HVAC/images/defrost_front_on.svg</file>
+ <file>apps/HVAC/images/defrost_max_off.svg</file>
+ <file>apps/HVAC/images/defrost_max_on.svg</file>
+ <file>apps/HVAC/images/defrost_rear_off.svg</file>
+ <file>apps/HVAC/images/defrost_rear_on.svg</file>
+ <file>apps/HVAC/images/drag_knob.svg</file>
+ <file>apps/HVAC/images/fan_bar_on.svg</file>
+ <file>apps/HVAC/images/fan_control_ac_off.svg</file>
+ <file>apps/HVAC/images/fan_control_ac_on.svg</file>
+ <file>apps/HVAC/images/fan_control_auto_off.svg</file>
+ <file>apps/HVAC/images/fan_control_auto_on.svg</file>
+ <file>apps/HVAC/images/fan_control_circ_off.svg</file>
+ <file>apps/HVAC/images/fan_control_circ_on.svg</file>
+ <file>apps/HVAC/images/fan_dir_down_off.svg</file>
+ <file>apps/HVAC/images/fan_dir_down_on.svg</file>
+ <file>apps/HVAC/images/fan_dir_right_off.svg</file>
+ <file>apps/HVAC/images/fan_dir_right_on.svg</file>
+ <file>apps/HVAC/images/fan_dir_up_off.svg</file>
+ <file>apps/HVAC/images/fan_dir_up_on.svg</file>
+ <file>apps/HVAC/images/hazard_blink.svg</file>
+ <file>apps/HVAC/images/hazard_off.svg</file>
+ <file>apps/HVAC/images/hazard_on.svg</file>
+ <file>apps/HVAC/images/left_heat_seat_off.svg</file>
+ <file>apps/HVAC/images/left_heat_seat_on.svg</file>
+ <file>apps/HVAC/images/left_number_bg.svg</file>
+ <file>apps/HVAC/images/left_number_cover.svg</file>
+ <file>apps/HVAC/images/right_heat_seat_off.svg</file>
+ <file>apps/HVAC/images/right_heat_seat_on.svg</file>
+ <file>apps/HVAC/images/right_number_bg.svg</file>
+ <file>apps/HVAC/images/right_number_cover.svg</file>
+ <file>apps/HVAC/images/static_parts_bg.svg</file>
+ <file>apps/HVAC/images/temp_bar_on_left.svg</file>
+ <file>apps/HVAC/images/temp_bar_on_right.svg</file>
</qresource>
</RCC>