From 284c2d501022d23e4cd860176443c5a502443f2f Mon Sep 17 00:00:00 2001 From: Anatasof Wirapraja Date: Wed, 2 Dec 2020 15:16:28 +0700 Subject: initial commit --- .gitignore | 73 +++++++++++++++++++++++++++++++ HomeForm.ui.qml | 12 +++++ Onboarding.qml | 10 +++++ OnboardingForm.ui.qml | 118 ++++++++++++++++++++++++++++++++++++++++++++++++++ QICPOS.pro | 30 +++++++++++++ QICPOS_en_US.ts | 3 ++ main.cpp | 20 +++++++++ main.qml | 17 ++++++++ qml.qrc | 9 ++++ qtquickcontrols2.conf | 7 +++ 10 files changed, 299 insertions(+) create mode 100644 .gitignore create mode 100644 HomeForm.ui.qml create mode 100644 Onboarding.qml create mode 100644 OnboardingForm.ui.qml create mode 100644 QICPOS.pro create mode 100644 QICPOS_en_US.ts create mode 100644 main.cpp create mode 100644 main.qml create mode 100644 qml.qrc create mode 100644 qtquickcontrols2.conf diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fab7372 --- /dev/null +++ b/.gitignore @@ -0,0 +1,73 @@ +# This file is used to ignore files which are generated +# ---------------------------------------------------------------------------- + +*~ +*.autosave +*.a +*.core +*.moc +*.o +*.obj +*.orig +*.rej +*.so +*.so.* +*_pch.h.cpp +*_resource.rc +*.qm +.#* +*.*# +core +!core/ +tags +.DS_Store +.directory +*.debug +Makefile* +*.prl +*.app +moc_*.cpp +ui_*.h +qrc_*.cpp +Thumbs.db +*.res +*.rc +/.qmake.cache +/.qmake.stash + +# qtcreator generated files +*.pro.user* + +# xemacs temporary files +*.flc + +# Vim temporary files +.*.swp + +# Visual Studio generated files +*.ib_pdb_index +*.idb +*.ilk +*.pdb +*.sln +*.suo +*.vcproj +*vcproj.*.*.user +*.ncb +*.sdf +*.opensdf +*.vcxproj +*vcxproj.* + +# MinGW generated files +*.Debug +*.Release + +# Python byte code +*.pyc + +# Binaries +# -------- +*.dll +*.exe + diff --git a/HomeForm.ui.qml b/HomeForm.ui.qml new file mode 100644 index 0000000..2df9430 --- /dev/null +++ b/HomeForm.ui.qml @@ -0,0 +1,12 @@ +import QtQuick 2.15 +import QtQuick.Controls 2.15 + +Page { + + title: qsTr("Home") + + Label { + text: qsTr("You are on the home page.") + anchors.centerIn: parent + } +} diff --git a/Onboarding.qml b/Onboarding.qml new file mode 100644 index 0000000..c850b17 --- /dev/null +++ b/Onboarding.qml @@ -0,0 +1,10 @@ +import QtQuick 2.4 + +OnboardingForm { + objectName: "onboarding" +} +/*##^## +Designer { + D{i:0;autoSize:true;height:480;width:640} +} +##^##*/ diff --git a/OnboardingForm.ui.qml b/OnboardingForm.ui.qml new file mode 100644 index 0000000..2b90394 --- /dev/null +++ b/OnboardingForm.ui.qml @@ -0,0 +1,118 @@ +import QtQuick 2.15 +import QtQuick.Controls 2.15 +import QtQuick.Layouts 1.3 +import QtQuick.Controls.Material 2.3 + +StackView { + property alias logoImage: logoImage + property alias onboardingImage: onboardingImage + property alias onboardingText1: onboardingText1 + property alias onboardingText2: onboardingText2 + property alias startButton: startButton + + initialItem: Page { + id: page + title: qsTr("Onboarding") + + ToolBar { + id: toolBar + + height: 56 + anchors.top: parent.top + anchors.topMargin: 0 + anchors.right: parent.right + anchors.rightMargin: 0 + anchors.left: parent.left + anchors.leftMargin: 0 + + background: Rectangle { + color: "transparent" + } + RowLayout { + anchors.fill: parent + + Image { + id: logoImage + Layout.preferredHeight: 24 + Layout.preferredWidth: 100 + fillMode: Image.PreserveAspectFit + Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter + Layout.fillWidth: false + Layout.fillHeight: false + source: "https://via.placeholder.com/100x24.png" + } + } + } + + StackView { + id: contentView + anchors.fill: parent + z: -1 + + Image { + id: onboardingImage + anchors.bottom: onboardingText1.top + anchors.bottomMargin: 32 + anchors.topMargin: 32 + toolBar.height + anchors.right: parent.right + anchors.rightMargin: 64 + anchors.left: parent.left + anchors.leftMargin: 64 + source: "https://via.placeholder.com/600x600.png" + fillMode: Image.PreserveAspectFit + } + Text { + id: onboardingText1 + text: qsTr("Onboarding text") + anchors.bottom: onboardingText2.top + anchors.bottomMargin: 4 + wrapMode: Text.WordWrap + anchors.right: parent.right + anchors.rightMargin: 72 + anchors.left: parent.left + anchors.leftMargin: 16 + font.pointSize: 24 + font.family: "Work Sans" + font.weight: Font.Bold + } + + Text { + id: onboardingText2 + color: "#99000000" + text: qsTr("Onboarding text 2") + anchors.bottom: startButton.top + anchors.bottomMargin: 16 + wrapMode: Text.WordWrap + anchors.right: parent.right + anchors.rightMargin: 72 + anchors.left: parent.left + anchors.leftMargin: 16 + font.pointSize: 16 + font.family: "WorkSans" + font.weight: Font.Normal + } + + RoundButton { + id: startButton + highlighted: true + Material.foreground: Material.primary + text: qsTr("Get Started") + anchors.right: parent.right + anchors.rightMargin: 8 + anchors.left: parent.left + anchors.leftMargin: 8 + anchors.bottom: parent.bottom + anchors.bottomMargin: 16 + font.capitalization: Font.MixedCase + font.family: "Work Sans" + } + } + } +} + +/*##^## +Designer { + D{i:0;autoSize:true;height:480;width:640} +} +##^##*/ + diff --git a/QICPOS.pro b/QICPOS.pro new file mode 100644 index 0000000..c4af5cf --- /dev/null +++ b/QICPOS.pro @@ -0,0 +1,30 @@ +QT += quick + +CONFIG += c++11 + +# You can make your code fail to compile if it uses deprecated APIs. +# In order to do so, uncomment the following line. +#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 + +SOURCES += \ + main.cpp + +RESOURCES += qml.qrc + +TRANSLATIONS += \ + QICPOS_en_US.ts + +# Additional import path used to resolve QML modules in Qt Creator's code model +QML_IMPORT_PATH = + +# Additional import path used to resolve QML modules just for Qt Quick Designer +QML_DESIGNER_IMPORT_PATH = + +# Default rules for deployment. +qnx: target.path = /tmp/$${TARGET}/bin +else: unix:!android: target.path = /opt/$${TARGET}/bin +!isEmpty(target.path): INSTALLS += target + +DISTFILES += + +ANDROID_ABIS = armeabi-v7a x86_64 diff --git a/QICPOS_en_US.ts b/QICPOS_en_US.ts new file mode 100644 index 0000000..fb354ba --- /dev/null +++ b/QICPOS_en_US.ts @@ -0,0 +1,3 @@ + + + diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..db8d3b8 --- /dev/null +++ b/main.cpp @@ -0,0 +1,20 @@ +#include +#include + +int main(int argc, char *argv[]) +{ + QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); + + QGuiApplication app(argc, argv); + + QQmlApplicationEngine engine; + const QUrl url(QStringLiteral("qrc:/main.qml")); + QObject::connect(&engine, &QQmlApplicationEngine::objectCreated, + &app, [url](QObject *obj, const QUrl &objUrl) { + if (!obj && url == objUrl) + QCoreApplication::exit(-1); + }, Qt::QueuedConnection); + engine.load(url); + + return app.exec(); +} diff --git a/main.qml b/main.qml new file mode 100644 index 0000000..2c8f227 --- /dev/null +++ b/main.qml @@ -0,0 +1,17 @@ +import QtQuick 2.15 +import QtQuick.Controls 2.15 +import QtQuick.Layouts 1.3 + +ApplicationWindow { + id: window + width: 360 + height: 640 + visible: true + + OnboardingForm { + id: pageView + anchors.fill: parent + onboardingText1.text: qsTr("Everything you need to sell online.") + onboardingText2.text: qsTr("Set up your store in minutes and bring your brand to life") + } +} diff --git a/qml.qrc b/qml.qrc new file mode 100644 index 0000000..02e45d3 --- /dev/null +++ b/qml.qrc @@ -0,0 +1,9 @@ + + + main.qml + HomeForm.ui.qml + qtquickcontrols2.conf + Onboarding.qml + OnboardingForm.ui.qml + + diff --git a/qtquickcontrols2.conf b/qtquickcontrols2.conf new file mode 100644 index 0000000..069c1db --- /dev/null +++ b/qtquickcontrols2.conf @@ -0,0 +1,7 @@ +[Controls] +Style=Material + +[Material] +Theme=Light +Accent=Cyan +Primary=BlueGrey -- cgit v1.2.3