Namespaces

Variants
Actions

Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

在Meego中如何把程序切换到后台

From Wiki
Jump to: navigation, search
Article Metadata
Article
Created: ()
Last edited: renlin (11 Jul 2012)

Contents

介绍

在应用程序开发中,我们有时会需要实现把程序切换到后台的功能,在Symbian上我们需要可以条用Symbian API来完成这个功能,那么在MEGGO上呢,我们是否需要调用系统级别API来完成这个功能,答案是NO,我们可以通过使用Qt Quick Components 的 Screen element来轻易的实现这个功能。接下来我们来看下具体的代码实现

代码实现

import QtQuick 1.1
import com.nokia.meego 1.0
 
Page {
tools: commonTools
 
Label {
id: label
anchors.centerIn: parent
text: qsTr("Hello world!")
visible: false
}
 
Button{
anchors {
horizontalCenter: parent.horizontalCenter
top: label.bottom
topMargin: 10
}
text: qsTr("Click here!")
onClicked: {
console.log("clicked");
 
screen.minimized = true
}
}
}

首先我们需要用 import com.nokia.meego 1.0 导入Qt quick component,其次我需要需要设置 Screen 的 minimized 属性为真

代码下载

File:TestScreenMin.zip


相关链接


Add categories below. Remove Category:Draft when the page is complete or near complete

This page was last modified on 11 July 2012, at 03:17.
184 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×