diff options
author | 2021-10-10 01:41:40 +0900 | |
---|---|---|
committer | 2021-10-10 01:41:40 +0900 | |
commit | 96d7cd593286e608bf65100eee567d9a328d40d9 (patch) | |
tree | 28a6df89529f836a7d7059ad60dbec9e7d9f44e3 /DateBox.qml |
Initial commit
Signed-off-by: Naoto Yamaguchi <naoto.yamaguchi@aisin.co.jp>
Diffstat (limited to 'DateBox.qml')
-rw-r--r-- | DateBox.qml | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/DateBox.qml b/DateBox.qml new file mode 100644 index 0000000..9b7a48f --- /dev/null +++ b/DateBox.qml @@ -0,0 +1,36 @@ +// SPDX-License-Identifier: GPL-3.0+ +// Copyright (C) 2021 AISIN CORPORATION + +import QtQuick 2.2 + +Item { + id: dateBox + property color timeColor: Qt.rgba(0.9,0.9,0.9,0.9) + property bool flashing: false + property string text: "" + property int pixSize: 20 + property var locale: Qt.locale() + property string dateString: "" + + Timer { + id: flashTimer + interval: 1000 + running: true + repeat: true + onTriggered: { + var currentDate = new Date(); + var formatString = "hh:mm ap"; + dateBoxText.text = currentDate.toLocaleTimeString(locale,formatString); + } + } + + Text { + id: dateBoxText + visible: true + font.pixelSize: pixSize + color: timeColor + horizontalAlignment: Text.AlignRight + anchors.horizontalCenter: parent.horizontalCenter + anchors.top: parent.verticalCenter + } +} |