您现在的位置是:主页 > news > 北京响应式网站建设/seo流量

北京响应式网站建设/seo流量

admin2025/6/12 23:47:07news

简介北京响应式网站建设,seo流量,域名备案成功如何做网站,wordpress4.8.1我们可以QML应用中设置alarm来完成一些提醒的工作。为了使得它能够工作,我们必须加入calendar policy。由于calendar policy目前还是处于reserved状态,所以我们目前只能做测试使用。等将来正式发布后,就可以使用了。 import QtQuick 2.4 impo…

北京响应式网站建设,seo流量,域名备案成功如何做网站,wordpress4.8.1我们可以QML应用中设置alarm来完成一些提醒的工作。为了使得它能够工作,我们必须加入calendar policy。由于calendar policy目前还是处于reserved状态,所以我们目前只能做测试使用。等将来正式发布后,就可以使用了。 import QtQuick 2.4 impo…

我们可以QML应用中设置alarm来完成一些提醒的工作。为了使得它能够工作,我们必须加入calendar policy。由于calendar policy目前还是处于reserved状态,所以我们目前只能做测试使用。等将来正式发布后,就可以使用了。


import QtQuick 2.4
import Ubuntu.Components 1.2/*!\brief MainView with a Label and Button elements.
*/MainView {// objectName for functional testing purposes (autopilot-qt5)objectName: "mainView"// Note! applicationName needs to match the "name" field of the click manifestapplicationName: "alarm.liu-xiao-guo"/*This property enables the application to change orientationwhen the device is rotated. The default is false.*///automaticOrientation: true// Removes the old toolbar and enables new features of the new header.
//    useDeprecatedToolbar: falsewidth: units.gu(60)height: units.gu(85)Page {title: i18n.tr("alarm")Alarm{id: alarm}Column {spacing: units.gu(1)Row {spacing: units.gu(1)Label {id: datetext: "Date:"anchors.verticalCenter: parent.verticalCenter}TextField {text: alarm.date.toString()onAccepted: {console.log("this is cool!");onAccepted: alarm.date = new Date(text)}}}Row {spacing: units.gu(1)Label {id: msgtext: "Message:"anchors.verticalCenter: parent.verticalCenter}TextField {text: alarm.messageonAccepted: {console.log("Setting the alarm message!")alarm.message = text}}}Button {text: "Save"onClicked: {var now = new Date();var newdate = new Date(now.getTime() + 10*1000);console.log("now: " + newdate.toLocaleDateString())alarm.date = newdate;alarm.save();if (alarm.error !== Alarm.NoError) {print("Error saving alarm, code: " + alarm.error);} else {print("There is no error!")}}}}}
}


在我们的应用中,当我们设置alarm时,我们把当前的时间加上10秒,然后设置时间:


            Button {text: "Save"onClicked: {var now = new Date();var newdate = new Date(now.getTime() + 10*1000);console.log("now: " + newdate.toLocaleDateString())alarm.date = newdate;alarm.save();if (alarm.error !== Alarm.NoError) {print("Error saving alarm, code: " + alarm.error);} else {print("There is no error!")}}

这样,当10秒钟过后,就会有我们的alarm信息。


  


整个项目的源码:https://github.com/liu-xiao-guo/alarm