Warning, /frameworks/kholidays/tests/example.qml is written in an unsupported language. File is not indexed.
0001 /*
0002 SPDX-FileCopyrightText: 2022 Volker Krause <vkrause@kde.org>
0003 SPDX-License-Identifier: LGPL-2.0-or-later
0004 */
0005
0006 import QtQuick 2.15
0007 import QtQuick.Controls 2.15
0008 import QtQuick.Layouts 1.15
0009 import org.kde.kholidays 1.0 as KHolidays
0010
0011 ApplicationWindow {
0012 visible: true
0013 width: 720
0014 height: 480
0015
0016 ColumnLayout {
0017 RowLayout {
0018 Label {
0019 text: "Position:"
0020 }
0021 TextField {
0022 id: lat
0023 placeholderText: "latitude"
0024 text: "46.09902"
0025 }
0026 TextField {
0027 id: lon
0028 placeholderText: "longitude"
0029 text: "7.78328"
0030 }
0031 }
0032
0033 Label {
0034 text: "Dawn: " + KHolidays.SunRiseSet.utcDawn(new Date(), lat.text, lon.text)
0035 }
0036 Label {
0037 text: "Sunrise: " + KHolidays.SunRiseSet.utcSunrise(new Date(), lat.text, lon.text)
0038 }
0039 Label {
0040 text: "Sunset: " + KHolidays.SunRiseSet.utcSunset(new Date(), lat.text, lon.text)
0041 }
0042 Label {
0043 text: "Dusk: " + KHolidays.SunRiseSet.utcDusk(new Date(), lat.text, lon.text)
0044 }
0045 Label {
0046 text: "Polar day: " + KHolidays.SunRiseSet.isPolarDay(new Date(), lat.text)
0047 }
0048 Label {
0049 text: "Polar twilight: " + KHolidays.SunRiseSet.isPolarTwilight(new Date(), lat.text)
0050 }
0051 Label {
0052 text: "Polar night: " + KHolidays.SunRiseSet.isPolarNight(new Date(), lat.text)
0053 }
0054
0055 Label {
0056 text: "Lunar phase: " + KHolidays.Lunar.phaseNameAtDate(new Date())
0057 }
0058 Label {
0059 text: KHolidays.Lunar.phaseAtDate(new Date()) == KHolidays.LunarPhase.FullMoon ? KHolidays.Lunar.phaseName(KHolidays.LunarPhase.FullMoon) : "not a " + KHolidays.Lunar.phaseName(KHolidays.LunarPhase.FullMoon)
0060 }
0061 }
0062
0063 Component.onCompleted: console.log(KHolidays.SunRiseSet)
0064 }