How to create Ubuntu Touch application with c++ core? In examples I see only pure QML apps.
Ubuntu – Ubuntu Touch app with c++ core and QML interface. How to create
application-developmentcqmlqtubuntu-touch
Related Solutions
I too had the same problem. Its actually related to the permissions. Try to lauch utouch using the 'sudo'. Hope It would help if its the same as mine
You can use QChart.js - QML bindings for Charts.js (a simple HTML5 Charts javascript library using the canvas element)
I forked the project here to support resize events (for a desktop use). I basically need to reset the canvas context to allow resize events to properly redraw the surface with an updated window size (See http://qt-project.org/forums/viewthread/37313)
QML example:
The following snippet creates the above pie chart page:
import QtQuick 2.0
import QtQuick.Layouts 1.1
import Ubuntu.Components 0.1
import "."
import "QChart.js" as Charts
MainView {
id: root
width: units.gu(50)
height: units.gu(80)
PageStack {
id: pageStack
Component.onCompleted: push(page0)
Page {
id: page0
title: i18n.tr("Test Results")
ColumnLayout {
spacing: units.gu(2)
anchors.margins: units.gu(2);
anchors.fill: parent
Label {
fontSize: "x-large"
text: "Summary"
}
Chart {
id: chart_pie;
Layout.fillHeight: true
Layout.fillWidth: true
chartAnimated: true;
chartAnimationEasing: Easing.Linear;
chartAnimationDuration: 1000;
chartType: Charts.ChartType.PIE;
chartOptions: {"segmentStrokeColor": "#ECECEC"};
chartData: [
{value: 15, color: "#6AA84F"},
{value: 3, color: "#DC3912"},
{value: 5, color: "#FF9900"}];
}
Column {
id: legend
Row {
spacing: units.gu(1)
Text {
text: "█"
color:"#6AA84F"
}
Text {
text: "15 tests passed"
}
}
Row {
spacing: units.gu(1)
Text {
text: "█"
color:"#DC3912"
}
Text {
text: "3 tests failed"
}
}
Row {
spacing: units.gu(1)
Text {
text: "█"
color:"#FF9900"
}
Text {
text: "5 tests skipped"
}
}
}
Button {
id: button
Layout.fillWidth: true
color: "#009E0F";
text: "Save detailed report";
font.bold: true;
onClicked: {
button.color = "#009E0F"
chart_pie.repaint();
}
}
}
}
}
}
Best Answer
To create Ubuntu touch applicaion with c++ core with UI in QML follow following steps:
Qt Creator
ctrl
+n
to create a new projectApplications
Qt Quick Application (Built-in Elements)
This will create a project with UI in QML and core in c++ there will be directory in project directory named
sources
. It will containmain.cpp
to start your application which will be loading themain.qml
.