diff options
author | 2018-01-03 02:39:23 +0900 | |
---|---|---|
committer | 2018-01-03 03:18:29 +0900 | |
commit | 7cd388558f49166b7df2811fdf649e93230017b5 (patch) | |
tree | 9fb17056c416f7b960fe68375af589634c6427fb /examples/aglextras/helloworld | |
parent | 8655fb6da62f8617b946e7c933ea151b43de2234 (diff) |
Qt AGLExtras module provides a set of easy to create AGL Qt
application. It uses the AGL HMI and application framework,
therefore the application can be easily integrated to AGL
HomeScreen/WindowManager on AGL Demo Platform.
Change-Id: I38a47aefcda8ee4ded759d56c5149ebbe22f94a9
Signed-off-by: Tadao Tanikawa <tanikawa.tadao@jp.panasonic.com>
Diffstat (limited to 'examples/aglextras/helloworld')
-rw-r--r-- | examples/aglextras/helloworld/helloworld.pro | 10 | ||||
-rw-r--r-- | examples/aglextras/helloworld/main.cpp | 28 | ||||
-rw-r--r-- | examples/aglextras/helloworld/qml/helloworld/main.qml | 15 | ||||
-rw-r--r-- | examples/aglextras/helloworld/resources.qrc | 5 |
4 files changed, 58 insertions, 0 deletions
diff --git a/examples/aglextras/helloworld/helloworld.pro b/examples/aglextras/helloworld/helloworld.pro new file mode 100644 index 0000000..6db8e40 --- /dev/null +++ b/examples/aglextras/helloworld/helloworld.pro @@ -0,0 +1,10 @@ +QT += aglextras qml quick + +SOURCES += \ + main.cpp + +RESOURCES += \ + resources.qrc + +target.path = $$[QT_INSTALL_EXAMPLES]/aglextras/helloworld +INSTALLS += target diff --git a/examples/aglextras/helloworld/main.cpp b/examples/aglextras/helloworld/main.cpp new file mode 100644 index 0000000..08b2e97 --- /dev/null +++ b/examples/aglextras/helloworld/main.cpp @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2017 The Qt Company Ltd. + * Copyright (c) 2017 Panasonic Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include <QtAGLExtras/AGLApplication> +#include <QtCore/QUrlQuery> + +int main(int argc, char *argv[]) +{ + AGLApplication app(argc, argv); + app.setApplicationName("HelloWorld"); + app.setupApplicationRole("Settings"); + app.load(QUrl(QStringLiteral("qrc:/helloworld.qml"))); + return app.exec(); +} diff --git a/examples/aglextras/helloworld/qml/helloworld/main.qml b/examples/aglextras/helloworld/qml/helloworld/main.qml new file mode 100644 index 0000000..f0c5be1 --- /dev/null +++ b/examples/aglextras/helloworld/qml/helloworld/main.qml @@ -0,0 +1,15 @@ +import QtQuick 2.0 + +Rectangle { + id: page + width: 320; height: 480 + color: "lightgray" + + Text { + id: helloText + text: "Hello world!" + y: 30 + anchors.horizontalCenter: page.horizontalCenter + font.pointSize: 24; font.bold: true + } +} diff --git a/examples/aglextras/helloworld/resources.qrc b/examples/aglextras/helloworld/resources.qrc new file mode 100644 index 0000000..8a1a2e2 --- /dev/null +++ b/examples/aglextras/helloworld/resources.qrc @@ -0,0 +1,5 @@ +<RCC> + <qresource prefix="/"> + <file>qml/helloworld/main.qml</file> + </qresource> +</RCC> |