Add QT hello example source code and build shell script
New file |
| | |
| | | import QtQuick 2.5
|
| | |
|
| | | Rectangle {
|
| | | property alias mouseArea: mouseArea
|
| | |
|
| | | width: 360
|
| | | height: 360
|
| | |
|
| | | MouseArea {
|
| | | id: mouseArea
|
| | | anchors.fill: parent
|
| | | }
|
| | |
|
| | | Text {
|
| | | anchors.centerIn: parent
|
| | | text: "Hello World"
|
| | | }
|
| | | }
|
New file |
| | |
| | | #!/bin/bash |
| | | |
| | | # export qmake command path |
| | | export PATH=$PATH:/apps/qt5_rpi/bin/ |
| | | |
| | | # project name is current working directory name |
| | | PRJ_NAME=$(basename `pwd`) |
| | | |
| | | # generate project file |
| | | rm -f ${PRJ_NAME}.pro |
| | | qmake -project |
| | | |
| | | # Add qml support to fix bug: QQmlApplicationEngine: No such file or directory |
| | | echo "QT += qml" >> ${PRJ_NAME}.pro |
| | | |
| | | # generate makefile |
| | | qmake -makefile ${PRJ_NAME}.pro |
| | | |
| | | |
| | | # start to cross compile |
| | | make && make clean |
| | | |
New file |
| | |
| | | #include <QGuiApplication>
|
| | | #include <QQmlApplicationEngine>
|
| | |
|
| | | int main(int argc, char *argv[])
|
| | | {
|
| | | QGuiApplication app(argc, argv);
|
| | |
|
| | | QQmlApplicationEngine engine;
|
| | | engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
|
| | |
|
| | | return app.exec();
|
| | | }
|
New file |
| | |
| | | import QtQuick 2.5
|
| | | import QtQuick.Window 2.2
|
| | |
|
| | | Window {
|
| | | visible: true
|
| | | width: 640
|
| | | height: 480
|
| | | title: qsTr("Hello World")
|
| | |
|
| | | MainForm {
|
| | | anchors.fill: parent
|
| | | mouseArea.onClicked: {
|
| | | Qt.quit();
|
| | | }
|
| | |
|
| | | Text {
|
| | | id: text1
|
| | | x: 131
|
| | | y: 136
|
| | | width: 100
|
| | | height: 20
|
| | | text: "192.168.1.10"
|
| | | font.pixelSize: 12
|
| | | }
|
| | |
|
| | | TextInput {
|
| | | id: textInput1
|
| | | x: 45
|
| | | y: 136
|
| | | width: 80
|
| | | height: 20
|
| | | text: "IP地址"
|
| | | font.pixelSize: 12
|
| | | }
|
| | |
|
| | | TextEdit {
|
| | | id: textEdit1
|
| | | x: 261
|
| | | y: 136
|
| | | width: 80
|
| | | height: 20
|
| | | text: qsTr("Text Edit")
|
| | | font.pixelSize: 12
|
| | | }
|
| | |
|
| | | Rectangle {
|
| | | id: rectangle1
|
| | | x: 380
|
| | | y: 165
|
| | | width: 200
|
| | | height: 200
|
| | | color: "#ffffff"
|
| | | }
|
| | |
|
| | | Image {
|
| | | id: image1
|
| | | x: 25
|
| | | y: 245
|
| | | width: 100
|
| | | height: 100
|
| | | source: "qrc:/qtquickplugin/images/template_image.png"
|
| | | }
|
| | |
|
| | | Item {
|
| | | id: item1
|
| | | x: 149
|
| | | y: 187
|
| | | width: 200
|
| | | height: 200
|
| | | }
|
| | |
|
| | | MainForm {
|
| | | id: mainForm1
|
| | | x: 163
|
| | | y: 52
|
| | | }
|
| | | }
|
| | | }
|
New file |
| | |
| | | <RCC>
|
| | | <qresource prefix="/">
|
| | | <file>main.qml</file>
|
| | | <file>MainForm.ui.qml</file>
|
| | | </qresource>
|
| | | </RCC>
|