From e5429cf6eb8f83be50b4fb7d764375f7c3713265 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=EA=A6=AB=EA=A6=B6=EA=A6=8F=EA=A7=80=EA=A6=A6?= =?UTF-8?q?=EA=A6=BF=EA=A6=A7=EA=A6=AE=EA=A6=91=EA=A6=A9=EA=A6=AD=EA=A7=80?= Date: Mon, 12 Jul 2021 10:54:05 +0800 Subject: Link view to give it some delay before user goes to their catalog. Update the handler to conform to the updated shop results page. Make the stack push relation more generic, that what view gets pushed is decided in the C++ controller, not the QML views. Refactor code. --- Link.qml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 Link.qml (limited to 'Link.qml') diff --git a/Link.qml b/Link.qml new file mode 100644 index 0000000..199d552 --- /dev/null +++ b/Link.qml @@ -0,0 +1,30 @@ +import QtQuick 2.15 +import QtQuick.Controls 2.15 +import QtQuick.Layouts 1.15 + +Rectangle { + property string arg + color: "#2a2a2a" + ColumnLayout { + anchors.centerIn: parent + Image { + Layout.alignment: Qt.AlignCenter + source: "images/2be179c1-b901-4db5-b9ab-81327a450ee5.png" + } + Text { + objectName: "link" + signal catalog(string brand) + function push(view, arg) { + stack.push(view + ".qml", { + "arg": arg + }) + pushed() + } + signal pushed() + Layout.alignment: Qt.AlignCenter + text: "https://darapsa.com/" + arg + "" + linkColor: "#ffffff" + onLinkActivated: catalog(arg) + } + } +} -- cgit v1.2.3