×
Namespaces

Variants
Actions
(Difference between revisions)

用QtFeedback实现手机震动效果

From Nokia Developer Wiki
Jump to: navigation, search
renlin (Talk | contribs)
(Renlin - - 实现)
hamishwillee (Talk | contribs)
m (Text replace - "Category:MeeGo" to "Category:MeeGo Harmattan")
 
(One intermediate revision by one user not shown)
Line 1: Line 1:
[[Category:Qt Mobility]][[Category:MeeGo]][[Category:Lang-Chinese]]
+
[[Category:Qt Mobility]][[Category:MeeGo Harmattan]][[Category:Lang-Chinese]]
 
''Delete instructional text in italic''
 
''Delete instructional text in italic''
  
Line 59: Line 59:
 
== 相关连接==
 
== 相关连接==
 
*[[Qt 开发]]
 
*[[Qt 开发]]
*[[Meego 开发]]
+
*[[Meego开发]]
 
*[[用Qt控制Symbian Device震动 ]]
 
*[[用Qt控制Symbian Device震动 ]]
  
  
 
''Add categories below. Remove Category:Draft when the page is complete or near complete''
 
''Add categories below. Remove Category:Draft when the page is complete or near complete''

Latest revision as of 13:59, 13 June 2012

Delete instructional text in italic

This article explains how to ... Replace the abstract text with a short paragraph (or sentence) describing what the topic covers.

Enter article metadata as described below. Note that this template can be placed anywhere in the article. Do not remove parameters that you do not use

Article Metadata
Article
Created: ()
Last edited: hamishwillee (13 Jun 2012)

[edit] Introduction

本文介绍如果用QML 实现手机的震动效果.
在Meego系统的手机上实现手机的震动效果,直接使用QtMobility中的QtFeedBack就可。

[edit] 实现

用QtFeedBack模块实现手机的震动效果的类为QFeedbackHapticsEffect,其对应的QML 元素为HapticsEffect,本文就用QML HapticsEffect ELement来实现震动效果。
1,在pro文件中导入feedback模块

 CONFIG += mobility
MOBILITY += feedback

2,在QML文件中导入feedback 模块

import QtMobility.feedback 1.1

3,在qml文件中的代码实现

HapticsEffect {
id: rumbleEffect
attackIntensity: 0.0
attackTime: 250
intensity: 1.0
duration: 500
fadeTime: 250
fadeIntensity: 0.0
}

代码下载:File:Testvibration.zip

[edit] 相关连接


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

This page was last modified on 13 June 2012, at 13:59.
89 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.

×