summaryrefslogtreecommitdiffstats
path: root/examples/aglextras/helloworld
diff options
context:
space:
mode:
Diffstat (limited to 'examples/aglextras/helloworld')
-rw-r--r--examples/aglextras/helloworld/helloworld.pro10
-rw-r--r--examples/aglextras/helloworld/main.cpp28
-rw-r--r--examples/aglextras/helloworld/qml/helloworld/main.qml15
-rw-r--r--examples/aglextras/helloworld/resources.qrc5
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>